From 4bd962c818299f0ceeda00c71fd3a84a99629350 Mon Sep 17 00:00:00 2001 From: Brian Esler Date: Thu, 13 Nov 2025 14:04:43 -0800 Subject: [PATCH 1/3] feat(api): endpoints added for fiat onramp credential deletion, email auth v3, user email recovery v2, init otp auth v3, and init otp v2. --- api/public_api.swagger.json | 287 ++++++++++++++++-- pkg/api/models/activity_type.go | 14 +- pkg/api/models/email_auth_intent_v3.go | 179 +++++++++++ pkg/api/models/email_auth_request.go | 10 +- pkg/api/models/eth_send_transaction_intent.go | 75 +---- pkg/api/models/eth_send_transaction_result.go | 62 +--- pkg/api/models/init_otp_auth_intent_v3.go | 230 ++++++++++++++ pkg/api/models/init_otp_auth_request.go | 10 +- pkg/api/models/init_otp_intent_v2.go | 233 ++++++++++++++ pkg/api/models/init_otp_request.go | 10 +- .../init_user_email_recovery_intent_v2.go | 173 +++++++++++ .../init_user_email_recovery_request.go | 10 +- pkg/api/models/intent.go | 204 +++++++++++++ pkg/api/models/result.go | 50 +-- .../models/update_auth_proxy_config_intent.go | 2 +- 15 files changed, 1322 insertions(+), 227 deletions(-) create mode 100644 pkg/api/models/email_auth_intent_v3.go create mode 100644 pkg/api/models/init_otp_auth_intent_v3.go create mode 100644 pkg/api/models/init_otp_intent_v2.go create mode 100644 pkg/api/models/init_user_email_recovery_intent_v2.go diff --git a/api/public_api.swagger.json b/api/public_api.swagger.json index 08f2713..8807105 100644 --- a/api/public_api.swagger.json +++ b/api/public_api.swagger.json @@ -3132,7 +3132,11 @@ "ACTIVITY_TYPE_ETH_SEND_TRANSACTION", "ACTIVITY_TYPE_CREATE_FIAT_ON_RAMP_CREDENTIAL", "ACTIVITY_TYPE_UPDATE_FIAT_ON_RAMP_CREDENTIAL", - "ACTIVITY_TYPE_DELETE_FIAT_ON_RAMP_CREDENTIAL" + "ACTIVITY_TYPE_DELETE_FIAT_ON_RAMP_CREDENTIAL", + "ACTIVITY_TYPE_EMAIL_AUTH_V3", + "ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY_V2", + "ACTIVITY_TYPE_INIT_OTP_AUTH_V3", + "ACTIVITY_TYPE_INIT_OTP_V2" ] }, "AddressFormat": { @@ -6160,12 +6164,65 @@ }, "required": ["email", "targetPublicKey"] }, + "EmailAuthIntentV3": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email of the authenticating user." + }, + "targetPublicKey": { + "type": "string", + "description": "Client-side public key generated by the user, to which the email auth bundle (credentials) will be encrypted." + }, + "appName": { + "type": "string", + "description": "The name of the application." + }, + "apiKeyName": { + "type": "string", + "x-nullable": true, + "description": "Optional human-readable name for an API Key. If none provided, default to Email Auth - \u003cTimestamp\u003e" + }, + "expirationSeconds": { + "type": "string", + "x-nullable": true, + "description": "Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used." + }, + "emailCustomization": { + "$ref": "#/definitions/EmailCustomizationParams", + "x-nullable": true, + "description": "Optional parameters for customizing emails. If not provided, the default email will be used." + }, + "invalidateExisting": { + "type": "boolean", + "x-nullable": true, + "description": "Invalidate all other previously generated Email Auth API keys" + }, + "sendFromEmailAddress": { + "type": "string", + "x-nullable": true, + "description": "Optional custom email address from which to send the email" + }, + "sendFromEmailSenderName": { + "type": "string", + "x-nullable": true, + "description": "Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'" + }, + "replyToEmailAddress": { + "type": "string", + "x-nullable": true, + "description": "Optional custom email address to use as reply-to" + } + }, + "required": ["email", "targetPublicKey", "appName"] + }, "EmailAuthRequest": { "type": "object", "properties": { "type": { "type": "string", - "enum": ["ACTIVITY_TYPE_EMAIL_AUTH_V2"] + "enum": ["ACTIVITY_TYPE_EMAIL_AUTH_V3"] }, "timestampMs": { "type": "string", @@ -6176,7 +6233,7 @@ "description": "Unique identifier for a given Organization." }, "parameters": { - "$ref": "#/definitions/EmailAuthIntentV2" + "$ref": "#/definitions/EmailAuthIntentV3" } }, "required": ["type", "timestampMs", "organizationId", "parameters"] @@ -6328,38 +6385,35 @@ "nonce": { "type": "string", "x-nullable": true, - "description": "Transaction nonce." + "description": "Transaction nonce, for EIP-1559 and Turnkey Gas Station authorizations." }, "gasLimit": { "type": "string", "x-nullable": true, - "description": "Maximum amount of gas to use for this transaction." + "description": "Maximum amount of gas to use for this transaction, for EIP-1559 transactions." }, "maxFeePerGas": { "type": "string", "x-nullable": true, - "description": "Maximum total fee per gas unit (base fee + priority fee) in wei, for EIP-1559 transactions." + "description": "Maximum total fee per gas unit (base fee + priority fee) in wei. Required for non-sponsored (EIP-1559) transactions. Not used for sponsored transactions." }, "maxPriorityFeePerGas": { "type": "string", "x-nullable": true, - "description": "Maximum priority fee (tip) per gas unit in wei, for EIP-1559 transactions." + "description": "Maximum priority fee (tip) per gas unit in wei. Required for non-sponsored (EIP-1559) transactions. Not used for sponsored transactions." }, "deadline": { "type": "string", "x-nullable": true, "description": "Unix timestamp after which the Gas Station meta-transaction is no longer valid. Only used when sponsor=true." + }, + "gasStationNonce": { + "type": "string", + "x-nullable": true, + "description": "The gas station delegate contract nonce. Only used when sponsor=true." } }, - "required": [ - "from", - "caip2", - "to", - "nonce", - "gasLimit", - "maxFeePerGas", - "maxPriorityFeePerGas" - ] + "required": ["from", "caip2", "to"] }, "EthSendTransactionRequest": { "type": "object", @@ -6383,14 +6437,7 @@ "required": ["type", "timestampMs", "organizationId", "parameters"] }, "EthSendTransactionResult": { - "type": "object", - "properties": { - "transactionHash": { - "type": "string", - "description": "The transaction hash of the sent transaction" - } - }, - "required": ["transactionHash"] + "type": "object" }, "ExportPrivateKeyIntent": { "type": "object", @@ -7892,12 +7939,71 @@ }, "required": ["otpType", "contact"] }, + "InitOtpAuthIntentV3": { + "type": "object", + "properties": { + "otpType": { + "type": "string", + "description": "Enum to specifiy whether to send OTP via SMS or email" + }, + "contact": { + "type": "string", + "description": "Email or phone number to send the OTP code to" + }, + "appName": { + "type": "string", + "description": "The name of the application." + }, + "otpLength": { + "type": "integer", + "format": "int32", + "x-nullable": true, + "description": "Optional length of the OTP code. Default = 9" + }, + "emailCustomization": { + "$ref": "#/definitions/EmailCustomizationParams", + "x-nullable": true, + "description": "Optional parameters for customizing emails. If not provided, the default email will be used." + }, + "smsCustomization": { + "$ref": "#/definitions/SmsCustomizationParams", + "x-nullable": true, + "description": "Optional parameters for customizing SMS message. If not provided, the default sms message will be used." + }, + "userIdentifier": { + "type": "string", + "x-nullable": true, + "description": "Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address." + }, + "sendFromEmailAddress": { + "type": "string", + "x-nullable": true, + "description": "Optional custom email address from which to send the OTP email" + }, + "alphanumeric": { + "type": "boolean", + "x-nullable": true, + "description": "Optional flag to specify if the OTP code should be alphanumeric (Crockford’s Base32). Default = true" + }, + "sendFromEmailSenderName": { + "type": "string", + "x-nullable": true, + "description": "Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'" + }, + "replyToEmailAddress": { + "type": "string", + "x-nullable": true, + "description": "Optional custom email address to use as reply-to" + } + }, + "required": ["otpType", "contact", "appName"] + }, "InitOtpAuthRequest": { "type": "object", "properties": { "type": { "type": "string", - "enum": ["ACTIVITY_TYPE_INIT_OTP_AUTH_V2"] + "enum": ["ACTIVITY_TYPE_INIT_OTP_AUTH_V3"] }, "timestampMs": { "type": "string", @@ -7908,7 +8014,7 @@ "description": "Unique identifier for a given Organization." }, "parameters": { - "$ref": "#/definitions/InitOtpAuthIntentV2" + "$ref": "#/definitions/InitOtpAuthIntentV3" } }, "required": ["type", "timestampMs", "organizationId", "parameters"] @@ -7993,12 +8099,76 @@ }, "required": ["otpType", "contact"] }, + "InitOtpIntentV2": { + "type": "object", + "properties": { + "otpType": { + "type": "string", + "description": "Whether to send OTP via SMS or email. Possible values: OTP_TYPE_SMS, OTP_TYPE_EMAIL" + }, + "contact": { + "type": "string", + "description": "Email or phone number to send the OTP code to" + }, + "appName": { + "type": "string", + "description": "The name of the application." + }, + "otpLength": { + "type": "integer", + "format": "int32", + "x-nullable": true, + "description": "Optional length of the OTP code. Default = 9" + }, + "emailCustomization": { + "$ref": "#/definitions/EmailCustomizationParams", + "x-nullable": true, + "description": "Optional parameters for customizing emails. If not provided, the default email will be used." + }, + "smsCustomization": { + "$ref": "#/definitions/SmsCustomizationParams", + "x-nullable": true, + "description": "Optional parameters for customizing SMS message. If not provided, the default sms message will be used." + }, + "userIdentifier": { + "type": "string", + "x-nullable": true, + "description": "Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address." + }, + "sendFromEmailAddress": { + "type": "string", + "x-nullable": true, + "description": "Optional custom email address from which to send the OTP email" + }, + "alphanumeric": { + "type": "boolean", + "x-nullable": true, + "description": "Optional flag to specify if the OTP code should be alphanumeric (Crockford’s Base32). Default = true" + }, + "sendFromEmailSenderName": { + "type": "string", + "x-nullable": true, + "description": "Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'" + }, + "expirationSeconds": { + "type": "string", + "x-nullable": true, + "description": "Expiration window (in seconds) indicating how long the OTP is valid for. If not provided, a default of 5 minutes will be used. Maximum value is 600 seconds (10 minutes)" + }, + "replyToEmailAddress": { + "type": "string", + "x-nullable": true, + "description": "Optional custom email address to use as reply-to" + } + }, + "required": ["otpType", "contact", "appName"] + }, "InitOtpRequest": { "type": "object", "properties": { "type": { "type": "string", - "enum": ["ACTIVITY_TYPE_INIT_OTP"] + "enum": ["ACTIVITY_TYPE_INIT_OTP_V2"] }, "timestampMs": { "type": "string", @@ -8009,7 +8179,7 @@ "description": "Unique identifier for a given Organization." }, "parameters": { - "$ref": "#/definitions/InitOtpIntent" + "$ref": "#/definitions/InitOtpIntentV2" } }, "required": ["type", "timestampMs", "organizationId", "parameters"] @@ -8063,12 +8233,55 @@ }, "required": ["email", "targetPublicKey"] }, + "InitUserEmailRecoveryIntentV2": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email of the user starting recovery" + }, + "targetPublicKey": { + "type": "string", + "description": "Client-side public key generated by the user, to which the recovery bundle will be encrypted." + }, + "appName": { + "type": "string", + "description": "The name of the application." + }, + "expirationSeconds": { + "type": "string", + "x-nullable": true, + "description": "Expiration window (in seconds) indicating how long the recovery credential is valid for. If not provided, a default of 15 minutes will be used." + }, + "emailCustomization": { + "$ref": "#/definitions/EmailCustomizationParams", + "x-nullable": true, + "description": "Optional parameters for customizing emails. If not provided, the default email will be used." + }, + "sendFromEmailAddress": { + "type": "string", + "x-nullable": true, + "description": "Optional custom email address from which to send the OTP email" + }, + "sendFromEmailSenderName": { + "type": "string", + "x-nullable": true, + "description": "Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'" + }, + "replyToEmailAddress": { + "type": "string", + "x-nullable": true, + "description": "Optional custom email address to use as reply-to" + } + }, + "required": ["email", "targetPublicKey", "appName"] + }, "InitUserEmailRecoveryRequest": { "type": "object", "properties": { "type": { "type": "string", - "enum": ["ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY"] + "enum": ["ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY_V2"] }, "timestampMs": { "type": "string", @@ -8079,7 +8292,7 @@ "description": "Unique identifier for a given Organization." }, "parameters": { - "$ref": "#/definitions/InitUserEmailRecoveryIntent" + "$ref": "#/definitions/InitUserEmailRecoveryIntentV2" } }, "required": ["type", "timestampMs", "organizationId", "parameters"] @@ -8420,6 +8633,18 @@ }, "deleteFiatOnRampCredentialIntent": { "$ref": "#/definitions/DeleteFiatOnRampCredentialIntent" + }, + "emailAuthIntentV3": { + "$ref": "#/definitions/EmailAuthIntentV3" + }, + "initUserEmailRecoveryIntentV2": { + "$ref": "#/definitions/InitUserEmailRecoveryIntentV2" + }, + "initOtpIntentV2": { + "$ref": "#/definitions/InitOtpIntentV2" + }, + "initOtpAuthIntentV3": { + "$ref": "#/definitions/InitOtpAuthIntentV3" } } }, @@ -10375,7 +10600,7 @@ "emailCustomizationParams": { "$ref": "#/definitions/EmailCustomizationParams", "x-nullable": true, - "description": "Overrides for auth-related email content." + "description": "Optional parameters for customizing emails. If not provided, the default email will be used." }, "smsCustomizationParams": { "$ref": "#/definitions/SmsCustomizationParams", diff --git a/pkg/api/models/activity_type.go b/pkg/api/models/activity_type.go index 1ab7c5f..00f354b 100644 --- a/pkg/api/models/activity_type.go +++ b/pkg/api/models/activity_type.go @@ -353,6 +353,18 @@ const ( // ActivityTypeDeleteFiatOnRampCredential captures enum value "ACTIVITY_TYPE_DELETE_FIAT_ON_RAMP_CREDENTIAL" ActivityTypeDeleteFiatOnRampCredential ActivityType = "ACTIVITY_TYPE_DELETE_FIAT_ON_RAMP_CREDENTIAL" + + // ActivityTypeEmailAuthV3 captures enum value "ACTIVITY_TYPE_EMAIL_AUTH_V3" + ActivityTypeEmailAuthV3 ActivityType = "ACTIVITY_TYPE_EMAIL_AUTH_V3" + + // ActivityTypeInitUserEmailRecoveryV2 captures enum value "ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY_V2" + ActivityTypeInitUserEmailRecoveryV2 ActivityType = "ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY_V2" + + // ActivityTypeInitOtpAuthV3 captures enum value "ACTIVITY_TYPE_INIT_OTP_AUTH_V3" + ActivityTypeInitOtpAuthV3 ActivityType = "ACTIVITY_TYPE_INIT_OTP_AUTH_V3" + + // ActivityTypeInitOtpV2 captures enum value "ACTIVITY_TYPE_INIT_OTP_V2" + ActivityTypeInitOtpV2 ActivityType = "ACTIVITY_TYPE_INIT_OTP_V2" ) // for schema @@ -360,7 +372,7 @@ var ActivityTypeEnum []ActivityType func init() { var res []ActivityType - if err := json.Unmarshal([]byte(`["ACTIVITY_TYPE_CREATE_API_KEYS","ACTIVITY_TYPE_CREATE_USERS","ACTIVITY_TYPE_CREATE_PRIVATE_KEYS","ACTIVITY_TYPE_SIGN_RAW_PAYLOAD","ACTIVITY_TYPE_CREATE_INVITATIONS","ACTIVITY_TYPE_ACCEPT_INVITATION","ACTIVITY_TYPE_CREATE_POLICY","ACTIVITY_TYPE_DISABLE_PRIVATE_KEY","ACTIVITY_TYPE_DELETE_USERS","ACTIVITY_TYPE_DELETE_API_KEYS","ACTIVITY_TYPE_DELETE_INVITATION","ACTIVITY_TYPE_DELETE_ORGANIZATION","ACTIVITY_TYPE_DELETE_POLICY","ACTIVITY_TYPE_CREATE_USER_TAG","ACTIVITY_TYPE_DELETE_USER_TAGS","ACTIVITY_TYPE_CREATE_ORGANIZATION","ACTIVITY_TYPE_SIGN_TRANSACTION","ACTIVITY_TYPE_APPROVE_ACTIVITY","ACTIVITY_TYPE_REJECT_ACTIVITY","ACTIVITY_TYPE_DELETE_AUTHENTICATORS","ACTIVITY_TYPE_CREATE_AUTHENTICATORS","ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG","ACTIVITY_TYPE_DELETE_PRIVATE_KEY_TAGS","ACTIVITY_TYPE_SET_PAYMENT_METHOD","ACTIVITY_TYPE_ACTIVATE_BILLING_TIER","ACTIVITY_TYPE_DELETE_PAYMENT_METHOD","ACTIVITY_TYPE_CREATE_POLICY_V2","ACTIVITY_TYPE_CREATE_POLICY_V3","ACTIVITY_TYPE_CREATE_API_ONLY_USERS","ACTIVITY_TYPE_UPDATE_ROOT_QUORUM","ACTIVITY_TYPE_UPDATE_USER_TAG","ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG","ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2","ACTIVITY_TYPE_CREATE_ORGANIZATION_V2","ACTIVITY_TYPE_CREATE_USERS_V2","ACTIVITY_TYPE_ACCEPT_INVITATION_V2","ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION","ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V2","ACTIVITY_TYPE_UPDATE_ALLOWED_ORIGINS","ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2","ACTIVITY_TYPE_UPDATE_USER","ACTIVITY_TYPE_UPDATE_POLICY","ACTIVITY_TYPE_SET_PAYMENT_METHOD_V2","ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V3","ACTIVITY_TYPE_CREATE_WALLET","ACTIVITY_TYPE_CREATE_WALLET_ACCOUNTS","ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY","ACTIVITY_TYPE_RECOVER_USER","ACTIVITY_TYPE_SET_ORGANIZATION_FEATURE","ACTIVITY_TYPE_REMOVE_ORGANIZATION_FEATURE","ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2","ACTIVITY_TYPE_SIGN_TRANSACTION_V2","ACTIVITY_TYPE_EXPORT_PRIVATE_KEY","ACTIVITY_TYPE_EXPORT_WALLET","ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V4","ACTIVITY_TYPE_EMAIL_AUTH","ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT","ACTIVITY_TYPE_INIT_IMPORT_WALLET","ACTIVITY_TYPE_IMPORT_WALLET","ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY","ACTIVITY_TYPE_IMPORT_PRIVATE_KEY","ACTIVITY_TYPE_CREATE_POLICIES","ACTIVITY_TYPE_SIGN_RAW_PAYLOADS","ACTIVITY_TYPE_CREATE_READ_ONLY_SESSION","ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS","ACTIVITY_TYPE_DELETE_OAUTH_PROVIDERS","ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V5","ACTIVITY_TYPE_OAUTH","ACTIVITY_TYPE_CREATE_API_KEYS_V2","ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION","ACTIVITY_TYPE_EMAIL_AUTH_V2","ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V6","ACTIVITY_TYPE_DELETE_PRIVATE_KEYS","ACTIVITY_TYPE_DELETE_WALLETS","ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2","ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION","ACTIVITY_TYPE_INIT_OTP_AUTH","ACTIVITY_TYPE_OTP_AUTH","ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7","ACTIVITY_TYPE_UPDATE_WALLET","ACTIVITY_TYPE_UPDATE_POLICY_V2","ACTIVITY_TYPE_CREATE_USERS_V3","ACTIVITY_TYPE_INIT_OTP_AUTH_V2","ACTIVITY_TYPE_INIT_OTP","ACTIVITY_TYPE_VERIFY_OTP","ACTIVITY_TYPE_OTP_LOGIN","ACTIVITY_TYPE_STAMP_LOGIN","ACTIVITY_TYPE_OAUTH_LOGIN","ACTIVITY_TYPE_UPDATE_USER_NAME","ACTIVITY_TYPE_UPDATE_USER_EMAIL","ACTIVITY_TYPE_UPDATE_USER_PHONE_NUMBER","ACTIVITY_TYPE_INIT_FIAT_ON_RAMP","ACTIVITY_TYPE_CREATE_SMART_CONTRACT_INTERFACE","ACTIVITY_TYPE_DELETE_SMART_CONTRACT_INTERFACE","ACTIVITY_TYPE_ENABLE_AUTH_PROXY","ACTIVITY_TYPE_DISABLE_AUTH_PROXY","ACTIVITY_TYPE_UPDATE_AUTH_PROXY_CONFIG","ACTIVITY_TYPE_CREATE_OAUTH2_CREDENTIAL","ACTIVITY_TYPE_UPDATE_OAUTH2_CREDENTIAL","ACTIVITY_TYPE_DELETE_OAUTH2_CREDENTIAL","ACTIVITY_TYPE_OAUTH2_AUTHENTICATE","ACTIVITY_TYPE_DELETE_WALLET_ACCOUNTS","ACTIVITY_TYPE_DELETE_POLICIES","ACTIVITY_TYPE_ETH_SEND_RAW_TRANSACTION","ACTIVITY_TYPE_ETH_SEND_TRANSACTION","ACTIVITY_TYPE_CREATE_FIAT_ON_RAMP_CREDENTIAL","ACTIVITY_TYPE_UPDATE_FIAT_ON_RAMP_CREDENTIAL","ACTIVITY_TYPE_DELETE_FIAT_ON_RAMP_CREDENTIAL"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["ACTIVITY_TYPE_CREATE_API_KEYS","ACTIVITY_TYPE_CREATE_USERS","ACTIVITY_TYPE_CREATE_PRIVATE_KEYS","ACTIVITY_TYPE_SIGN_RAW_PAYLOAD","ACTIVITY_TYPE_CREATE_INVITATIONS","ACTIVITY_TYPE_ACCEPT_INVITATION","ACTIVITY_TYPE_CREATE_POLICY","ACTIVITY_TYPE_DISABLE_PRIVATE_KEY","ACTIVITY_TYPE_DELETE_USERS","ACTIVITY_TYPE_DELETE_API_KEYS","ACTIVITY_TYPE_DELETE_INVITATION","ACTIVITY_TYPE_DELETE_ORGANIZATION","ACTIVITY_TYPE_DELETE_POLICY","ACTIVITY_TYPE_CREATE_USER_TAG","ACTIVITY_TYPE_DELETE_USER_TAGS","ACTIVITY_TYPE_CREATE_ORGANIZATION","ACTIVITY_TYPE_SIGN_TRANSACTION","ACTIVITY_TYPE_APPROVE_ACTIVITY","ACTIVITY_TYPE_REJECT_ACTIVITY","ACTIVITY_TYPE_DELETE_AUTHENTICATORS","ACTIVITY_TYPE_CREATE_AUTHENTICATORS","ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG","ACTIVITY_TYPE_DELETE_PRIVATE_KEY_TAGS","ACTIVITY_TYPE_SET_PAYMENT_METHOD","ACTIVITY_TYPE_ACTIVATE_BILLING_TIER","ACTIVITY_TYPE_DELETE_PAYMENT_METHOD","ACTIVITY_TYPE_CREATE_POLICY_V2","ACTIVITY_TYPE_CREATE_POLICY_V3","ACTIVITY_TYPE_CREATE_API_ONLY_USERS","ACTIVITY_TYPE_UPDATE_ROOT_QUORUM","ACTIVITY_TYPE_UPDATE_USER_TAG","ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG","ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2","ACTIVITY_TYPE_CREATE_ORGANIZATION_V2","ACTIVITY_TYPE_CREATE_USERS_V2","ACTIVITY_TYPE_ACCEPT_INVITATION_V2","ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION","ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V2","ACTIVITY_TYPE_UPDATE_ALLOWED_ORIGINS","ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2","ACTIVITY_TYPE_UPDATE_USER","ACTIVITY_TYPE_UPDATE_POLICY","ACTIVITY_TYPE_SET_PAYMENT_METHOD_V2","ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V3","ACTIVITY_TYPE_CREATE_WALLET","ACTIVITY_TYPE_CREATE_WALLET_ACCOUNTS","ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY","ACTIVITY_TYPE_RECOVER_USER","ACTIVITY_TYPE_SET_ORGANIZATION_FEATURE","ACTIVITY_TYPE_REMOVE_ORGANIZATION_FEATURE","ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2","ACTIVITY_TYPE_SIGN_TRANSACTION_V2","ACTIVITY_TYPE_EXPORT_PRIVATE_KEY","ACTIVITY_TYPE_EXPORT_WALLET","ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V4","ACTIVITY_TYPE_EMAIL_AUTH","ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT","ACTIVITY_TYPE_INIT_IMPORT_WALLET","ACTIVITY_TYPE_IMPORT_WALLET","ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY","ACTIVITY_TYPE_IMPORT_PRIVATE_KEY","ACTIVITY_TYPE_CREATE_POLICIES","ACTIVITY_TYPE_SIGN_RAW_PAYLOADS","ACTIVITY_TYPE_CREATE_READ_ONLY_SESSION","ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS","ACTIVITY_TYPE_DELETE_OAUTH_PROVIDERS","ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V5","ACTIVITY_TYPE_OAUTH","ACTIVITY_TYPE_CREATE_API_KEYS_V2","ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION","ACTIVITY_TYPE_EMAIL_AUTH_V2","ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V6","ACTIVITY_TYPE_DELETE_PRIVATE_KEYS","ACTIVITY_TYPE_DELETE_WALLETS","ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2","ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION","ACTIVITY_TYPE_INIT_OTP_AUTH","ACTIVITY_TYPE_OTP_AUTH","ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7","ACTIVITY_TYPE_UPDATE_WALLET","ACTIVITY_TYPE_UPDATE_POLICY_V2","ACTIVITY_TYPE_CREATE_USERS_V3","ACTIVITY_TYPE_INIT_OTP_AUTH_V2","ACTIVITY_TYPE_INIT_OTP","ACTIVITY_TYPE_VERIFY_OTP","ACTIVITY_TYPE_OTP_LOGIN","ACTIVITY_TYPE_STAMP_LOGIN","ACTIVITY_TYPE_OAUTH_LOGIN","ACTIVITY_TYPE_UPDATE_USER_NAME","ACTIVITY_TYPE_UPDATE_USER_EMAIL","ACTIVITY_TYPE_UPDATE_USER_PHONE_NUMBER","ACTIVITY_TYPE_INIT_FIAT_ON_RAMP","ACTIVITY_TYPE_CREATE_SMART_CONTRACT_INTERFACE","ACTIVITY_TYPE_DELETE_SMART_CONTRACT_INTERFACE","ACTIVITY_TYPE_ENABLE_AUTH_PROXY","ACTIVITY_TYPE_DISABLE_AUTH_PROXY","ACTIVITY_TYPE_UPDATE_AUTH_PROXY_CONFIG","ACTIVITY_TYPE_CREATE_OAUTH2_CREDENTIAL","ACTIVITY_TYPE_UPDATE_OAUTH2_CREDENTIAL","ACTIVITY_TYPE_DELETE_OAUTH2_CREDENTIAL","ACTIVITY_TYPE_OAUTH2_AUTHENTICATE","ACTIVITY_TYPE_DELETE_WALLET_ACCOUNTS","ACTIVITY_TYPE_DELETE_POLICIES","ACTIVITY_TYPE_ETH_SEND_RAW_TRANSACTION","ACTIVITY_TYPE_ETH_SEND_TRANSACTION","ACTIVITY_TYPE_CREATE_FIAT_ON_RAMP_CREDENTIAL","ACTIVITY_TYPE_UPDATE_FIAT_ON_RAMP_CREDENTIAL","ACTIVITY_TYPE_DELETE_FIAT_ON_RAMP_CREDENTIAL","ACTIVITY_TYPE_EMAIL_AUTH_V3","ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY_V2","ACTIVITY_TYPE_INIT_OTP_AUTH_V3","ACTIVITY_TYPE_INIT_OTP_V2"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/pkg/api/models/email_auth_intent_v3.go b/pkg/api/models/email_auth_intent_v3.go new file mode 100644 index 0000000..7693e5b --- /dev/null +++ b/pkg/api/models/email_auth_intent_v3.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// EmailAuthIntentV3 email auth intent v3 +// +// swagger:model EmailAuthIntentV3 +type EmailAuthIntentV3 struct { + + // Optional human-readable name for an API Key. If none provided, default to Email Auth - + APIKeyName *string `json:"apiKeyName,omitempty"` + + // The name of the application. + // Required: true + AppName *string `json:"appName"` + + // Email of the authenticating user. + // Required: true + Email *string `json:"email"` + + // Optional parameters for customizing emails. If not provided, the default email will be used. + EmailCustomization *EmailCustomizationParams `json:"emailCustomization,omitempty"` + + // Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used. + ExpirationSeconds *string `json:"expirationSeconds,omitempty"` + + // Invalidate all other previously generated Email Auth API keys + InvalidateExisting *bool `json:"invalidateExisting,omitempty"` + + // Optional custom email address to use as reply-to + ReplyToEmailAddress *string `json:"replyToEmailAddress,omitempty"` + + // Optional custom email address from which to send the email + SendFromEmailAddress *string `json:"sendFromEmailAddress,omitempty"` + + // Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications' + SendFromEmailSenderName *string `json:"sendFromEmailSenderName,omitempty"` + + // Client-side public key generated by the user, to which the email auth bundle (credentials) will be encrypted. + // Required: true + TargetPublicKey *string `json:"targetPublicKey"` +} + +// Validate validates this email auth intent v3 +func (m *EmailAuthIntentV3) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAppName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmailCustomization(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTargetPublicKey(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EmailAuthIntentV3) validateAppName(formats strfmt.Registry) error { + + if err := validate.Required("appName", "body", m.AppName); err != nil { + return err + } + + return nil +} + +func (m *EmailAuthIntentV3) validateEmail(formats strfmt.Registry) error { + + if err := validate.Required("email", "body", m.Email); err != nil { + return err + } + + return nil +} + +func (m *EmailAuthIntentV3) validateEmailCustomization(formats strfmt.Registry) error { + if swag.IsZero(m.EmailCustomization) { // not required + return nil + } + + if m.EmailCustomization != nil { + if err := m.EmailCustomization.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("emailCustomization") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("emailCustomization") + } + return err + } + } + + return nil +} + +func (m *EmailAuthIntentV3) validateTargetPublicKey(formats strfmt.Registry) error { + + if err := validate.Required("targetPublicKey", "body", m.TargetPublicKey); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this email auth intent v3 based on the context it is used +func (m *EmailAuthIntentV3) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateEmailCustomization(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EmailAuthIntentV3) contextValidateEmailCustomization(ctx context.Context, formats strfmt.Registry) error { + + if m.EmailCustomization != nil { + + if swag.IsZero(m.EmailCustomization) { // not required + return nil + } + + if err := m.EmailCustomization.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("emailCustomization") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("emailCustomization") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *EmailAuthIntentV3) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *EmailAuthIntentV3) UnmarshalBinary(b []byte) error { + var res EmailAuthIntentV3 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/api/models/email_auth_request.go b/pkg/api/models/email_auth_request.go index 5e9ef7d..3adf25a 100644 --- a/pkg/api/models/email_auth_request.go +++ b/pkg/api/models/email_auth_request.go @@ -26,7 +26,7 @@ type EmailAuthRequest struct { // parameters // Required: true - Parameters *EmailAuthIntentV2 `json:"parameters"` + Parameters *EmailAuthIntentV3 `json:"parameters"` // Timestamp (in milliseconds) of the request, used to verify liveness of user requests. // Required: true @@ -34,7 +34,7 @@ type EmailAuthRequest struct { // type // Required: true - // Enum: [ACTIVITY_TYPE_EMAIL_AUTH_V2] + // Enum: [ACTIVITY_TYPE_EMAIL_AUTH_V3] Type *string `json:"type"` } @@ -106,7 +106,7 @@ var emailAuthRequestTypeTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["ACTIVITY_TYPE_EMAIL_AUTH_V2"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["ACTIVITY_TYPE_EMAIL_AUTH_V3"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -116,8 +116,8 @@ func init() { const ( - // EmailAuthRequestTypeACTIVITYTYPEEMAILAUTHV2 captures enum value "ACTIVITY_TYPE_EMAIL_AUTH_V2" - EmailAuthRequestTypeACTIVITYTYPEEMAILAUTHV2 string = "ACTIVITY_TYPE_EMAIL_AUTH_V2" + // EmailAuthRequestTypeACTIVITYTYPEEMAILAUTHV3 captures enum value "ACTIVITY_TYPE_EMAIL_AUTH_V3" + EmailAuthRequestTypeACTIVITYTYPEEMAILAUTHV3 string = "ACTIVITY_TYPE_EMAIL_AUTH_V3" ) // prop value enum diff --git a/pkg/api/models/eth_send_transaction_intent.go b/pkg/api/models/eth_send_transaction_intent.go index fcf457f..92dd65c 100644 --- a/pkg/api/models/eth_send_transaction_intent.go +++ b/pkg/api/models/eth_send_transaction_intent.go @@ -35,21 +35,20 @@ type EthSendTransactionIntent struct { // Required: true From *string `json:"from"` - // Maximum amount of gas to use for this transaction. - // Required: true - GasLimit *string `json:"gasLimit"` + // Maximum amount of gas to use for this transaction, for EIP-1559 transactions. + GasLimit *string `json:"gasLimit,omitempty"` - // Maximum total fee per gas unit (base fee + priority fee) in wei, for EIP-1559 transactions. - // Required: true - MaxFeePerGas *string `json:"maxFeePerGas"` + // The gas station delegate contract nonce. Only used when sponsor=true. + GasStationNonce *string `json:"gasStationNonce,omitempty"` - // Maximum priority fee (tip) per gas unit in wei, for EIP-1559 transactions. - // Required: true - MaxPriorityFeePerGas *string `json:"maxPriorityFeePerGas"` + // Maximum total fee per gas unit (base fee + priority fee) in wei. Required for non-sponsored (EIP-1559) transactions. Not used for sponsored transactions. + MaxFeePerGas *string `json:"maxFeePerGas,omitempty"` - // Transaction nonce. - // Required: true - Nonce *string `json:"nonce"` + // Maximum priority fee (tip) per gas unit in wei. Required for non-sponsored (EIP-1559) transactions. Not used for sponsored transactions. + MaxPriorityFeePerGas *string `json:"maxPriorityFeePerGas,omitempty"` + + // Transaction nonce, for EIP-1559 and Turnkey Gas Station authorizations. + Nonce *string `json:"nonce,omitempty"` // Whether to sponsor this transaction via Gas Station. Sponsor *bool `json:"sponsor,omitempty"` @@ -74,22 +73,6 @@ func (m *EthSendTransactionIntent) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateGasLimit(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMaxFeePerGas(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMaxPriorityFeePerGas(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNonce(formats); err != nil { - res = append(res, err) - } - if err := m.validateTo(formats); err != nil { res = append(res, err) } @@ -158,42 +141,6 @@ func (m *EthSendTransactionIntent) validateFrom(formats strfmt.Registry) error { return nil } -func (m *EthSendTransactionIntent) validateGasLimit(formats strfmt.Registry) error { - - if err := validate.Required("gasLimit", "body", m.GasLimit); err != nil { - return err - } - - return nil -} - -func (m *EthSendTransactionIntent) validateMaxFeePerGas(formats strfmt.Registry) error { - - if err := validate.Required("maxFeePerGas", "body", m.MaxFeePerGas); err != nil { - return err - } - - return nil -} - -func (m *EthSendTransactionIntent) validateMaxPriorityFeePerGas(formats strfmt.Registry) error { - - if err := validate.Required("maxPriorityFeePerGas", "body", m.MaxPriorityFeePerGas); err != nil { - return err - } - - return nil -} - -func (m *EthSendTransactionIntent) validateNonce(formats strfmt.Registry) error { - - if err := validate.Required("nonce", "body", m.Nonce); err != nil { - return err - } - - return nil -} - func (m *EthSendTransactionIntent) validateTo(formats strfmt.Registry) error { if err := validate.Required("to", "body", m.To); err != nil { diff --git a/pkg/api/models/eth_send_transaction_result.go b/pkg/api/models/eth_send_transaction_result.go index 4514d7c..d0f3f67 100644 --- a/pkg/api/models/eth_send_transaction_result.go +++ b/pkg/api/models/eth_send_transaction_result.go @@ -5,67 +5,7 @@ package models // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - // EthSendTransactionResult eth send transaction result // // swagger:model EthSendTransactionResult -type EthSendTransactionResult struct { - - // The transaction hash of the sent transaction - // Required: true - TransactionHash *string `json:"transactionHash"` -} - -// Validate validates this eth send transaction result -func (m *EthSendTransactionResult) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateTransactionHash(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EthSendTransactionResult) validateTransactionHash(formats strfmt.Registry) error { - - if err := validate.Required("transactionHash", "body", m.TransactionHash); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this eth send transaction result based on context it is used -func (m *EthSendTransactionResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *EthSendTransactionResult) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EthSendTransactionResult) UnmarshalBinary(b []byte) error { - var res EthSendTransactionResult - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} +type EthSendTransactionResult interface{} diff --git a/pkg/api/models/init_otp_auth_intent_v3.go b/pkg/api/models/init_otp_auth_intent_v3.go new file mode 100644 index 0000000..2ad7c44 --- /dev/null +++ b/pkg/api/models/init_otp_auth_intent_v3.go @@ -0,0 +1,230 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// InitOtpAuthIntentV3 init otp auth intent v3 +// +// swagger:model InitOtpAuthIntentV3 +type InitOtpAuthIntentV3 struct { + + // Optional flag to specify if the OTP code should be alphanumeric (Crockford’s Base32). Default = true + Alphanumeric *bool `json:"alphanumeric,omitempty"` + + // The name of the application. + // Required: true + AppName *string `json:"appName"` + + // Email or phone number to send the OTP code to + // Required: true + Contact *string `json:"contact"` + + // Optional parameters for customizing emails. If not provided, the default email will be used. + EmailCustomization *EmailCustomizationParams `json:"emailCustomization,omitempty"` + + // Optional length of the OTP code. Default = 9 + OtpLength *int32 `json:"otpLength,omitempty"` + + // Enum to specifiy whether to send OTP via SMS or email + // Required: true + OtpType *string `json:"otpType"` + + // Optional custom email address to use as reply-to + ReplyToEmailAddress *string `json:"replyToEmailAddress,omitempty"` + + // Optional custom email address from which to send the OTP email + SendFromEmailAddress *string `json:"sendFromEmailAddress,omitempty"` + + // Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications' + SendFromEmailSenderName *string `json:"sendFromEmailSenderName,omitempty"` + + // Optional parameters for customizing SMS message. If not provided, the default sms message will be used. + SmsCustomization *SmsCustomizationParams `json:"smsCustomization,omitempty"` + + // Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address. + UserIdentifier *string `json:"userIdentifier,omitempty"` +} + +// Validate validates this init otp auth intent v3 +func (m *InitOtpAuthIntentV3) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAppName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContact(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmailCustomization(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOtpType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSmsCustomization(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InitOtpAuthIntentV3) validateAppName(formats strfmt.Registry) error { + + if err := validate.Required("appName", "body", m.AppName); err != nil { + return err + } + + return nil +} + +func (m *InitOtpAuthIntentV3) validateContact(formats strfmt.Registry) error { + + if err := validate.Required("contact", "body", m.Contact); err != nil { + return err + } + + return nil +} + +func (m *InitOtpAuthIntentV3) validateEmailCustomization(formats strfmt.Registry) error { + if swag.IsZero(m.EmailCustomization) { // not required + return nil + } + + if m.EmailCustomization != nil { + if err := m.EmailCustomization.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("emailCustomization") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("emailCustomization") + } + return err + } + } + + return nil +} + +func (m *InitOtpAuthIntentV3) validateOtpType(formats strfmt.Registry) error { + + if err := validate.Required("otpType", "body", m.OtpType); err != nil { + return err + } + + return nil +} + +func (m *InitOtpAuthIntentV3) validateSmsCustomization(formats strfmt.Registry) error { + if swag.IsZero(m.SmsCustomization) { // not required + return nil + } + + if m.SmsCustomization != nil { + if err := m.SmsCustomization.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("smsCustomization") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("smsCustomization") + } + return err + } + } + + return nil +} + +// ContextValidate validate this init otp auth intent v3 based on the context it is used +func (m *InitOtpAuthIntentV3) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateEmailCustomization(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSmsCustomization(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InitOtpAuthIntentV3) contextValidateEmailCustomization(ctx context.Context, formats strfmt.Registry) error { + + if m.EmailCustomization != nil { + + if swag.IsZero(m.EmailCustomization) { // not required + return nil + } + + if err := m.EmailCustomization.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("emailCustomization") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("emailCustomization") + } + return err + } + } + + return nil +} + +func (m *InitOtpAuthIntentV3) contextValidateSmsCustomization(ctx context.Context, formats strfmt.Registry) error { + + if m.SmsCustomization != nil { + + if swag.IsZero(m.SmsCustomization) { // not required + return nil + } + + if err := m.SmsCustomization.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("smsCustomization") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("smsCustomization") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InitOtpAuthIntentV3) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InitOtpAuthIntentV3) UnmarshalBinary(b []byte) error { + var res InitOtpAuthIntentV3 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/api/models/init_otp_auth_request.go b/pkg/api/models/init_otp_auth_request.go index 59df1b7..8b46a68 100644 --- a/pkg/api/models/init_otp_auth_request.go +++ b/pkg/api/models/init_otp_auth_request.go @@ -26,7 +26,7 @@ type InitOtpAuthRequest struct { // parameters // Required: true - Parameters *InitOtpAuthIntentV2 `json:"parameters"` + Parameters *InitOtpAuthIntentV3 `json:"parameters"` // Timestamp (in milliseconds) of the request, used to verify liveness of user requests. // Required: true @@ -34,7 +34,7 @@ type InitOtpAuthRequest struct { // type // Required: true - // Enum: [ACTIVITY_TYPE_INIT_OTP_AUTH_V2] + // Enum: [ACTIVITY_TYPE_INIT_OTP_AUTH_V3] Type *string `json:"type"` } @@ -106,7 +106,7 @@ var initOtpAuthRequestTypeTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["ACTIVITY_TYPE_INIT_OTP_AUTH_V2"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["ACTIVITY_TYPE_INIT_OTP_AUTH_V3"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -116,8 +116,8 @@ func init() { const ( - // InitOtpAuthRequestTypeACTIVITYTYPEINITOTPAUTHV2 captures enum value "ACTIVITY_TYPE_INIT_OTP_AUTH_V2" - InitOtpAuthRequestTypeACTIVITYTYPEINITOTPAUTHV2 string = "ACTIVITY_TYPE_INIT_OTP_AUTH_V2" + // InitOtpAuthRequestTypeACTIVITYTYPEINITOTPAUTHV3 captures enum value "ACTIVITY_TYPE_INIT_OTP_AUTH_V3" + InitOtpAuthRequestTypeACTIVITYTYPEINITOTPAUTHV3 string = "ACTIVITY_TYPE_INIT_OTP_AUTH_V3" ) // prop value enum diff --git a/pkg/api/models/init_otp_intent_v2.go b/pkg/api/models/init_otp_intent_v2.go new file mode 100644 index 0000000..b56a70d --- /dev/null +++ b/pkg/api/models/init_otp_intent_v2.go @@ -0,0 +1,233 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// InitOtpIntentV2 init otp intent v2 +// +// swagger:model InitOtpIntentV2 +type InitOtpIntentV2 struct { + + // Optional flag to specify if the OTP code should be alphanumeric (Crockford’s Base32). Default = true + Alphanumeric *bool `json:"alphanumeric,omitempty"` + + // The name of the application. + // Required: true + AppName *string `json:"appName"` + + // Email or phone number to send the OTP code to + // Required: true + Contact *string `json:"contact"` + + // Optional parameters for customizing emails. If not provided, the default email will be used. + EmailCustomization *EmailCustomizationParams `json:"emailCustomization,omitempty"` + + // Expiration window (in seconds) indicating how long the OTP is valid for. If not provided, a default of 5 minutes will be used. Maximum value is 600 seconds (10 minutes) + ExpirationSeconds *string `json:"expirationSeconds,omitempty"` + + // Optional length of the OTP code. Default = 9 + OtpLength *int32 `json:"otpLength,omitempty"` + + // Whether to send OTP via SMS or email. Possible values: OTP_TYPE_SMS, OTP_TYPE_EMAIL + // Required: true + OtpType *string `json:"otpType"` + + // Optional custom email address to use as reply-to + ReplyToEmailAddress *string `json:"replyToEmailAddress,omitempty"` + + // Optional custom email address from which to send the OTP email + SendFromEmailAddress *string `json:"sendFromEmailAddress,omitempty"` + + // Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications' + SendFromEmailSenderName *string `json:"sendFromEmailSenderName,omitempty"` + + // Optional parameters for customizing SMS message. If not provided, the default sms message will be used. + SmsCustomization *SmsCustomizationParams `json:"smsCustomization,omitempty"` + + // Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address. + UserIdentifier *string `json:"userIdentifier,omitempty"` +} + +// Validate validates this init otp intent v2 +func (m *InitOtpIntentV2) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAppName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContact(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmailCustomization(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOtpType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSmsCustomization(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InitOtpIntentV2) validateAppName(formats strfmt.Registry) error { + + if err := validate.Required("appName", "body", m.AppName); err != nil { + return err + } + + return nil +} + +func (m *InitOtpIntentV2) validateContact(formats strfmt.Registry) error { + + if err := validate.Required("contact", "body", m.Contact); err != nil { + return err + } + + return nil +} + +func (m *InitOtpIntentV2) validateEmailCustomization(formats strfmt.Registry) error { + if swag.IsZero(m.EmailCustomization) { // not required + return nil + } + + if m.EmailCustomization != nil { + if err := m.EmailCustomization.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("emailCustomization") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("emailCustomization") + } + return err + } + } + + return nil +} + +func (m *InitOtpIntentV2) validateOtpType(formats strfmt.Registry) error { + + if err := validate.Required("otpType", "body", m.OtpType); err != nil { + return err + } + + return nil +} + +func (m *InitOtpIntentV2) validateSmsCustomization(formats strfmt.Registry) error { + if swag.IsZero(m.SmsCustomization) { // not required + return nil + } + + if m.SmsCustomization != nil { + if err := m.SmsCustomization.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("smsCustomization") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("smsCustomization") + } + return err + } + } + + return nil +} + +// ContextValidate validate this init otp intent v2 based on the context it is used +func (m *InitOtpIntentV2) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateEmailCustomization(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSmsCustomization(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InitOtpIntentV2) contextValidateEmailCustomization(ctx context.Context, formats strfmt.Registry) error { + + if m.EmailCustomization != nil { + + if swag.IsZero(m.EmailCustomization) { // not required + return nil + } + + if err := m.EmailCustomization.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("emailCustomization") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("emailCustomization") + } + return err + } + } + + return nil +} + +func (m *InitOtpIntentV2) contextValidateSmsCustomization(ctx context.Context, formats strfmt.Registry) error { + + if m.SmsCustomization != nil { + + if swag.IsZero(m.SmsCustomization) { // not required + return nil + } + + if err := m.SmsCustomization.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("smsCustomization") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("smsCustomization") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InitOtpIntentV2) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InitOtpIntentV2) UnmarshalBinary(b []byte) error { + var res InitOtpIntentV2 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/api/models/init_otp_request.go b/pkg/api/models/init_otp_request.go index 5cf45df..4bdf98d 100644 --- a/pkg/api/models/init_otp_request.go +++ b/pkg/api/models/init_otp_request.go @@ -26,7 +26,7 @@ type InitOtpRequest struct { // parameters // Required: true - Parameters *InitOtpIntent `json:"parameters"` + Parameters *InitOtpIntentV2 `json:"parameters"` // Timestamp (in milliseconds) of the request, used to verify liveness of user requests. // Required: true @@ -34,7 +34,7 @@ type InitOtpRequest struct { // type // Required: true - // Enum: [ACTIVITY_TYPE_INIT_OTP] + // Enum: [ACTIVITY_TYPE_INIT_OTP_V2] Type *string `json:"type"` } @@ -106,7 +106,7 @@ var initOtpRequestTypeTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["ACTIVITY_TYPE_INIT_OTP"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["ACTIVITY_TYPE_INIT_OTP_V2"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -116,8 +116,8 @@ func init() { const ( - // InitOtpRequestTypeACTIVITYTYPEINITOTP captures enum value "ACTIVITY_TYPE_INIT_OTP" - InitOtpRequestTypeACTIVITYTYPEINITOTP string = "ACTIVITY_TYPE_INIT_OTP" + // InitOtpRequestTypeACTIVITYTYPEINITOTPV2 captures enum value "ACTIVITY_TYPE_INIT_OTP_V2" + InitOtpRequestTypeACTIVITYTYPEINITOTPV2 string = "ACTIVITY_TYPE_INIT_OTP_V2" ) // prop value enum diff --git a/pkg/api/models/init_user_email_recovery_intent_v2.go b/pkg/api/models/init_user_email_recovery_intent_v2.go new file mode 100644 index 0000000..e56fcb5 --- /dev/null +++ b/pkg/api/models/init_user_email_recovery_intent_v2.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// InitUserEmailRecoveryIntentV2 init user email recovery intent v2 +// +// swagger:model InitUserEmailRecoveryIntentV2 +type InitUserEmailRecoveryIntentV2 struct { + + // The name of the application. + // Required: true + AppName *string `json:"appName"` + + // Email of the user starting recovery + // Required: true + Email *string `json:"email"` + + // Optional parameters for customizing emails. If not provided, the default email will be used. + EmailCustomization *EmailCustomizationParams `json:"emailCustomization,omitempty"` + + // Expiration window (in seconds) indicating how long the recovery credential is valid for. If not provided, a default of 15 minutes will be used. + ExpirationSeconds *string `json:"expirationSeconds,omitempty"` + + // Optional custom email address to use as reply-to + ReplyToEmailAddress *string `json:"replyToEmailAddress,omitempty"` + + // Optional custom email address from which to send the OTP email + SendFromEmailAddress *string `json:"sendFromEmailAddress,omitempty"` + + // Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications' + SendFromEmailSenderName *string `json:"sendFromEmailSenderName,omitempty"` + + // Client-side public key generated by the user, to which the recovery bundle will be encrypted. + // Required: true + TargetPublicKey *string `json:"targetPublicKey"` +} + +// Validate validates this init user email recovery intent v2 +func (m *InitUserEmailRecoveryIntentV2) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAppName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmailCustomization(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTargetPublicKey(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InitUserEmailRecoveryIntentV2) validateAppName(formats strfmt.Registry) error { + + if err := validate.Required("appName", "body", m.AppName); err != nil { + return err + } + + return nil +} + +func (m *InitUserEmailRecoveryIntentV2) validateEmail(formats strfmt.Registry) error { + + if err := validate.Required("email", "body", m.Email); err != nil { + return err + } + + return nil +} + +func (m *InitUserEmailRecoveryIntentV2) validateEmailCustomization(formats strfmt.Registry) error { + if swag.IsZero(m.EmailCustomization) { // not required + return nil + } + + if m.EmailCustomization != nil { + if err := m.EmailCustomization.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("emailCustomization") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("emailCustomization") + } + return err + } + } + + return nil +} + +func (m *InitUserEmailRecoveryIntentV2) validateTargetPublicKey(formats strfmt.Registry) error { + + if err := validate.Required("targetPublicKey", "body", m.TargetPublicKey); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this init user email recovery intent v2 based on the context it is used +func (m *InitUserEmailRecoveryIntentV2) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateEmailCustomization(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InitUserEmailRecoveryIntentV2) contextValidateEmailCustomization(ctx context.Context, formats strfmt.Registry) error { + + if m.EmailCustomization != nil { + + if swag.IsZero(m.EmailCustomization) { // not required + return nil + } + + if err := m.EmailCustomization.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("emailCustomization") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("emailCustomization") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InitUserEmailRecoveryIntentV2) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InitUserEmailRecoveryIntentV2) UnmarshalBinary(b []byte) error { + var res InitUserEmailRecoveryIntentV2 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/api/models/init_user_email_recovery_request.go b/pkg/api/models/init_user_email_recovery_request.go index 0cc99bc..70a3df0 100644 --- a/pkg/api/models/init_user_email_recovery_request.go +++ b/pkg/api/models/init_user_email_recovery_request.go @@ -26,7 +26,7 @@ type InitUserEmailRecoveryRequest struct { // parameters // Required: true - Parameters *InitUserEmailRecoveryIntent `json:"parameters"` + Parameters *InitUserEmailRecoveryIntentV2 `json:"parameters"` // Timestamp (in milliseconds) of the request, used to verify liveness of user requests. // Required: true @@ -34,7 +34,7 @@ type InitUserEmailRecoveryRequest struct { // type // Required: true - // Enum: [ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY] + // Enum: [ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY_V2] Type *string `json:"type"` } @@ -106,7 +106,7 @@ var initUserEmailRecoveryRequestTypeTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY_V2"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -116,8 +116,8 @@ func init() { const ( - // InitUserEmailRecoveryRequestTypeACTIVITYTYPEINITUSEREMAILRECOVERY captures enum value "ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY" - InitUserEmailRecoveryRequestTypeACTIVITYTYPEINITUSEREMAILRECOVERY string = "ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY" + // InitUserEmailRecoveryRequestTypeACTIVITYTYPEINITUSEREMAILRECOVERYV2 captures enum value "ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY_V2" + InitUserEmailRecoveryRequestTypeACTIVITYTYPEINITUSEREMAILRECOVERYV2 string = "ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY_V2" ) // prop value enum diff --git a/pkg/api/models/intent.go b/pkg/api/models/intent.go index 0d84a0c..8905a4a 100644 --- a/pkg/api/models/intent.go +++ b/pkg/api/models/intent.go @@ -201,6 +201,9 @@ type Intent struct { // email auth intent v2 EmailAuthIntentV2 *EmailAuthIntentV2 `json:"emailAuthIntentV2,omitempty"` + // email auth intent v3 + EmailAuthIntentV3 *EmailAuthIntentV3 `json:"emailAuthIntentV3,omitempty"` + // enable auth proxy intent EnableAuthProxyIntent EnableAuthProxyIntent `json:"enableAuthProxyIntent,omitempty"` @@ -240,12 +243,21 @@ type Intent struct { // init otp auth intent v2 InitOtpAuthIntentV2 *InitOtpAuthIntentV2 `json:"initOtpAuthIntentV2,omitempty"` + // init otp auth intent v3 + InitOtpAuthIntentV3 *InitOtpAuthIntentV3 `json:"initOtpAuthIntentV3,omitempty"` + // init otp intent InitOtpIntent *InitOtpIntent `json:"initOtpIntent,omitempty"` + // init otp intent v2 + InitOtpIntentV2 *InitOtpIntentV2 `json:"initOtpIntentV2,omitempty"` + // init user email recovery intent InitUserEmailRecoveryIntent *InitUserEmailRecoveryIntent `json:"initUserEmailRecoveryIntent,omitempty"` + // init user email recovery intent v2 + InitUserEmailRecoveryIntentV2 *InitUserEmailRecoveryIntentV2 `json:"initUserEmailRecoveryIntentV2,omitempty"` + // oauth2 authenticate intent Oauth2AuthenticateIntent *Oauth2AuthenticateIntent `json:"oauth2AuthenticateIntent,omitempty"` @@ -583,6 +595,10 @@ func (m *Intent) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateEmailAuthIntentV3(formats); err != nil { + res = append(res, err) + } + if err := m.validateEthSendRawTransactionIntent(formats); err != nil { res = append(res, err) } @@ -631,14 +647,26 @@ func (m *Intent) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateInitOtpAuthIntentV3(formats); err != nil { + res = append(res, err) + } + if err := m.validateInitOtpIntent(formats); err != nil { res = append(res, err) } + if err := m.validateInitOtpIntentV2(formats); err != nil { + res = append(res, err) + } + if err := m.validateInitUserEmailRecoveryIntent(formats); err != nil { res = append(res, err) } + if err := m.validateInitUserEmailRecoveryIntentV2(formats); err != nil { + res = append(res, err) + } + if err := m.validateOauth2AuthenticateIntent(formats); err != nil { res = append(res, err) } @@ -1894,6 +1922,25 @@ func (m *Intent) validateEmailAuthIntentV2(formats strfmt.Registry) error { return nil } +func (m *Intent) validateEmailAuthIntentV3(formats strfmt.Registry) error { + if swag.IsZero(m.EmailAuthIntentV3) { // not required + return nil + } + + if m.EmailAuthIntentV3 != nil { + if err := m.EmailAuthIntentV3.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("emailAuthIntentV3") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("emailAuthIntentV3") + } + return err + } + } + + return nil +} + func (m *Intent) validateEthSendRawTransactionIntent(formats strfmt.Registry) error { if swag.IsZero(m.EthSendRawTransactionIntent) { // not required return nil @@ -2122,6 +2169,25 @@ func (m *Intent) validateInitOtpAuthIntentV2(formats strfmt.Registry) error { return nil } +func (m *Intent) validateInitOtpAuthIntentV3(formats strfmt.Registry) error { + if swag.IsZero(m.InitOtpAuthIntentV3) { // not required + return nil + } + + if m.InitOtpAuthIntentV3 != nil { + if err := m.InitOtpAuthIntentV3.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("initOtpAuthIntentV3") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("initOtpAuthIntentV3") + } + return err + } + } + + return nil +} + func (m *Intent) validateInitOtpIntent(formats strfmt.Registry) error { if swag.IsZero(m.InitOtpIntent) { // not required return nil @@ -2141,6 +2207,25 @@ func (m *Intent) validateInitOtpIntent(formats strfmt.Registry) error { return nil } +func (m *Intent) validateInitOtpIntentV2(formats strfmt.Registry) error { + if swag.IsZero(m.InitOtpIntentV2) { // not required + return nil + } + + if m.InitOtpIntentV2 != nil { + if err := m.InitOtpIntentV2.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("initOtpIntentV2") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("initOtpIntentV2") + } + return err + } + } + + return nil +} + func (m *Intent) validateInitUserEmailRecoveryIntent(formats strfmt.Registry) error { if swag.IsZero(m.InitUserEmailRecoveryIntent) { // not required return nil @@ -2160,6 +2245,25 @@ func (m *Intent) validateInitUserEmailRecoveryIntent(formats strfmt.Registry) er return nil } +func (m *Intent) validateInitUserEmailRecoveryIntentV2(formats strfmt.Registry) error { + if swag.IsZero(m.InitUserEmailRecoveryIntentV2) { // not required + return nil + } + + if m.InitUserEmailRecoveryIntentV2 != nil { + if err := m.InitUserEmailRecoveryIntentV2.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("initUserEmailRecoveryIntentV2") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("initUserEmailRecoveryIntentV2") + } + return err + } + } + + return nil +} + func (m *Intent) validateOauth2AuthenticateIntent(formats strfmt.Registry) error { if swag.IsZero(m.Oauth2AuthenticateIntent) { // not required return nil @@ -3008,6 +3112,10 @@ func (m *Intent) ContextValidate(ctx context.Context, formats strfmt.Registry) e res = append(res, err) } + if err := m.contextValidateEmailAuthIntentV3(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateEthSendRawTransactionIntent(ctx, formats); err != nil { res = append(res, err) } @@ -3056,14 +3164,26 @@ func (m *Intent) ContextValidate(ctx context.Context, formats strfmt.Registry) e res = append(res, err) } + if err := m.contextValidateInitOtpAuthIntentV3(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateInitOtpIntent(ctx, formats); err != nil { res = append(res, err) } + if err := m.contextValidateInitOtpIntentV2(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateInitUserEmailRecoveryIntent(ctx, formats); err != nil { res = append(res, err) } + if err := m.contextValidateInitUserEmailRecoveryIntentV2(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateOauth2AuthenticateIntent(ctx, formats); err != nil { res = append(res, err) } @@ -4437,6 +4557,27 @@ func (m *Intent) contextValidateEmailAuthIntentV2(ctx context.Context, formats s return nil } +func (m *Intent) contextValidateEmailAuthIntentV3(ctx context.Context, formats strfmt.Registry) error { + + if m.EmailAuthIntentV3 != nil { + + if swag.IsZero(m.EmailAuthIntentV3) { // not required + return nil + } + + if err := m.EmailAuthIntentV3.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("emailAuthIntentV3") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("emailAuthIntentV3") + } + return err + } + } + + return nil +} + func (m *Intent) contextValidateEthSendRawTransactionIntent(ctx context.Context, formats strfmt.Registry) error { if m.EthSendRawTransactionIntent != nil { @@ -4689,6 +4830,27 @@ func (m *Intent) contextValidateInitOtpAuthIntentV2(ctx context.Context, formats return nil } +func (m *Intent) contextValidateInitOtpAuthIntentV3(ctx context.Context, formats strfmt.Registry) error { + + if m.InitOtpAuthIntentV3 != nil { + + if swag.IsZero(m.InitOtpAuthIntentV3) { // not required + return nil + } + + if err := m.InitOtpAuthIntentV3.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("initOtpAuthIntentV3") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("initOtpAuthIntentV3") + } + return err + } + } + + return nil +} + func (m *Intent) contextValidateInitOtpIntent(ctx context.Context, formats strfmt.Registry) error { if m.InitOtpIntent != nil { @@ -4710,6 +4872,27 @@ func (m *Intent) contextValidateInitOtpIntent(ctx context.Context, formats strfm return nil } +func (m *Intent) contextValidateInitOtpIntentV2(ctx context.Context, formats strfmt.Registry) error { + + if m.InitOtpIntentV2 != nil { + + if swag.IsZero(m.InitOtpIntentV2) { // not required + return nil + } + + if err := m.InitOtpIntentV2.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("initOtpIntentV2") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("initOtpIntentV2") + } + return err + } + } + + return nil +} + func (m *Intent) contextValidateInitUserEmailRecoveryIntent(ctx context.Context, formats strfmt.Registry) error { if m.InitUserEmailRecoveryIntent != nil { @@ -4731,6 +4914,27 @@ func (m *Intent) contextValidateInitUserEmailRecoveryIntent(ctx context.Context, return nil } +func (m *Intent) contextValidateInitUserEmailRecoveryIntentV2(ctx context.Context, formats strfmt.Registry) error { + + if m.InitUserEmailRecoveryIntentV2 != nil { + + if swag.IsZero(m.InitUserEmailRecoveryIntentV2) { // not required + return nil + } + + if err := m.InitUserEmailRecoveryIntentV2.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("initUserEmailRecoveryIntentV2") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("initUserEmailRecoveryIntentV2") + } + return err + } + } + + return nil +} + func (m *Intent) contextValidateOauth2AuthenticateIntent(ctx context.Context, formats strfmt.Registry) error { if m.Oauth2AuthenticateIntent != nil { diff --git a/pkg/api/models/result.go b/pkg/api/models/result.go index b486385..ad39201 100644 --- a/pkg/api/models/result.go +++ b/pkg/api/models/result.go @@ -175,7 +175,7 @@ type Result struct { EthSendRawTransactionResult *EthSendRawTransactionResult `json:"ethSendRawTransactionResult,omitempty"` // eth send transaction result - EthSendTransactionResult *EthSendTransactionResult `json:"ethSendTransactionResult,omitempty"` + EthSendTransactionResult EthSendTransactionResult `json:"ethSendTransactionResult,omitempty"` // export private key result ExportPrivateKeyResult *ExportPrivateKeyResult `json:"exportPrivateKeyResult,omitempty"` @@ -506,10 +506,6 @@ func (m *Result) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateEthSendTransactionResult(formats); err != nil { - res = append(res, err) - } - if err := m.validateExportPrivateKeyResult(formats); err != nil { res = append(res, err) } @@ -1637,25 +1633,6 @@ func (m *Result) validateEthSendRawTransactionResult(formats strfmt.Registry) er return nil } -func (m *Result) validateEthSendTransactionResult(formats strfmt.Registry) error { - if swag.IsZero(m.EthSendTransactionResult) { // not required - return nil - } - - if m.EthSendTransactionResult != nil { - if err := m.EthSendTransactionResult.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ethSendTransactionResult") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ethSendTransactionResult") - } - return err - } - } - - return nil -} - func (m *Result) validateExportPrivateKeyResult(formats strfmt.Registry) error { if swag.IsZero(m.ExportPrivateKeyResult) { // not required return nil @@ -2586,10 +2563,6 @@ func (m *Result) ContextValidate(ctx context.Context, formats strfmt.Registry) e res = append(res, err) } - if err := m.contextValidateEthSendTransactionResult(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateExportPrivateKeyResult(ctx, formats); err != nil { res = append(res, err) } @@ -3819,27 +3792,6 @@ func (m *Result) contextValidateEthSendRawTransactionResult(ctx context.Context, return nil } -func (m *Result) contextValidateEthSendTransactionResult(ctx context.Context, formats strfmt.Registry) error { - - if m.EthSendTransactionResult != nil { - - if swag.IsZero(m.EthSendTransactionResult) { // not required - return nil - } - - if err := m.EthSendTransactionResult.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ethSendTransactionResult") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ethSendTransactionResult") - } - return err - } - } - - return nil -} - func (m *Result) contextValidateExportPrivateKeyResult(ctx context.Context, formats strfmt.Registry) error { if m.ExportPrivateKeyResult != nil { diff --git a/pkg/api/models/update_auth_proxy_config_intent.go b/pkg/api/models/update_auth_proxy_config_intent.go index 9b6b1d6..d6c99c0 100644 --- a/pkg/api/models/update_auth_proxy_config_intent.go +++ b/pkg/api/models/update_auth_proxy_config_intent.go @@ -27,7 +27,7 @@ type UpdateAuthProxyConfigIntent struct { // Template ID for email-auth messages. EmailAuthTemplateID *string `json:"emailAuthTemplateId,omitempty"` - // Overrides for auth-related email content. + // Optional parameters for customizing emails. If not provided, the default email will be used. EmailCustomizationParams *EmailCustomizationParams `json:"emailCustomizationParams,omitempty"` // Enable alphanumeric OTP codes. From 8ffbde6185c9472d1ce45e73a7e1e4086b4c3f29 Mon Sep 17 00:00:00 2001 From: Brian Esler Date: Thu, 13 Nov 2025 14:09:13 -0800 Subject: [PATCH 2/3] add changelog for v0.13.0 --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd59350..8cd4863 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # CHANGELOG +## [v0.13.0](https://github.com/tkhq/go-sdk/compare/v0.12.0...v0.13.0) (2025-11-13) + + ## [v0.12.0](https://github.com/tkhq/go-sdk/compare/v0.11.0...v0.12.0) (2025-11-10) From 7ac3fb38b6f5b6beeebf80db34f3d6de7b03a490 Mon Sep 17 00:00:00 2001 From: Brian Esler Date: Thu, 13 Nov 2025 14:44:21 -0800 Subject: [PATCH 3/3] updating example. --- examples/email_otp/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/email_otp/main.go b/examples/email_otp/main.go index 1a3d2a4..d0c3c3a 100644 --- a/examples/email_otp/main.go +++ b/examples/email_otp/main.go @@ -77,7 +77,7 @@ func sendOTP() (string, error) { TimestampMs: util.RequestTimestamp(), OrganizationID: util.StringPointer(parentOrgID), Type: (*string)(models.ActivityTypeInitOtp.Pointer()), - Parameters: &models.InitOtpIntent{ + Parameters: &models.InitOtpIntentV2{ Contact: util.StringPointer(emailAddress), OtpType: &otpType, },