@faable/auth-sdk 2.9.29 → 2.9.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1051,6 +1051,7 @@ export declare class FaableAuthApi extends GeneratedFaableAuthApi {
1051
1051
  allowed_factors?: ("webauthn" | "totp")[] | undefined;
1052
1052
  remember_device_days?: number | undefined;
1053
1053
  } | undefined;
1054
+ signup_protection?: "off" | "always" | "on_risk" | undefined;
1054
1055
  recovery_channels?: {
1055
1056
  enabled?: ("email" | "sms" | "whatsapp" | "factor")[] | undefined;
1056
1057
  default?: "email" | "sms" | "whatsapp" | "factor" | undefined;
@@ -1155,6 +1156,7 @@ export declare class FaableAuthApi extends GeneratedFaableAuthApi {
1155
1156
  allowed_factors?: ("webauthn" | "totp")[] | undefined;
1156
1157
  remember_device_days?: number | undefined;
1157
1158
  } | undefined;
1159
+ signup_protection?: "off" | "always" | "on_risk" | undefined;
1158
1160
  recovery_channels?: {
1159
1161
  enabled?: ("email" | "sms" | "whatsapp" | "factor")[] | undefined;
1160
1162
  default?: "email" | "sms" | "whatsapp" | "factor" | undefined;
@@ -1262,6 +1264,7 @@ export declare class FaableAuthApi extends GeneratedFaableAuthApi {
1262
1264
  allowed_factors?: ("webauthn" | "totp")[] | undefined;
1263
1265
  remember_device_days?: number | undefined;
1264
1266
  } | undefined;
1267
+ signup_protection?: "off" | "always" | "on_risk" | undefined;
1265
1268
  recovery_channels?: {
1266
1269
  enabled?: ("email" | "sms" | "whatsapp" | "factor")[] | undefined;
1267
1270
  default?: "email" | "sms" | "whatsapp" | "factor" | undefined;
@@ -1368,6 +1371,7 @@ export declare class FaableAuthApi extends GeneratedFaableAuthApi {
1368
1371
  allowed_factors?: ("webauthn" | "totp")[] | undefined;
1369
1372
  remember_device_days?: number | undefined;
1370
1373
  } | undefined;
1374
+ signup_protection?: "off" | "always" | "on_risk" | undefined;
1371
1375
  recovery_channels?: {
1372
1376
  enabled?: ("email" | "sms" | "whatsapp" | "factor")[] | undefined;
1373
1377
  default?: "email" | "sms" | "whatsapp" | "factor" | undefined;
@@ -1611,6 +1611,7 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
1611
1611
  allowed_factors?: ("webauthn" | "totp")[] | undefined;
1612
1612
  remember_device_days?: number | undefined;
1613
1613
  } | undefined;
1614
+ signup_protection?: "off" | "always" | "on_risk" | undefined;
1614
1615
  recovery_channels?: {
1615
1616
  enabled?: ("email" | "sms" | "whatsapp" | "factor")[] | undefined;
1616
1617
  default?: "email" | "sms" | "whatsapp" | "factor" | undefined;
@@ -1731,6 +1732,7 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
1731
1732
  allowed_factors?: ("webauthn" | "totp")[] | undefined;
1732
1733
  remember_device_days?: number | undefined;
1733
1734
  } | undefined;
1735
+ signup_protection?: "off" | "always" | "on_risk" | undefined;
1734
1736
  recovery_channels?: {
1735
1737
  enabled?: ("email" | "sms" | "whatsapp" | "factor")[] | undefined;
1736
1738
  default?: "email" | "sms" | "whatsapp" | "factor" | undefined;
@@ -1852,6 +1854,7 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
1852
1854
  allowed_factors?: ("webauthn" | "totp")[] | undefined;
1853
1855
  remember_device_days?: number | undefined;
1854
1856
  } | undefined;
1857
+ signup_protection?: "off" | "always" | "on_risk" | undefined;
1855
1858
  recovery_channels?: {
1856
1859
  enabled?: ("email" | "sms" | "whatsapp" | "factor")[] | undefined;
1857
1860
  default?: "email" | "sms" | "whatsapp" | "factor" | undefined;
@@ -1974,6 +1977,7 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
1974
1977
  allowed_factors?: ("webauthn" | "totp")[] | undefined;
1975
1978
  remember_device_days?: number | undefined;
1976
1979
  } | undefined;
1980
+ signup_protection?: "off" | "always" | "on_risk" | undefined;
1977
1981
  recovery_channels?: {
1978
1982
  enabled?: ("email" | "sms" | "whatsapp" | "factor")[] | undefined;
1979
1983
  default?: "email" | "sms" | "whatsapp" | "factor" | undefined;
@@ -2078,6 +2082,7 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
2078
2082
  allowed_factors?: ("webauthn" | "totp")[] | undefined;
2079
2083
  remember_device_days?: number | undefined;
2080
2084
  } | undefined;
2085
+ signup_protection?: "off" | "always" | "on_risk" | undefined;
2081
2086
  recovery_channels?: {
2082
2087
  enabled?: ("email" | "sms" | "whatsapp" | "factor")[] | undefined;
2083
2088
  default?: "email" | "sms" | "whatsapp" | "factor" | undefined;
@@ -2185,6 +2190,7 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
2185
2190
  allowed_factors?: ("webauthn" | "totp")[] | undefined;
2186
2191
  remember_device_days?: number | undefined;
2187
2192
  } | undefined;
2193
+ signup_protection?: "off" | "always" | "on_risk" | undefined;
2188
2194
  recovery_channels?: {
2189
2195
  enabled?: ("email" | "sms" | "whatsapp" | "factor")[] | undefined;
2190
2196
  default?: "email" | "sms" | "whatsapp" | "factor" | undefined;
@@ -2308,6 +2314,7 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
2308
2314
  allowed_factors?: ("webauthn" | "totp")[] | undefined;
2309
2315
  remember_device_days?: number | undefined;
2310
2316
  } | undefined;
2317
+ signup_protection?: "off" | "always" | "on_risk" | undefined;
2311
2318
  recovery_channels?: {
2312
2319
  enabled?: ("email" | "sms" | "whatsapp" | "factor")[] | undefined;
2313
2320
  default?: "email" | "sms" | "whatsapp" | "factor" | undefined;
@@ -2429,6 +2436,7 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
2429
2436
  allowed_factors?: ("webauthn" | "totp")[] | undefined;
2430
2437
  remember_device_days?: number | undefined;
2431
2438
  } | undefined;
2439
+ signup_protection?: "off" | "always" | "on_risk" | undefined;
2432
2440
  recovery_channels?: {
2433
2441
  enabled?: ("email" | "sms" | "whatsapp" | "factor")[] | undefined;
2434
2442
  default?: "email" | "sms" | "whatsapp" | "factor" | undefined;
@@ -6181,6 +6181,8 @@ export interface components {
6181
6181
  /** @description How long a browser that already passed a challenge may skip the next one. 0 (default) challenges every time. */
6182
6182
  remember_device_days?: number;
6183
6183
  };
6184
+ /** @description Bot protection for this client's signups and passwordless codes: `off` (Actions only), `on_risk` (a proof-of-work challenge when the request looks risky) or `always` (every signup solves it; clients that cannot are refused). New clients start at `on_risk`. */
6185
+ signup_protection?: "off" | "on_risk" | "always";
6184
6186
  /** @description Password-recovery delivery channels. Set on the Account as the tenant default; the same object on a Client overrides it field by field, like `login_methods` and `mfa_policy`. */
6185
6187
  recovery_channels?: {
6186
6188
  /** @description Channels the tenant has turned on. `email` is always on regardless of this list: it is what every other channel falls back to. A channel listed here is still offered only if the platform can send it, the plan allows it and the user has a verified destination for it. */
@@ -6244,6 +6246,8 @@ export interface components {
6244
6246
  logout_urls?: string[];
6245
6247
  web_origins?: string[];
6246
6248
  initiate_login_uri?: string;
6249
+ /** @description Bot protection for this client's signups and passwordless codes: `off` (Actions only), `on_risk` (a proof-of-work challenge when the request looks risky) or `always` (every signup solves it; clients that cannot are refused). New clients start at `on_risk`. */
6250
+ signup_protection?: "off" | "on_risk" | "always";
6247
6251
  grant_types?: ("authorization_code" | "client_credentials" | "refresh_token" | "password" | "http://auth0.com/oauth/grant-type/passwordless/otp" | "urn:ietf:params:oauth:grant-type:token-exchange" | "urn:ietf:params:oauth:grant-type:device_code" | "http://auth0.com/oauth/grant-type/mfa-otp" | "http://auth0.com/oauth/grant-type/mfa-recovery-code")[];
6248
6252
  /** @description Management API scopes (e.g. `read:rolemembers`) this client may obtain with client_credentials for the audience `faable:management:<account_id>`. A token request gets the requested scopes that are in this list, or the whole list when it asks for none. Empty = the client cannot obtain Management API tokens. Only scopes your own token holds can be granted. */
6249
6253
  management_scopes?: string[];
@@ -6360,6 +6364,8 @@ export interface components {
6360
6364
  /** @description How long a browser that already passed a challenge may skip the next one. 0 (default) challenges every time. */
6361
6365
  remember_device_days?: number;
6362
6366
  } | null;
6367
+ /** @description Bot protection for this client's signups and passwordless codes: `off` (Actions only), `on_risk` (a proof-of-work challenge when the request looks risky) or `always` (every signup solves it; clients that cannot are refused). New clients start at `on_risk`. */
6368
+ signup_protection?: "off" | "on_risk" | "always";
6363
6369
  recovery_channels?: {
6364
6370
  /** @description Channels the tenant has turned on. `email` is always on regardless of this list: it is what every other channel falls back to. A channel listed here is still offered only if the platform can send it, the plan allows it and the user has a verified destination for it. */
6365
6371
  enabled?: ("email" | "sms" | "whatsapp" | "factor")[];
@@ -8698,6 +8704,10 @@ export interface components {
8698
8704
  * - `invalid_credentials` (400): The email/username or password is incorrect.
8699
8705
  * - `login_denied` (401): A post-login Action denied the sign-in. `message` carries the reason it gave. On token grants it is a 403 with `error: invalid_grant`.
8700
8706
  * - `signup_denied` (403): A pre-signup Action or an active block denied the sign-up. `message` carries the reason.
8707
+ * - `challenge_required` (428): The client's signup protection asks for a proof-of-work challenge. `details` carries it (`id`, `kind: 'pow'`, `seed`, `email_hash`, `difficulty`, `expires_at`): find a `nonce` whose sha256(`seed:email_hash:nonce`) starts with `difficulty` zero bits and repeat the request with `challenge: { id, nonce }`. @faable/auth-js >= 3.4.0 does it for you.
8708
+ * - `challenge_invalid` (428): The challenge answer was not accepted: unknown, expired or already used, issued for another request, or a wrong nonce. `details` carries a fresh challenge to solve.
8709
+ * - `challenge_unsupported` (403): The client's signup protection requires the challenge on every signup and this client library cannot solve it. `message` names the minimum @faable/auth-js version.
8710
+ * - `origin_required` (403): This client only accepts the request from a browser: it has Allowed Web Origins and signup protection on, and the request carried no `Origin` header.
8701
8711
  * - `client_credentials_denied` (401): An Action denied the client_credentials grant. `message` carries the reason.
8702
8712
  * - `m2m_quota_exceeded` (402): The project used the machine-to-machine tokens its plan includes this month. Free is capped; Hobby and Pro are billed per token instead.
8703
8713
  * - `signup_disabled` (403): Self-service sign-up is disabled on this connection.
@@ -8827,7 +8837,7 @@ export interface components {
8827
8837
  * - `invalid_code_verifier` (400): `code_verifier` does not match the `code_challenge` of the handoff.
8828
8838
  * @enum {string}
8829
8839
  */
8830
- ErrorCode: "bad_request" | "validation_error" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "method_not_allowed" | "conflict" | "last_sign_in_method" | "payload_too_large" | "unsupported_media_type" | "unprocessable_entity" | "too_many_requests" | "internal_error" | "already_exists" | "invalid_id" | "account_not_found" | "invalid_query" | "search_not_supported" | "invalid_expand" | "access_denied" | "insufficient_scope" | "team_required" | "account_limit_reached" | "invalid_project_id" | "account_transfer_refused" | "email_sender_domain_not_allowed" | "plan_required" | "invalid_canonical_host" | "canonical_host_breaks_passkeys" | "not_logged_in" | "session_already_revoked" | "invalid_token" | "not_owner" | "user_suspended" | "invalid_credentials" | "login_denied" | "signup_denied" | "client_credentials_denied" | "m2m_quota_exceeded" | "signup_disabled" | "email_taken" | "username_taken" | "invalid_username" | "invalid_email" | "invalid_name" | "same_email" | "user_has_no_email" | "password_too_weak" | "invalid_password_hash" | "weak_password_hash" | "invalid_code" | "invalid_phone" | "phone_changed" | "phone_already_verified" | "sms_unavailable" | "sms_failed" | "invalid_state" | "state_mismatch" | "invalid_ticket" | "ticket_used" | "ticket_expired" | "ticket_not_found" | "credential_not_found" | "invalid_link" | "expired_link" | "invalid_otp" | "invalid_client" | "client_not_found" | "client_mismatch" | "invalid_client_metadata" | "invalid_connection" | "no_database_connection" | "connection_required" | "connection_misconfigured" | "passwordless_unavailable" | "ambiguous_connection" | "invalid_redirect_uri" | "invalid_saml_request" | "saml_sp_mismatch" | "saml_not_enabled" | "invalid_client_jwks" | "client_jwks_required" | "invalid_saml_sp" | "origin_not_allowed" | "audience_not_found" | "system_resource" | "invalid_request" | "invalid_device_code" | "provider_error" | "identity_already_linked" | "identity_link_denied" | "identity_conflict" | "identity_orphaned" | "no_provider_token" | "no_refresh_token" | "action_unavailable" | "login_flow_misconfigured" | "mfa_required" | "step_up_required" | "reauth_required" | "invalid_current_password" | "email_not_verified" | "invalid_profile_field" | "interaction_required" | "passkey_login_disabled" | "mfa_pending" | "mfa_invalid_code" | "mfa_invalid_recovery_code" | "too_many_attempts" | "too_many_login_attempts" | "totp_not_allowed" | "no_usable_factor" | "factor_not_found" | "factor_already_confirmed" | "invalid_factor" | "session_missing" | "passkey_verification_failed" | "no_passkey_enrolled" | "malformed_credential" | "unknown_passkey" | "invalid_passkey" | "invalid_invite_url" | "invite_email_mismatch" | "invite_email_unverified" | "invite_not_found" | "invite_used" | "already_member" | "not_a_member" | "consent_options_unavailable" | "consent_choice_invalid" | "oauth21_required" | "registration_disabled" | "invalid_email_domain" | "public_email_domain" | "organization_domain_not_found" | "organization_domain_taken" | "organization_domain_unverified" | "plan_unavailable" | "organization_domain_mismatch" | "team_not_in_organization" | "organization_has_no_idp" | "organization_not_found" | "invalid_user" | "not_an_organization_admin" | "last_organization_admin" | "team_id_unavailable" | "use_team_member_route" | "role_not_found" | "invalid_role" | "invalid_permission" | "flow_not_found" | "revision_not_found" | "invalid_webhook_event" | "invalid_webhook_url" | "not_a_webhook" | "delivery_not_found" | "delivery_in_progress" | "account_mismatch" | "connect_redirect_uri_missing" | "invalid_site_url" | "handoff_not_found" | "handoff_expired" | "handoff_used" | "invalid_code_verifier";
8840
+ ErrorCode: "bad_request" | "validation_error" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "method_not_allowed" | "conflict" | "last_sign_in_method" | "payload_too_large" | "unsupported_media_type" | "unprocessable_entity" | "too_many_requests" | "internal_error" | "already_exists" | "invalid_id" | "account_not_found" | "invalid_query" | "search_not_supported" | "invalid_expand" | "access_denied" | "insufficient_scope" | "team_required" | "account_limit_reached" | "invalid_project_id" | "account_transfer_refused" | "email_sender_domain_not_allowed" | "plan_required" | "invalid_canonical_host" | "canonical_host_breaks_passkeys" | "not_logged_in" | "session_already_revoked" | "invalid_token" | "not_owner" | "user_suspended" | "invalid_credentials" | "login_denied" | "signup_denied" | "challenge_required" | "challenge_invalid" | "challenge_unsupported" | "origin_required" | "client_credentials_denied" | "m2m_quota_exceeded" | "signup_disabled" | "email_taken" | "username_taken" | "invalid_username" | "invalid_email" | "invalid_name" | "same_email" | "user_has_no_email" | "password_too_weak" | "invalid_password_hash" | "weak_password_hash" | "invalid_code" | "invalid_phone" | "phone_changed" | "phone_already_verified" | "sms_unavailable" | "sms_failed" | "invalid_state" | "state_mismatch" | "invalid_ticket" | "ticket_used" | "ticket_expired" | "ticket_not_found" | "credential_not_found" | "invalid_link" | "expired_link" | "invalid_otp" | "invalid_client" | "client_not_found" | "client_mismatch" | "invalid_client_metadata" | "invalid_connection" | "no_database_connection" | "connection_required" | "connection_misconfigured" | "passwordless_unavailable" | "ambiguous_connection" | "invalid_redirect_uri" | "invalid_saml_request" | "saml_sp_mismatch" | "saml_not_enabled" | "invalid_client_jwks" | "client_jwks_required" | "invalid_saml_sp" | "origin_not_allowed" | "audience_not_found" | "system_resource" | "invalid_request" | "invalid_device_code" | "provider_error" | "identity_already_linked" | "identity_link_denied" | "identity_conflict" | "identity_orphaned" | "no_provider_token" | "no_refresh_token" | "action_unavailable" | "login_flow_misconfigured" | "mfa_required" | "step_up_required" | "reauth_required" | "invalid_current_password" | "email_not_verified" | "invalid_profile_field" | "interaction_required" | "passkey_login_disabled" | "mfa_pending" | "mfa_invalid_code" | "mfa_invalid_recovery_code" | "too_many_attempts" | "too_many_login_attempts" | "totp_not_allowed" | "no_usable_factor" | "factor_not_found" | "factor_already_confirmed" | "invalid_factor" | "session_missing" | "passkey_verification_failed" | "no_passkey_enrolled" | "malformed_credential" | "unknown_passkey" | "invalid_passkey" | "invalid_invite_url" | "invite_email_mismatch" | "invite_email_unverified" | "invite_not_found" | "invite_used" | "already_member" | "not_a_member" | "consent_options_unavailable" | "consent_choice_invalid" | "oauth21_required" | "registration_disabled" | "invalid_email_domain" | "public_email_domain" | "organization_domain_not_found" | "organization_domain_taken" | "organization_domain_unverified" | "plan_unavailable" | "organization_domain_mismatch" | "team_not_in_organization" | "organization_has_no_idp" | "organization_not_found" | "invalid_user" | "not_an_organization_admin" | "last_organization_admin" | "team_id_unavailable" | "use_team_member_route" | "role_not_found" | "invalid_role" | "invalid_permission" | "flow_not_found" | "revision_not_found" | "invalid_webhook_event" | "invalid_webhook_url" | "not_a_webhook" | "delivery_not_found" | "delivery_in_progress" | "account_mismatch" | "connect_redirect_uri_missing" | "invalid_site_url" | "handoff_not_found" | "handoff_expired" | "handoff_used" | "invalid_code_verifier";
8831
8841
  /** @description Every error response has this shape. Branch on `error_code`, never on `message`: the message is written for a person and may change. */
8832
8842
  ErrorResponse: {
8833
8843
  /** @description The HTTP status, repeated. */
@@ -13011,6 +13021,8 @@ export interface operations {
13011
13021
  logout_urls?: string[];
13012
13022
  web_origins?: string[];
13013
13023
  initiate_login_uri?: string;
13024
+ /** @description Bot protection for this client's signups and passwordless codes: `off` (Actions only), `on_risk` (a proof-of-work challenge when the request looks risky) or `always` (every signup solves it; clients that cannot are refused). New clients start at `on_risk`. */
13025
+ signup_protection?: "off" | "on_risk" | "always";
13014
13026
  grant_types?: ("authorization_code" | "client_credentials" | "refresh_token" | "password" | "http://auth0.com/oauth/grant-type/passwordless/otp" | "urn:ietf:params:oauth:grant-type:token-exchange" | "urn:ietf:params:oauth:grant-type:device_code" | "http://auth0.com/oauth/grant-type/mfa-otp" | "http://auth0.com/oauth/grant-type/mfa-recovery-code")[];
13015
13027
  /** @description Management API scopes (e.g. `read:rolemembers`) this client may obtain with client_credentials for the audience `faable:management:<account_id>`. A token request gets the requested scopes that are in this list, or the whole list when it asks for none. Empty = the client cannot obtain Management API tokens. Only scopes your own token holds can be granted. */
13016
13028
  management_scopes?: string[];
@@ -13140,6 +13152,8 @@ export interface operations {
13140
13152
  /** @description How long a browser that already passed a challenge may skip the next one. 0 (default) challenges every time. */
13141
13153
  remember_device_days?: number;
13142
13154
  };
13155
+ /** @description Bot protection for this client's signups and passwordless codes: `off` (Actions only), `on_risk` (a proof-of-work challenge when the request looks risky) or `always` (every signup solves it; clients that cannot are refused). New clients start at `on_risk`. */
13156
+ signup_protection?: "off" | "on_risk" | "always";
13143
13157
  /** @description Password-recovery delivery channels. Set on the Account as the tenant default; the same object on a Client overrides it field by field, like `login_methods` and `mfa_policy`. */
13144
13158
  recovery_channels?: {
13145
13159
  /** @description Channels the tenant has turned on. `email` is always on regardless of this list: it is what every other channel falls back to. A channel listed here is still offered only if the platform can send it, the plan allows it and the user has a verified destination for it. */
@@ -13403,6 +13417,8 @@ export interface operations {
13403
13417
  /** @description How long a browser that already passed a challenge may skip the next one. 0 (default) challenges every time. */
13404
13418
  remember_device_days?: number;
13405
13419
  };
13420
+ /** @description Bot protection for this client's signups and passwordless codes: `off` (Actions only), `on_risk` (a proof-of-work challenge when the request looks risky) or `always` (every signup solves it; clients that cannot are refused). New clients start at `on_risk`. */
13421
+ signup_protection?: "off" | "on_risk" | "always";
13406
13422
  /** @description Password-recovery delivery channels. Set on the Account as the tenant default; the same object on a Client overrides it field by field, like `login_methods` and `mfa_policy`. */
13407
13423
  recovery_channels?: {
13408
13424
  /** @description Channels the tenant has turned on. `email` is always on regardless of this list: it is what every other channel falls back to. A channel listed here is still offered only if the platform can send it, the plan allows it and the user has a verified destination for it. */
@@ -13656,6 +13672,8 @@ export interface operations {
13656
13672
  /** @description How long a browser that already passed a challenge may skip the next one. 0 (default) challenges every time. */
13657
13673
  remember_device_days?: number;
13658
13674
  } | null;
13675
+ /** @description Bot protection for this client's signups and passwordless codes: `off` (Actions only), `on_risk` (a proof-of-work challenge when the request looks risky) or `always` (every signup solves it; clients that cannot are refused). New clients start at `on_risk`. */
13676
+ signup_protection?: "off" | "on_risk" | "always";
13659
13677
  recovery_channels?: {
13660
13678
  /** @description Channels the tenant has turned on. `email` is always on regardless of this list: it is what every other channel falls back to. A channel listed here is still offered only if the platform can send it, the plan allows it and the user has a verified destination for it. */
13661
13679
  enabled?: ("email" | "sms" | "whatsapp" | "factor")[];
@@ -13814,6 +13832,8 @@ export interface operations {
13814
13832
  /** @description How long a browser that already passed a challenge may skip the next one. 0 (default) challenges every time. */
13815
13833
  remember_device_days?: number;
13816
13834
  };
13835
+ /** @description Bot protection for this client's signups and passwordless codes: `off` (Actions only), `on_risk` (a proof-of-work challenge when the request looks risky) or `always` (every signup solves it; clients that cannot are refused). New clients start at `on_risk`. */
13836
+ signup_protection?: "off" | "on_risk" | "always";
13817
13837
  /** @description Password-recovery delivery channels. Set on the Account as the tenant default; the same object on a Client overrides it field by field, like `login_methods` and `mfa_policy`. */
13818
13838
  recovery_channels?: {
13819
13839
  /** @description Channels the tenant has turned on. `email` is always on regardless of this list: it is what every other channel falls back to. A channel listed here is still offered only if the platform can send it, the plan allows it and the user has a verified destination for it. */
@@ -14083,6 +14103,8 @@ export interface operations {
14083
14103
  /** @description How long a browser that already passed a challenge may skip the next one. 0 (default) challenges every time. */
14084
14104
  remember_device_days?: number;
14085
14105
  };
14106
+ /** @description Bot protection for this client's signups and passwordless codes: `off` (Actions only), `on_risk` (a proof-of-work challenge when the request looks risky) or `always` (every signup solves it; clients that cannot are refused). New clients start at `on_risk`. */
14107
+ signup_protection?: "off" | "on_risk" | "always";
14086
14108
  /** @description Password-recovery delivery channels. Set on the Account as the tenant default; the same object on a Client overrides it field by field, like `login_methods` and `mfa_policy`. */
14087
14109
  recovery_channels?: {
14088
14110
  /** @description Channels the tenant has turned on. `email` is always on regardless of this list: it is what every other channel falls back to. A channel listed here is still offered only if the platform can send it, the plan allows it and the user has a verified destination for it. */
@@ -14350,6 +14372,8 @@ export interface operations {
14350
14372
  /** @description How long a browser that already passed a challenge may skip the next one. 0 (default) challenges every time. */
14351
14373
  remember_device_days?: number;
14352
14374
  };
14375
+ /** @description Bot protection for this client's signups and passwordless codes: `off` (Actions only), `on_risk` (a proof-of-work challenge when the request looks risky) or `always` (every signup solves it; clients that cannot are refused). New clients start at `on_risk`. */
14376
+ signup_protection?: "off" | "on_risk" | "always";
14353
14377
  /** @description Password-recovery delivery channels. Set on the Account as the tenant default; the same object on a Client overrides it field by field, like `login_methods` and `mfa_policy`. */
14354
14378
  recovery_channels?: {
14355
14379
  /** @description Channels the tenant has turned on. `email` is always on regardless of this list: it is what every other channel falls back to. A channel listed here is still offered only if the platform can send it, the plan allows it and the user has a verified destination for it. */
@@ -34205,6 +34229,11 @@ export interface operations {
34205
34229
  resume_url?: string;
34206
34230
  /** @description The login's key from `/authorize` — the hosted screen's `?state=`. Only ties the code this start issues to that login for tracing; it is not consumed and never rejects the request (`/passwordless/verify_code` is the step that uses it). */
34207
34231
  state?: string;
34232
+ /** @description Answer to a `challenge_required`: the challenge `id` and the `nonce` found. @faable/auth-js >= 3.4.0 fills it in. */
34233
+ challenge?: {
34234
+ id: string;
34235
+ nonce: string;
34236
+ };
34208
34237
  };
34209
34238
  };
34210
34239
  };
@@ -34241,7 +34270,11 @@ export interface operations {
34241
34270
  };
34242
34271
  };
34243
34272
  /**
34244
- * @description `origin_not_allowed` — The request `Origin` is not in the client's Allowed Web Origins.
34273
+ * @description `challenge_unsupported` — The client's signup protection requires the challenge on every signup and this client library cannot solve it. `message` names the minimum @faable/auth-js version.
34274
+ *
34275
+ * `origin_required` — This client only accepts the request from a browser: it has Allowed Web Origins and signup protection on, and the request carried no `Origin` header.
34276
+ *
34277
+ * `origin_not_allowed` — The request `Origin` is not in the client's Allowed Web Origins.
34245
34278
  *
34246
34279
  * `signup_denied` — A pre-signup Action or an active block denied the sign-up. `message` carries the reason.
34247
34280
  */
@@ -34252,7 +34285,7 @@ export interface operations {
34252
34285
  content: {
34253
34286
  "application/json": components["schemas"]["ErrorResponse"] & {
34254
34287
  /** @enum {string} */
34255
- error_code?: "origin_not_allowed" | "signup_denied";
34288
+ error_code?: "challenge_unsupported" | "origin_required" | "origin_not_allowed" | "signup_denied";
34256
34289
  };
34257
34290
  };
34258
34291
  };
@@ -34268,6 +34301,22 @@ export interface operations {
34268
34301
  };
34269
34302
  };
34270
34303
  };
34304
+ /**
34305
+ * @description `challenge_invalid` — The challenge answer was not accepted: unknown, expired or already used, issued for another request, or a wrong nonce. `details` carries a fresh challenge to solve.
34306
+ *
34307
+ * `challenge_required` — The client's signup protection asks for a proof-of-work challenge. `details` carries it (`id`, `kind: 'pow'`, `seed`, `email_hash`, `difficulty`, `expires_at`): find a `nonce` whose sha256(`seed:email_hash:nonce`) starts with `difficulty` zero bits and repeat the request with `challenge: { id, nonce }`. @faable/auth-js >= 3.4.0 does it for you.
34308
+ */
34309
+ 428: {
34310
+ headers: {
34311
+ [name: string]: unknown;
34312
+ };
34313
+ content: {
34314
+ "application/json": components["schemas"]["ErrorResponse"] & {
34315
+ /** @enum {string} */
34316
+ error_code?: "challenge_invalid" | "challenge_required";
34317
+ };
34318
+ };
34319
+ };
34271
34320
  /** @description `too_many_requests` — Rate limit exceeded. Honour the `Retry-After` header. */
34272
34321
  429: {
34273
34322
  headers: {
@@ -38443,6 +38492,13 @@ export interface operations {
38443
38492
  };
38444
38493
  /** @description Optional connection_name to disambiguate when the tenant has more than one database connection. Defaults to the tenant database connection. */
38445
38494
  connection?: string;
38495
+ /** @description The application's Client ID. auth-js sends it. When it names a client of the tenant, that client's Allowed Web Origins and signup protection apply; an unknown or missing one is accepted (as before) and recorded. */
38496
+ client_id?: string;
38497
+ /** @description Answer to a `challenge_required`: the challenge `id` and the `nonce` found. @faable/auth-js >= 3.4.0 fills it in. */
38498
+ challenge?: {
38499
+ id: string;
38500
+ nonce: string;
38501
+ };
38446
38502
  };
38447
38503
  };
38448
38504
  };
@@ -38477,7 +38533,13 @@ export interface operations {
38477
38533
  };
38478
38534
  };
38479
38535
  /**
38480
- * @description `signup_denied` — A pre-signup Action or an active block denied the sign-up. `message` carries the reason.
38536
+ * @description `challenge_unsupported` — The client's signup protection requires the challenge on every signup and this client library cannot solve it. `message` names the minimum @faable/auth-js version.
38537
+ *
38538
+ * `origin_required` — This client only accepts the request from a browser: it has Allowed Web Origins and signup protection on, and the request carried no `Origin` header.
38539
+ *
38540
+ * `origin_not_allowed` — The request `Origin` is not in the client's Allowed Web Origins.
38541
+ *
38542
+ * `signup_denied` — A pre-signup Action or an active block denied the sign-up. `message` carries the reason.
38481
38543
  *
38482
38544
  * `signup_disabled` — Self-service sign-up is disabled on this connection.
38483
38545
  */
@@ -38488,7 +38550,7 @@ export interface operations {
38488
38550
  content: {
38489
38551
  "application/json": components["schemas"]["ErrorResponse"] & {
38490
38552
  /** @enum {string} */
38491
- error_code?: "signup_denied" | "signup_disabled";
38553
+ error_code?: "challenge_unsupported" | "origin_required" | "origin_not_allowed" | "signup_denied" | "signup_disabled";
38492
38554
  };
38493
38555
  };
38494
38556
  };
@@ -38520,6 +38582,22 @@ export interface operations {
38520
38582
  };
38521
38583
  };
38522
38584
  };
38585
+ /**
38586
+ * @description `challenge_invalid` — The challenge answer was not accepted: unknown, expired or already used, issued for another request, or a wrong nonce. `details` carries a fresh challenge to solve.
38587
+ *
38588
+ * `challenge_required` — The client's signup protection asks for a proof-of-work challenge. `details` carries it (`id`, `kind: 'pow'`, `seed`, `email_hash`, `difficulty`, `expires_at`): find a `nonce` whose sha256(`seed:email_hash:nonce`) starts with `difficulty` zero bits and repeat the request with `challenge: { id, nonce }`. @faable/auth-js >= 3.4.0 does it for you.
38589
+ */
38590
+ 428: {
38591
+ headers: {
38592
+ [name: string]: unknown;
38593
+ };
38594
+ content: {
38595
+ "application/json": components["schemas"]["ErrorResponse"] & {
38596
+ /** @enum {string} */
38597
+ error_code?: "challenge_invalid" | "challenge_required";
38598
+ };
38599
+ };
38600
+ };
38523
38601
  /** @description `too_many_requests` — Rate limit exceeded. Honour the `Retry-After` header. */
38524
38602
  429: {
38525
38603
  headers: {
package/dist/version.js CHANGED
@@ -9,13 +9,13 @@
9
9
  // login pages could not import the SDK at all. Same pattern as auth-js.
10
10
  //
11
11
  // The sentinels MUST stay byte-identical to the `from` values in `.releaserc`.
12
- export const version = "2.9.29";
12
+ export const version = "2.9.31";
13
13
  // Short git SHA of the released commit. The version dates a build; this names
14
14
  // the exact tree, so a canonical log line or an audit entry leads straight to
15
15
  // `git show <sha>`. Deliberately NOT hex: an unreleased build (dev, a local
16
16
  // link) cannot be mistaken for a real commit — auth only records values that
17
17
  // look like a SHA, and this one never will.
18
- export const commit = "2c94779";
18
+ export const commit = "c54b5db";
19
19
  // What this SDK writes in `x-faable-client`. Exported for a consumer that
20
20
  // builds a strategy on its own (outside `FaableAuthApi`) and still wants the
21
21
  // token request attributed — a bare `authClientCredentials` stamps only what
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faable/auth-sdk",
3
- "version": "2.9.29",
3
+ "version": "2.9.31",
4
4
  "author": "Marc Pomar <marc@faable.com>",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/spec/openapi.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "info": {
4
4
  "title": "@faablecloud/auth",
5
5
  "description": "Auth Platform made by Faable. Manage Users and Roles",
6
- "version": "2.107.0",
6
+ "version": "2.109.0",
7
7
  "license": {
8
8
  "name": "private",
9
9
  "url": "https://faable.com/docs/platform/privacy-policy"
@@ -2085,6 +2085,29 @@
2085
2085
  "additionalProperties": false,
2086
2086
  "description": "Second-factor policy. Set on the Account as the tenant default; the same object on a Client overrides it **field by field**, so one app can require MFA without changing the rest."
2087
2087
  },
2088
+ "signup_protection": {
2089
+ "anyOf": [
2090
+ {
2091
+ "type": "string",
2092
+ "enum": [
2093
+ "off"
2094
+ ]
2095
+ },
2096
+ {
2097
+ "type": "string",
2098
+ "enum": [
2099
+ "on_risk"
2100
+ ]
2101
+ },
2102
+ {
2103
+ "type": "string",
2104
+ "enum": [
2105
+ "always"
2106
+ ]
2107
+ }
2108
+ ],
2109
+ "description": "Bot protection for this client's signups and passwordless codes: `off` (Actions only), `on_risk` (a proof-of-work challenge when the request looks risky) or `always` (every signup solves it; clients that cannot are refused). New clients start at `on_risk`."
2110
+ },
2088
2111
  "recovery_channels": {
2089
2112
  "type": "object",
2090
2113
  "properties": {
@@ -2376,6 +2399,29 @@
2376
2399
  "initiate_login_uri": {
2377
2400
  "type": "string"
2378
2401
  },
2402
+ "signup_protection": {
2403
+ "anyOf": [
2404
+ {
2405
+ "type": "string",
2406
+ "enum": [
2407
+ "off"
2408
+ ]
2409
+ },
2410
+ {
2411
+ "type": "string",
2412
+ "enum": [
2413
+ "on_risk"
2414
+ ]
2415
+ },
2416
+ {
2417
+ "type": "string",
2418
+ "enum": [
2419
+ "always"
2420
+ ]
2421
+ }
2422
+ ],
2423
+ "description": "Bot protection for this client's signups and passwordless codes: `off` (Actions only), `on_risk` (a proof-of-work challenge when the request looks risky) or `always` (every signup solves it; clients that cannot are refused). New clients start at `on_risk`."
2424
+ },
2379
2425
  "grant_types": {
2380
2426
  "type": "array",
2381
2427
  "items": {
@@ -3001,6 +3047,29 @@
3001
3047
  }
3002
3048
  ]
3003
3049
  },
3050
+ "signup_protection": {
3051
+ "anyOf": [
3052
+ {
3053
+ "type": "string",
3054
+ "enum": [
3055
+ "off"
3056
+ ]
3057
+ },
3058
+ {
3059
+ "type": "string",
3060
+ "enum": [
3061
+ "on_risk"
3062
+ ]
3063
+ },
3064
+ {
3065
+ "type": "string",
3066
+ "enum": [
3067
+ "always"
3068
+ ]
3069
+ }
3070
+ ],
3071
+ "description": "Bot protection for this client's signups and passwordless codes: `off` (Actions only), `on_risk` (a proof-of-work challenge when the request looks risky) or `always` (every signup solves it; clients that cannot are refused). New clients start at `on_risk`."
3072
+ },
3004
3073
  "recovery_channels": {
3005
3074
  "anyOf": [
3006
3075
  {
@@ -9890,7 +9959,7 @@
9890
9959
  },
9891
9960
  "ErrorCode": {
9892
9961
  "type": "string",
9893
- "description": "Machine-readable error code. One HTTP status per code.\n\n- `bad_request` (400): The request is malformed. `message` says what is wrong.\n- `validation_error` (400): The body, query or path failed schema validation. `details.issues` lists each failing field.\n- `unauthorized` (401): The request carries no valid credentials.\n- `payment_required` (402): The feature is not included in the current plan.\n- `forbidden` (403): The credentials are valid but do not allow this operation.\n- `not_found` (404): The resource does not exist in this account.\n- `method_not_allowed` (405): The HTTP method is not supported on this path.\n- `conflict` (409): The request conflicts with the current state of the resource.\n- `last_sign_in_method` (409): Unlinking this account would leave the user with no way to sign in: set a password, verify the email or link another account first.\n- `payload_too_large` (413): The request body exceeds the size limit.\n- `unsupported_media_type` (415): The `Content-Type` is not accepted by this endpoint.\n- `unprocessable_entity` (422): The request is well-formed but cannot be processed.\n- `too_many_requests` (429): Rate limit exceeded. Honour the `Retry-After` header.\n- `internal_error` (500): Unexpected server error. Retry later; the request id is logged.\n- `already_exists` (400): A resource with the same unique field already exists (for a user, usually `email`). `details.fields` names the field.\n- `invalid_id` (400): The id in the path is not a valid id for this resource.\n- `account_not_found` (404): No Auth Account matches the request (domain, header or token).\n- `invalid_query` (400): The `?query=` FaableQL expression could not be parsed.\n- `search_not_supported` (400): This resource does not support `?search=`.\n- `invalid_expand` (400): An `?expand=` path is not allowed on this resource.\n- `access_denied` (403): The caller may not access this row (ownership or machine-to-machine restriction).\n- `insufficient_scope` (403): The token lacks a scope this operation requires. `message` names it.\n- `team_required` (400): An Auth Account must belong to a project (team).\n- `account_limit_reached` (409): The project already has the maximum number of Auth Accounts.\n- `invalid_project_id` (400): The project id is not of the form `project_<hex>` or `team_<hex>`.\n- `account_transfer_refused` (409): The Auth Account cannot be moved to that project. `details.blockers` lists why.\n- `email_sender_domain_not_allowed` (400): The sender address is not in a domain this platform signs email for (AUTH_EMAIL_SENDER_DOMAINS).\n- `plan_required` (402): The setting requires a higher plan. `message` says which.\n- `invalid_canonical_host` (400): `canonical_host` must be this account's own platform host or one of its verified custom domains.\n- `canonical_host_breaks_passkeys` (400): `canonical_host` is outside the account's current WebAuthn RP ID — every passkey already enrolled would stop working. Set `webauthn_rp_id` in the same request to a suffix that covers both.\n- `not_logged_in` (401): There is no signed-in session for this request.\n- `session_already_revoked` (409): The session was already revoked.\n- `invalid_token` (401): The bearer token is missing, malformed, expired or has no subject.\n- `not_owner` (403): The caller may only perform this operation on their own user.\n- `user_suspended` (403): The user is suspended and cannot sign in or be modified.\n- `invalid_credentials` (400): The email/username or password is incorrect.\n- `login_denied` (401): A post-login Action denied the sign-in. `message` carries the reason it gave. On token grants it is a 403 with `error: invalid_grant`.\n- `signup_denied` (403): A pre-signup Action or an active block denied the sign-up. `message` carries the reason.\n- `client_credentials_denied` (401): An Action denied the client_credentials grant. `message` carries the reason.\n- `m2m_quota_exceeded` (402): The project used the machine-to-machine tokens its plan includes this month. Free is capped; Hobby and Pro are billed per token instead.\n- `signup_disabled` (403): Self-service sign-up is disabled on this connection.\n- `email_taken` (409): Another user in this account already uses that email.\n- `username_taken` (409): Another user of this database connection already uses that username.\n- `invalid_username` (400): The username is empty, or contains an `@` or whitespace. `message` says which.\n- `invalid_email` (400): The email address is not valid.\n- `invalid_name` (400): The name contains a link. `message` says which field.\n- `same_email` (400): The new email is the same as the current one.\n- `user_has_no_email` (400): The operation needs an email but the user has none.\n- `password_too_weak` (400): The password does not meet the connection policy. `message` lists each unmet rule.\n- `invalid_password_hash` (400): The imported password hash cannot be read, or its cost is above what a login can afford. `message` names the field.\n- `weak_password_hash` (400): The imported password hash uses a fast digest (MD5, SHA-1, SHA-2) or a cost below the minimum. `message` says which.\n- `invalid_code` (400): The verification code is wrong, expired or already used.\n- `invalid_phone` (400): The phone number is not E.164 and could not be resolved with the account default country. Include the country code.\n- `phone_changed` (400): The phone on the user changed after the code was sent. Start again.\n- `phone_already_verified` (409): The user already has a verified phone; the number cannot be swapped from the screen.\n- `sms_unavailable` (409): This account cannot send SMS right now. The suffix says why: `sms_unavailable:plan`, `:quota`, `:provider`.\n- `sms_failed` (409): The SMS provider rejected the message.\n- `invalid_state` (400): The `state` is missing, expired, or does not describe a resumable step.\n- `state_mismatch` (401): The `state` belongs to another account, session, client or ceremony.\n- `invalid_ticket` (400): The ticket does not exist or is not the kind this endpoint accepts.\n- `ticket_used` (400): The ticket was already consumed.\n- `ticket_expired` (400): The ticket is past its expiry.\n- `ticket_not_found` (404): No ticket with that id belongs to this user.\n- `credential_not_found` (404): The user has no password credential on this connection.\n- `invalid_link` (400): The magic link is malformed.\n- `expired_link` (400): The magic link token was not found or has expired.\n- `invalid_otp` (401): The one-time password is wrong or expired.\n- `invalid_client` (400): The `client_id` in the request does not name a client of this account.\n- `client_not_found` (404): No client with that `client_id`.\n- `client_mismatch` (401): The client belongs to a different account.\n- `invalid_client_metadata` (400): A client field was rejected: by dynamic client registration (RFC 7591), or on a client create/update (`initiate_login_uri`). `message` names it.\n- `invalid_connection` (400): The connection does not exist, is disabled, or is not of the type this flow needs.\n- `no_database_connection` (400): The tenant has no database connection, so there is nowhere to store a password. Create one and retry.\n- `connection_required` (400): No connection was given and the client has no `default_connection`.\n- `connection_misconfigured` (400): The connection is missing settings needed to talk to its provider.\n- `passwordless_unavailable` (400): No passwordless connection is configured or enabled for this client.\n- `ambiguous_connection` (400): Several connections match; pass `connection_id`.\n- `invalid_redirect_uri` (400): The redirect URI is not registered for the client.\n- `invalid_saml_request` (400): The SAMLRequest is missing, too large, not well-formed or not a SAML 2.0 AuthnRequest.\n- `saml_sp_mismatch` (400): The AuthnRequest does not match the client's SAML configuration: its Issuer is not the configured entity_id, or it asks for another Assertion Consumer Service URL or binding.\n- `saml_not_enabled` (404): This client does not have SAML enabled.\n- `invalid_client_jwks` (400): The client `jwks` is not a valid set of public signing keys: RSA (2048 bits or more), EC (P-256, P-384, P-521) or Ed25519, public members only, up to 5, each with a `kid` when there is more than one.\n- `client_jwks_required` (400): A client whose `token_endpoint_auth_method` is `private_key_jwt` needs public keys in `jwks`.\n- `invalid_saml_sp` (400): The `saml_sp` configuration is invalid: `acs_url` must be an absolute https URL without a fragment.\n- `origin_not_allowed` (403): The request `Origin` is not in the client's Allowed Web Origins.\n- `audience_not_found` (403): The `audience` does not name an API registered in this account.\n- `system_resource` (403): The resource is managed by Faable and cannot be modified or deleted.\n- `invalid_request` (400): A required OAuth parameter is missing or two of them are incompatible. `message` says which.\n- `invalid_device_code` (400): The device or user code is invalid or expired.\n- `provider_error` (400): The upstream identity provider returned an error. The suffix is the provider’s own code, when it sent one: `provider_error:bad_refresh_token` (the user must re-authorize), `provider_error:incorrect_client_credentials` (our configuration, the user can do nothing). `details.provider_error_description` carries the provider’s sentence.\n- `identity_already_linked` (409): That external identity is already linked to another user.\n- `identity_link_denied` (409): That external identity cannot be linked to this user.\n- `identity_conflict` (409): The user already has a linked identity for this connection.\n- `identity_orphaned` (400): The identity pointed at a user that no longer exists; it was removed. Sign in again.\n- `no_provider_token` (400): The identity holds no provider access token.\n- `no_refresh_token` (400): The identity holds no provider refresh token, so it cannot be refreshed.\n- `action_unavailable` (401): The Action that paused this login is disabled or belongs elsewhere.\n- `login_flow_misconfigured` (500): The login flow of this account cannot run. `message` carries the node error.\n- `mfa_required` (403): The login needs a second factor that this flow cannot collect, or one is still pending on the session.\n- `step_up_required` (403): Confirm an existing factor before changing your factors.\n- `reauth_required` (403): The operation needs a recent sign-in (and the second factor, when the user has one). Sign in again with `max_age=0` and retry with the new token.\n- `invalid_current_password` (400): The current password is wrong.\n- `email_not_verified` (403): The user's email is not verified, and the operation needs it to be.\n- `invalid_profile_field` (400): A profile field is not declared for this application, or its value does not match the declaration. `message` names the key.\n- `interaction_required` (403): An Action asked for a redirect on a non-interactive flow.\n- `passkey_login_disabled` (400): Sign in with a passkey is not enabled for this client.\n- `mfa_pending` (401): A second-factor challenge is pending; answer it before continuing.\n- `mfa_invalid_code` (401): The authenticator code did not verify.\n- `mfa_invalid_recovery_code` (401): The recovery code did not verify.\n- `too_many_attempts` (429): Too many wrong codes. Wait a few minutes and try again.\n- `too_many_login_attempts` (429): Too many failed sign-in attempts for this email or username from this network. Wait a few minutes and try again.\n- `totp_not_allowed` (401): This account does not accept authenticator apps.\n- `no_usable_factor` (400): The user has no confirmed second factor to challenge.\n- `factor_not_found` (400): No factor with that id belongs to this user.\n- `factor_already_confirmed` (400): The factor was already confirmed.\n- `invalid_factor` (400): The factor cannot be verified (no secret material).\n- `session_missing` (401): The session that started this login no longer exists.\n- `passkey_verification_failed` (400): The WebAuthn response could not be verified.\n- `no_passkey_enrolled` (400): The user has no passkey to sign in with.\n- `malformed_credential` (400): The WebAuthn credential is malformed.\n- `unknown_passkey` (401): The passkey is not enrolled for this user.\n- `invalid_passkey` (401): The passkey assertion did not verify.\n- `invalid_invite_url` (400): An invite's `accept_url` or `redirect_uri` is not an http(s) URL at an origin of this tenant's client callbacks or `callback_hostnames`, or it carries a fragment.\n- `invite_email_mismatch` (403): The invite is for another email address than the accepting user's. `details.invited_email` shows it masked.\n- `invite_email_unverified` (403): The accepting user's email matches the invite but is not verified yet.\n- `invite_not_found` (404): No invite with that id in this account.\n- `invite_used` (400): The invite was already accepted.\n- `already_member` (400): The user is already a member of the team.\n- `not_a_member` (404): The user is not a member of the team.\n- `consent_options_unavailable` (502): The consent screen could not load the choices from the API being authorized (its `consent_options.url`). Try again in a moment.\n- `consent_choice_invalid` (400): The choice sent with the consent decision is not one the API offered for this user.\n- `oauth21_required` (400): The tenant enforces OAuth 2.1 (`oauth21_enabled`) and the request is one OAuth 2.1 removed: a `response_type` other than `code`, an authorization request without PKCE (`code_challenge` with `S256`), or the password grant. `message` says which. Update the application (with `@faable/auth-js`, version 3.1.0 or later) or turn `oauth21_enabled` off for the tenant.\n- `registration_disabled` (403): Dynamic client registration is turned off for this tenant. Create the client from the dashboard or the Management API, or turn on `dynamic_client_registration_enabled`.\n- `invalid_email_domain` (400): Not an email domain this organization can claim: it must be a plain domain name (`acme.com`), lowercase, without scheme, path or wildcard.\n- `public_email_domain` (400): A public email provider (gmail.com, outlook.com…) cannot belong to an organization: anyone can have an address there.\n- `organization_domain_not_found` (404): The organization has no such domain.\n- `organization_domain_taken` (409): Another organization of this tenant already verified this domain. A domain belongs to one organization.\n- `organization_domain_unverified` (400): The TXT record was not found or does not hold the expected value yet. `details.record` says what was expected and what resolves now; DNS can take a few minutes to propagate.\n- `plan_unavailable` (503): The plan could not be checked right now, and this setting is only for paid plans. Try again in a minute.\n- `organization_domain_mismatch` (403): This organization's identity provider can only sign in addresses of the organization's verified email domains.\n- `team_not_in_organization` (400): Auto-join can only put people in teams of the same organization. `details.teams` lists the others.\n- `organization_has_no_idp` (400): Requiring SSO needs an identity provider: bind an `oidc` connection to the organization first.\n- `organization_not_found` (404): No organization with that id in this account.\n- `invalid_user` (400): The user does not exist in this account.\n- `not_an_organization_admin` (404): The user is not an admin of the organization.\n- `last_organization_admin` (409): An organization keeps at least one admin. Add another admin before removing this one.\n- `team_id_unavailable` (409): The team id cannot be used in this tenant. Pick another id or let the API generate one.\n- `use_team_member_route` (400): This generic route cannot create memberships. Use `POST /team/{team_id}/member` for team members or `POST /role/{role_id}/users` for role grants.\n- `role_not_found` (404): No role with that id in this account.\n- `invalid_role` (400): The role belongs to another account.\n- `invalid_permission` (400): A permission is not in the catalog of its Api, or the Api is not in this account. `details.permissions` lists the ones refused.\n- `flow_not_found` (400): The login flow does not exist in this account.\n- `revision_not_found` (404): The revision is not in the flow history.\n- `invalid_webhook_event` (400): An event is not in the webhook event catalog. `message` and `details.valid_events` list the valid ones.\n- `invalid_webhook_url` (400): The webhook URL must be an absolute `https` URL.\n- `not_a_webhook` (400): The operation only applies to `webhook` subscriptions.\n- `delivery_not_found` (404): No webhook delivery with that id for this subscription.\n- `delivery_in_progress` (409): The delivery is being attempted right now; retry the redeliver in a minute.\n- `account_mismatch` (400): The `account_id` in the body is not the account the request is scoped to (`x-faableauth-account`).\n- `connect_redirect_uri_missing` (400): The client's callbacks do not include `<site_url>/wp-login.php?faable-auth=callback`.\n- `invalid_site_url` (400): `site_url` is not an absolute http(s) URL without query string or fragment.\n- `handoff_not_found` (404): No connect handoff matches that code.\n- `handoff_expired` (410): The connect handoff is past its expiry. Start again.\n- `handoff_used` (410): The connect handoff was already redeemed.\n- `invalid_code_verifier` (400): `code_verifier` does not match the `code_challenge` of the handoff.",
9962
+ "description": "Machine-readable error code. One HTTP status per code.\n\n- `bad_request` (400): The request is malformed. `message` says what is wrong.\n- `validation_error` (400): The body, query or path failed schema validation. `details.issues` lists each failing field.\n- `unauthorized` (401): The request carries no valid credentials.\n- `payment_required` (402): The feature is not included in the current plan.\n- `forbidden` (403): The credentials are valid but do not allow this operation.\n- `not_found` (404): The resource does not exist in this account.\n- `method_not_allowed` (405): The HTTP method is not supported on this path.\n- `conflict` (409): The request conflicts with the current state of the resource.\n- `last_sign_in_method` (409): Unlinking this account would leave the user with no way to sign in: set a password, verify the email or link another account first.\n- `payload_too_large` (413): The request body exceeds the size limit.\n- `unsupported_media_type` (415): The `Content-Type` is not accepted by this endpoint.\n- `unprocessable_entity` (422): The request is well-formed but cannot be processed.\n- `too_many_requests` (429): Rate limit exceeded. Honour the `Retry-After` header.\n- `internal_error` (500): Unexpected server error. Retry later; the request id is logged.\n- `already_exists` (400): A resource with the same unique field already exists (for a user, usually `email`). `details.fields` names the field.\n- `invalid_id` (400): The id in the path is not a valid id for this resource.\n- `account_not_found` (404): No Auth Account matches the request (domain, header or token).\n- `invalid_query` (400): The `?query=` FaableQL expression could not be parsed.\n- `search_not_supported` (400): This resource does not support `?search=`.\n- `invalid_expand` (400): An `?expand=` path is not allowed on this resource.\n- `access_denied` (403): The caller may not access this row (ownership or machine-to-machine restriction).\n- `insufficient_scope` (403): The token lacks a scope this operation requires. `message` names it.\n- `team_required` (400): An Auth Account must belong to a project (team).\n- `account_limit_reached` (409): The project already has the maximum number of Auth Accounts.\n- `invalid_project_id` (400): The project id is not of the form `project_<hex>` or `team_<hex>`.\n- `account_transfer_refused` (409): The Auth Account cannot be moved to that project. `details.blockers` lists why.\n- `email_sender_domain_not_allowed` (400): The sender address is not in a domain this platform signs email for (AUTH_EMAIL_SENDER_DOMAINS).\n- `plan_required` (402): The setting requires a higher plan. `message` says which.\n- `invalid_canonical_host` (400): `canonical_host` must be this account's own platform host or one of its verified custom domains.\n- `canonical_host_breaks_passkeys` (400): `canonical_host` is outside the account's current WebAuthn RP ID — every passkey already enrolled would stop working. Set `webauthn_rp_id` in the same request to a suffix that covers both.\n- `not_logged_in` (401): There is no signed-in session for this request.\n- `session_already_revoked` (409): The session was already revoked.\n- `invalid_token` (401): The bearer token is missing, malformed, expired or has no subject.\n- `not_owner` (403): The caller may only perform this operation on their own user.\n- `user_suspended` (403): The user is suspended and cannot sign in or be modified.\n- `invalid_credentials` (400): The email/username or password is incorrect.\n- `login_denied` (401): A post-login Action denied the sign-in. `message` carries the reason it gave. On token grants it is a 403 with `error: invalid_grant`.\n- `signup_denied` (403): A pre-signup Action or an active block denied the sign-up. `message` carries the reason.\n- `challenge_required` (428): The client's signup protection asks for a proof-of-work challenge. `details` carries it (`id`, `kind: 'pow'`, `seed`, `email_hash`, `difficulty`, `expires_at`): find a `nonce` whose sha256(`seed:email_hash:nonce`) starts with `difficulty` zero bits and repeat the request with `challenge: { id, nonce }`. @faable/auth-js >= 3.4.0 does it for you.\n- `challenge_invalid` (428): The challenge answer was not accepted: unknown, expired or already used, issued for another request, or a wrong nonce. `details` carries a fresh challenge to solve.\n- `challenge_unsupported` (403): The client's signup protection requires the challenge on every signup and this client library cannot solve it. `message` names the minimum @faable/auth-js version.\n- `origin_required` (403): This client only accepts the request from a browser: it has Allowed Web Origins and signup protection on, and the request carried no `Origin` header.\n- `client_credentials_denied` (401): An Action denied the client_credentials grant. `message` carries the reason.\n- `m2m_quota_exceeded` (402): The project used the machine-to-machine tokens its plan includes this month. Free is capped; Hobby and Pro are billed per token instead.\n- `signup_disabled` (403): Self-service sign-up is disabled on this connection.\n- `email_taken` (409): Another user in this account already uses that email.\n- `username_taken` (409): Another user of this database connection already uses that username.\n- `invalid_username` (400): The username is empty, or contains an `@` or whitespace. `message` says which.\n- `invalid_email` (400): The email address is not valid.\n- `invalid_name` (400): The name contains a link. `message` says which field.\n- `same_email` (400): The new email is the same as the current one.\n- `user_has_no_email` (400): The operation needs an email but the user has none.\n- `password_too_weak` (400): The password does not meet the connection policy. `message` lists each unmet rule.\n- `invalid_password_hash` (400): The imported password hash cannot be read, or its cost is above what a login can afford. `message` names the field.\n- `weak_password_hash` (400): The imported password hash uses a fast digest (MD5, SHA-1, SHA-2) or a cost below the minimum. `message` says which.\n- `invalid_code` (400): The verification code is wrong, expired or already used.\n- `invalid_phone` (400): The phone number is not E.164 and could not be resolved with the account default country. Include the country code.\n- `phone_changed` (400): The phone on the user changed after the code was sent. Start again.\n- `phone_already_verified` (409): The user already has a verified phone; the number cannot be swapped from the screen.\n- `sms_unavailable` (409): This account cannot send SMS right now. The suffix says why: `sms_unavailable:plan`, `:quota`, `:provider`.\n- `sms_failed` (409): The SMS provider rejected the message.\n- `invalid_state` (400): The `state` is missing, expired, or does not describe a resumable step.\n- `state_mismatch` (401): The `state` belongs to another account, session, client or ceremony.\n- `invalid_ticket` (400): The ticket does not exist or is not the kind this endpoint accepts.\n- `ticket_used` (400): The ticket was already consumed.\n- `ticket_expired` (400): The ticket is past its expiry.\n- `ticket_not_found` (404): No ticket with that id belongs to this user.\n- `credential_not_found` (404): The user has no password credential on this connection.\n- `invalid_link` (400): The magic link is malformed.\n- `expired_link` (400): The magic link token was not found or has expired.\n- `invalid_otp` (401): The one-time password is wrong or expired.\n- `invalid_client` (400): The `client_id` in the request does not name a client of this account.\n- `client_not_found` (404): No client with that `client_id`.\n- `client_mismatch` (401): The client belongs to a different account.\n- `invalid_client_metadata` (400): A client field was rejected: by dynamic client registration (RFC 7591), or on a client create/update (`initiate_login_uri`). `message` names it.\n- `invalid_connection` (400): The connection does not exist, is disabled, or is not of the type this flow needs.\n- `no_database_connection` (400): The tenant has no database connection, so there is nowhere to store a password. Create one and retry.\n- `connection_required` (400): No connection was given and the client has no `default_connection`.\n- `connection_misconfigured` (400): The connection is missing settings needed to talk to its provider.\n- `passwordless_unavailable` (400): No passwordless connection is configured or enabled for this client.\n- `ambiguous_connection` (400): Several connections match; pass `connection_id`.\n- `invalid_redirect_uri` (400): The redirect URI is not registered for the client.\n- `invalid_saml_request` (400): The SAMLRequest is missing, too large, not well-formed or not a SAML 2.0 AuthnRequest.\n- `saml_sp_mismatch` (400): The AuthnRequest does not match the client's SAML configuration: its Issuer is not the configured entity_id, or it asks for another Assertion Consumer Service URL or binding.\n- `saml_not_enabled` (404): This client does not have SAML enabled.\n- `invalid_client_jwks` (400): The client `jwks` is not a valid set of public signing keys: RSA (2048 bits or more), EC (P-256, P-384, P-521) or Ed25519, public members only, up to 5, each with a `kid` when there is more than one.\n- `client_jwks_required` (400): A client whose `token_endpoint_auth_method` is `private_key_jwt` needs public keys in `jwks`.\n- `invalid_saml_sp` (400): The `saml_sp` configuration is invalid: `acs_url` must be an absolute https URL without a fragment.\n- `origin_not_allowed` (403): The request `Origin` is not in the client's Allowed Web Origins.\n- `audience_not_found` (403): The `audience` does not name an API registered in this account.\n- `system_resource` (403): The resource is managed by Faable and cannot be modified or deleted.\n- `invalid_request` (400): A required OAuth parameter is missing or two of them are incompatible. `message` says which.\n- `invalid_device_code` (400): The device or user code is invalid or expired.\n- `provider_error` (400): The upstream identity provider returned an error. The suffix is the provider’s own code, when it sent one: `provider_error:bad_refresh_token` (the user must re-authorize), `provider_error:incorrect_client_credentials` (our configuration, the user can do nothing). `details.provider_error_description` carries the provider’s sentence.\n- `identity_already_linked` (409): That external identity is already linked to another user.\n- `identity_link_denied` (409): That external identity cannot be linked to this user.\n- `identity_conflict` (409): The user already has a linked identity for this connection.\n- `identity_orphaned` (400): The identity pointed at a user that no longer exists; it was removed. Sign in again.\n- `no_provider_token` (400): The identity holds no provider access token.\n- `no_refresh_token` (400): The identity holds no provider refresh token, so it cannot be refreshed.\n- `action_unavailable` (401): The Action that paused this login is disabled or belongs elsewhere.\n- `login_flow_misconfigured` (500): The login flow of this account cannot run. `message` carries the node error.\n- `mfa_required` (403): The login needs a second factor that this flow cannot collect, or one is still pending on the session.\n- `step_up_required` (403): Confirm an existing factor before changing your factors.\n- `reauth_required` (403): The operation needs a recent sign-in (and the second factor, when the user has one). Sign in again with `max_age=0` and retry with the new token.\n- `invalid_current_password` (400): The current password is wrong.\n- `email_not_verified` (403): The user's email is not verified, and the operation needs it to be.\n- `invalid_profile_field` (400): A profile field is not declared for this application, or its value does not match the declaration. `message` names the key.\n- `interaction_required` (403): An Action asked for a redirect on a non-interactive flow.\n- `passkey_login_disabled` (400): Sign in with a passkey is not enabled for this client.\n- `mfa_pending` (401): A second-factor challenge is pending; answer it before continuing.\n- `mfa_invalid_code` (401): The authenticator code did not verify.\n- `mfa_invalid_recovery_code` (401): The recovery code did not verify.\n- `too_many_attempts` (429): Too many wrong codes. Wait a few minutes and try again.\n- `too_many_login_attempts` (429): Too many failed sign-in attempts for this email or username from this network. Wait a few minutes and try again.\n- `totp_not_allowed` (401): This account does not accept authenticator apps.\n- `no_usable_factor` (400): The user has no confirmed second factor to challenge.\n- `factor_not_found` (400): No factor with that id belongs to this user.\n- `factor_already_confirmed` (400): The factor was already confirmed.\n- `invalid_factor` (400): The factor cannot be verified (no secret material).\n- `session_missing` (401): The session that started this login no longer exists.\n- `passkey_verification_failed` (400): The WebAuthn response could not be verified.\n- `no_passkey_enrolled` (400): The user has no passkey to sign in with.\n- `malformed_credential` (400): The WebAuthn credential is malformed.\n- `unknown_passkey` (401): The passkey is not enrolled for this user.\n- `invalid_passkey` (401): The passkey assertion did not verify.\n- `invalid_invite_url` (400): An invite's `accept_url` or `redirect_uri` is not an http(s) URL at an origin of this tenant's client callbacks or `callback_hostnames`, or it carries a fragment.\n- `invite_email_mismatch` (403): The invite is for another email address than the accepting user's. `details.invited_email` shows it masked.\n- `invite_email_unverified` (403): The accepting user's email matches the invite but is not verified yet.\n- `invite_not_found` (404): No invite with that id in this account.\n- `invite_used` (400): The invite was already accepted.\n- `already_member` (400): The user is already a member of the team.\n- `not_a_member` (404): The user is not a member of the team.\n- `consent_options_unavailable` (502): The consent screen could not load the choices from the API being authorized (its `consent_options.url`). Try again in a moment.\n- `consent_choice_invalid` (400): The choice sent with the consent decision is not one the API offered for this user.\n- `oauth21_required` (400): The tenant enforces OAuth 2.1 (`oauth21_enabled`) and the request is one OAuth 2.1 removed: a `response_type` other than `code`, an authorization request without PKCE (`code_challenge` with `S256`), or the password grant. `message` says which. Update the application (with `@faable/auth-js`, version 3.1.0 or later) or turn `oauth21_enabled` off for the tenant.\n- `registration_disabled` (403): Dynamic client registration is turned off for this tenant. Create the client from the dashboard or the Management API, or turn on `dynamic_client_registration_enabled`.\n- `invalid_email_domain` (400): Not an email domain this organization can claim: it must be a plain domain name (`acme.com`), lowercase, without scheme, path or wildcard.\n- `public_email_domain` (400): A public email provider (gmail.com, outlook.com…) cannot belong to an organization: anyone can have an address there.\n- `organization_domain_not_found` (404): The organization has no such domain.\n- `organization_domain_taken` (409): Another organization of this tenant already verified this domain. A domain belongs to one organization.\n- `organization_domain_unverified` (400): The TXT record was not found or does not hold the expected value yet. `details.record` says what was expected and what resolves now; DNS can take a few minutes to propagate.\n- `plan_unavailable` (503): The plan could not be checked right now, and this setting is only for paid plans. Try again in a minute.\n- `organization_domain_mismatch` (403): This organization's identity provider can only sign in addresses of the organization's verified email domains.\n- `team_not_in_organization` (400): Auto-join can only put people in teams of the same organization. `details.teams` lists the others.\n- `organization_has_no_idp` (400): Requiring SSO needs an identity provider: bind an `oidc` connection to the organization first.\n- `organization_not_found` (404): No organization with that id in this account.\n- `invalid_user` (400): The user does not exist in this account.\n- `not_an_organization_admin` (404): The user is not an admin of the organization.\n- `last_organization_admin` (409): An organization keeps at least one admin. Add another admin before removing this one.\n- `team_id_unavailable` (409): The team id cannot be used in this tenant. Pick another id or let the API generate one.\n- `use_team_member_route` (400): This generic route cannot create memberships. Use `POST /team/{team_id}/member` for team members or `POST /role/{role_id}/users` for role grants.\n- `role_not_found` (404): No role with that id in this account.\n- `invalid_role` (400): The role belongs to another account.\n- `invalid_permission` (400): A permission is not in the catalog of its Api, or the Api is not in this account. `details.permissions` lists the ones refused.\n- `flow_not_found` (400): The login flow does not exist in this account.\n- `revision_not_found` (404): The revision is not in the flow history.\n- `invalid_webhook_event` (400): An event is not in the webhook event catalog. `message` and `details.valid_events` list the valid ones.\n- `invalid_webhook_url` (400): The webhook URL must be an absolute `https` URL.\n- `not_a_webhook` (400): The operation only applies to `webhook` subscriptions.\n- `delivery_not_found` (404): No webhook delivery with that id for this subscription.\n- `delivery_in_progress` (409): The delivery is being attempted right now; retry the redeliver in a minute.\n- `account_mismatch` (400): The `account_id` in the body is not the account the request is scoped to (`x-faableauth-account`).\n- `connect_redirect_uri_missing` (400): The client's callbacks do not include `<site_url>/wp-login.php?faable-auth=callback`.\n- `invalid_site_url` (400): `site_url` is not an absolute http(s) URL without query string or fragment.\n- `handoff_not_found` (404): No connect handoff matches that code.\n- `handoff_expired` (410): The connect handoff is past its expiry. Start again.\n- `handoff_used` (410): The connect handoff was already redeemed.\n- `invalid_code_verifier` (400): `code_verifier` does not match the `code_challenge` of the handoff.",
9894
9963
  "enum": [
9895
9964
  "bad_request",
9896
9965
  "validation_error",
@@ -9930,6 +9999,10 @@
9930
9999
  "invalid_credentials",
9931
10000
  "login_denied",
9932
10001
  "signup_denied",
10002
+ "challenge_required",
10003
+ "challenge_invalid",
10004
+ "challenge_unsupported",
10005
+ "origin_required",
9933
10006
  "client_credentials_denied",
9934
10007
  "m2m_quota_exceeded",
9935
10008
  "signup_disabled",
@@ -21077,6 +21150,29 @@
21077
21150
  "initiate_login_uri": {
21078
21151
  "type": "string"
21079
21152
  },
21153
+ "signup_protection": {
21154
+ "anyOf": [
21155
+ {
21156
+ "type": "string",
21157
+ "enum": [
21158
+ "off"
21159
+ ]
21160
+ },
21161
+ {
21162
+ "type": "string",
21163
+ "enum": [
21164
+ "on_risk"
21165
+ ]
21166
+ },
21167
+ {
21168
+ "type": "string",
21169
+ "enum": [
21170
+ "always"
21171
+ ]
21172
+ }
21173
+ ],
21174
+ "description": "Bot protection for this client's signups and passwordless codes: `off` (Actions only), `on_risk` (a proof-of-work challenge when the request looks risky) or `always` (every signup solves it; clients that cannot are refused). New clients start at `on_risk`."
21175
+ },
21080
21176
  "grant_types": {
21081
21177
  "type": "array",
21082
21178
  "items": {
@@ -21629,6 +21725,29 @@
21629
21725
  "additionalProperties": false,
21630
21726
  "description": "Second-factor policy. Set on the Account as the tenant default; the same object on a Client overrides it **field by field**, so one app can require MFA without changing the rest."
21631
21727
  },
21728
+ "signup_protection": {
21729
+ "anyOf": [
21730
+ {
21731
+ "type": "string",
21732
+ "enum": [
21733
+ "off"
21734
+ ]
21735
+ },
21736
+ {
21737
+ "type": "string",
21738
+ "enum": [
21739
+ "on_risk"
21740
+ ]
21741
+ },
21742
+ {
21743
+ "type": "string",
21744
+ "enum": [
21745
+ "always"
21746
+ ]
21747
+ }
21748
+ ],
21749
+ "description": "Bot protection for this client's signups and passwordless codes: `off` (Actions only), `on_risk` (a proof-of-work challenge when the request looks risky) or `always` (every signup solves it; clients that cannot are refused). New clients start at `on_risk`."
21750
+ },
21632
21751
  "recovery_channels": {
21633
21752
  "type": "object",
21634
21753
  "properties": {
@@ -22524,6 +22643,29 @@
22524
22643
  "additionalProperties": false,
22525
22644
  "description": "Second-factor policy. Set on the Account as the tenant default; the same object on a Client overrides it **field by field**, so one app can require MFA without changing the rest."
22526
22645
  },
22646
+ "signup_protection": {
22647
+ "anyOf": [
22648
+ {
22649
+ "type": "string",
22650
+ "enum": [
22651
+ "off"
22652
+ ]
22653
+ },
22654
+ {
22655
+ "type": "string",
22656
+ "enum": [
22657
+ "on_risk"
22658
+ ]
22659
+ },
22660
+ {
22661
+ "type": "string",
22662
+ "enum": [
22663
+ "always"
22664
+ ]
22665
+ }
22666
+ ],
22667
+ "description": "Bot protection for this client's signups and passwordless codes: `off` (Actions only), `on_risk` (a proof-of-work challenge when the request looks risky) or `always` (every signup solves it; clients that cannot are refused). New clients start at `on_risk`."
22668
+ },
22527
22669
  "recovery_channels": {
22528
22670
  "type": "object",
22529
22671
  "properties": {
@@ -23425,6 +23567,29 @@
23425
23567
  }
23426
23568
  ]
23427
23569
  },
23570
+ "signup_protection": {
23571
+ "anyOf": [
23572
+ {
23573
+ "type": "string",
23574
+ "enum": [
23575
+ "off"
23576
+ ]
23577
+ },
23578
+ {
23579
+ "type": "string",
23580
+ "enum": [
23581
+ "on_risk"
23582
+ ]
23583
+ },
23584
+ {
23585
+ "type": "string",
23586
+ "enum": [
23587
+ "always"
23588
+ ]
23589
+ }
23590
+ ],
23591
+ "description": "Bot protection for this client's signups and passwordless codes: `off` (Actions only), `on_risk` (a proof-of-work challenge when the request looks risky) or `always` (every signup solves it; clients that cannot are refused). New clients start at `on_risk`."
23592
+ },
23428
23593
  "recovery_channels": {
23429
23594
  "anyOf": [
23430
23595
  {
@@ -24159,6 +24324,29 @@
24159
24324
  "additionalProperties": false,
24160
24325
  "description": "Second-factor policy. Set on the Account as the tenant default; the same object on a Client overrides it **field by field**, so one app can require MFA without changing the rest."
24161
24326
  },
24327
+ "signup_protection": {
24328
+ "anyOf": [
24329
+ {
24330
+ "type": "string",
24331
+ "enum": [
24332
+ "off"
24333
+ ]
24334
+ },
24335
+ {
24336
+ "type": "string",
24337
+ "enum": [
24338
+ "on_risk"
24339
+ ]
24340
+ },
24341
+ {
24342
+ "type": "string",
24343
+ "enum": [
24344
+ "always"
24345
+ ]
24346
+ }
24347
+ ],
24348
+ "description": "Bot protection for this client's signups and passwordless codes: `off` (Actions only), `on_risk` (a proof-of-work challenge when the request looks risky) or `always` (every signup solves it; clients that cannot are refused). New clients start at `on_risk`."
24349
+ },
24162
24350
  "recovery_channels": {
24163
24351
  "type": "object",
24164
24352
  "properties": {
@@ -25054,6 +25242,29 @@
25054
25242
  "additionalProperties": false,
25055
25243
  "description": "Second-factor policy. Set on the Account as the tenant default; the same object on a Client overrides it **field by field**, so one app can require MFA without changing the rest."
25056
25244
  },
25245
+ "signup_protection": {
25246
+ "anyOf": [
25247
+ {
25248
+ "type": "string",
25249
+ "enum": [
25250
+ "off"
25251
+ ]
25252
+ },
25253
+ {
25254
+ "type": "string",
25255
+ "enum": [
25256
+ "on_risk"
25257
+ ]
25258
+ },
25259
+ {
25260
+ "type": "string",
25261
+ "enum": [
25262
+ "always"
25263
+ ]
25264
+ }
25265
+ ],
25266
+ "description": "Bot protection for this client's signups and passwordless codes: `off` (Actions only), `on_risk` (a proof-of-work challenge when the request looks risky) or `always` (every signup solves it; clients that cannot are refused). New clients start at `on_risk`."
25267
+ },
25057
25268
  "recovery_channels": {
25058
25269
  "type": "object",
25059
25270
  "properties": {
@@ -25950,6 +26161,29 @@
25950
26161
  "additionalProperties": false,
25951
26162
  "description": "Second-factor policy. Set on the Account as the tenant default; the same object on a Client overrides it **field by field**, so one app can require MFA without changing the rest."
25952
26163
  },
26164
+ "signup_protection": {
26165
+ "anyOf": [
26166
+ {
26167
+ "type": "string",
26168
+ "enum": [
26169
+ "off"
26170
+ ]
26171
+ },
26172
+ {
26173
+ "type": "string",
26174
+ "enum": [
26175
+ "on_risk"
26176
+ ]
26177
+ },
26178
+ {
26179
+ "type": "string",
26180
+ "enum": [
26181
+ "always"
26182
+ ]
26183
+ }
26184
+ ],
26185
+ "description": "Bot protection for this client's signups and passwordless codes: `off` (Actions only), `on_risk` (a proof-of-work challenge when the request looks risky) or `always` (every signup solves it; clients that cannot are refused). New clients start at `on_risk`."
26186
+ },
25953
26187
  "recovery_channels": {
25954
26188
  "type": "object",
25955
26189
  "properties": {
@@ -70053,6 +70287,24 @@
70053
70287
  "state": {
70054
70288
  "type": "string",
70055
70289
  "description": "The login's key from `/authorize` — the hosted screen's `?state=`. Only ties the code this start issues to that login for tracing; it is not consumed and never rejects the request (`/passwordless/verify_code` is the step that uses it)."
70290
+ },
70291
+ "challenge": {
70292
+ "type": "object",
70293
+ "required": [
70294
+ "id",
70295
+ "nonce"
70296
+ ],
70297
+ "properties": {
70298
+ "id": {
70299
+ "type": "string",
70300
+ "maxLength": 64
70301
+ },
70302
+ "nonce": {
70303
+ "type": "string",
70304
+ "maxLength": 64
70305
+ }
70306
+ },
70307
+ "description": "Answer to a `challenge_required`: the challenge `id` and the `nonce` found. @faable/auth-js >= 3.4.0 fills it in."
70056
70308
  }
70057
70309
  }
70058
70310
  }
@@ -70094,7 +70346,7 @@
70094
70346
  }
70095
70347
  },
70096
70348
  "403": {
70097
- "description": "`origin_not_allowed` — The request `Origin` is not in the client's Allowed Web Origins.\n\n`signup_denied` — A pre-signup Action or an active block denied the sign-up. `message` carries the reason.",
70349
+ "description": "`challenge_unsupported` — The client's signup protection requires the challenge on every signup and this client library cannot solve it. `message` names the minimum @faable/auth-js version.\n\n`origin_required` — This client only accepts the request from a browser: it has Allowed Web Origins and signup protection on, and the request carried no `Origin` header.\n\n`origin_not_allowed` — The request `Origin` is not in the client's Allowed Web Origins.\n\n`signup_denied` — A pre-signup Action or an active block denied the sign-up. `message` carries the reason.",
70098
70350
  "content": {
70099
70351
  "application/json": {
70100
70352
  "schema": {
@@ -70108,6 +70360,8 @@
70108
70360
  "error_code": {
70109
70361
  "type": "string",
70110
70362
  "enum": [
70363
+ "challenge_unsupported",
70364
+ "origin_required",
70111
70365
  "origin_not_allowed",
70112
70366
  "signup_denied"
70113
70367
  ]
@@ -70144,6 +70398,32 @@
70144
70398
  }
70145
70399
  }
70146
70400
  },
70401
+ "428": {
70402
+ "description": "`challenge_invalid` — The challenge answer was not accepted: unknown, expired or already used, issued for another request, or a wrong nonce. `details` carries a fresh challenge to solve.\n\n`challenge_required` — The client's signup protection asks for a proof-of-work challenge. `details` carries it (`id`, `kind: 'pow'`, `seed`, `email_hash`, `difficulty`, `expires_at`): find a `nonce` whose sha256(`seed:email_hash:nonce`) starts with `difficulty` zero bits and repeat the request with `challenge: { id, nonce }`. @faable/auth-js >= 3.4.0 does it for you.",
70403
+ "content": {
70404
+ "application/json": {
70405
+ "schema": {
70406
+ "allOf": [
70407
+ {
70408
+ "$ref": "#/components/schemas/ErrorResponse"
70409
+ },
70410
+ {
70411
+ "type": "object",
70412
+ "properties": {
70413
+ "error_code": {
70414
+ "type": "string",
70415
+ "enum": [
70416
+ "challenge_invalid",
70417
+ "challenge_required"
70418
+ ]
70419
+ }
70420
+ }
70421
+ }
70422
+ ]
70423
+ }
70424
+ }
70425
+ }
70426
+ },
70147
70427
  "429": {
70148
70428
  "description": "`too_many_requests` — Rate limit exceeded. Honour the `Retry-After` header.",
70149
70429
  "content": {
@@ -82871,6 +83151,28 @@
82871
83151
  "connection": {
82872
83152
  "type": "string",
82873
83153
  "description": "Optional connection_name to disambiguate when the tenant has more than one database connection. Defaults to the tenant database connection."
83154
+ },
83155
+ "client_id": {
83156
+ "type": "string",
83157
+ "description": "The application's Client ID. auth-js sends it. When it names a client of the tenant, that client's Allowed Web Origins and signup protection apply; an unknown or missing one is accepted (as before) and recorded."
83158
+ },
83159
+ "challenge": {
83160
+ "type": "object",
83161
+ "required": [
83162
+ "id",
83163
+ "nonce"
83164
+ ],
83165
+ "properties": {
83166
+ "id": {
83167
+ "type": "string",
83168
+ "maxLength": 64
83169
+ },
83170
+ "nonce": {
83171
+ "type": "string",
83172
+ "maxLength": 64
83173
+ }
83174
+ },
83175
+ "description": "Answer to a `challenge_required`: the challenge `id` and the `nonce` found. @faable/auth-js >= 3.4.0 fills it in."
82874
83176
  }
82875
83177
  },
82876
83178
  "additionalProperties": false
@@ -82912,7 +83214,7 @@
82912
83214
  }
82913
83215
  },
82914
83216
  "403": {
82915
- "description": "`signup_denied` — A pre-signup Action or an active block denied the sign-up. `message` carries the reason.\n\n`signup_disabled` — Self-service sign-up is disabled on this connection.",
83217
+ "description": "`challenge_unsupported` — The client's signup protection requires the challenge on every signup and this client library cannot solve it. `message` names the minimum @faable/auth-js version.\n\n`origin_required` — This client only accepts the request from a browser: it has Allowed Web Origins and signup protection on, and the request carried no `Origin` header.\n\n`origin_not_allowed` — The request `Origin` is not in the client's Allowed Web Origins.\n\n`signup_denied` — A pre-signup Action or an active block denied the sign-up. `message` carries the reason.\n\n`signup_disabled` — Self-service sign-up is disabled on this connection.",
82916
83218
  "content": {
82917
83219
  "application/json": {
82918
83220
  "schema": {
@@ -82926,6 +83228,9 @@
82926
83228
  "error_code": {
82927
83229
  "type": "string",
82928
83230
  "enum": [
83231
+ "challenge_unsupported",
83232
+ "origin_required",
83233
+ "origin_not_allowed",
82929
83234
  "signup_denied",
82930
83235
  "signup_disabled"
82931
83236
  ]
@@ -82988,6 +83293,32 @@
82988
83293
  }
82989
83294
  }
82990
83295
  },
83296
+ "428": {
83297
+ "description": "`challenge_invalid` — The challenge answer was not accepted: unknown, expired or already used, issued for another request, or a wrong nonce. `details` carries a fresh challenge to solve.\n\n`challenge_required` — The client's signup protection asks for a proof-of-work challenge. `details` carries it (`id`, `kind: 'pow'`, `seed`, `email_hash`, `difficulty`, `expires_at`): find a `nonce` whose sha256(`seed:email_hash:nonce`) starts with `difficulty` zero bits and repeat the request with `challenge: { id, nonce }`. @faable/auth-js >= 3.4.0 does it for you.",
83298
+ "content": {
83299
+ "application/json": {
83300
+ "schema": {
83301
+ "allOf": [
83302
+ {
83303
+ "$ref": "#/components/schemas/ErrorResponse"
83304
+ },
83305
+ {
83306
+ "type": "object",
83307
+ "properties": {
83308
+ "error_code": {
83309
+ "type": "string",
83310
+ "enum": [
83311
+ "challenge_invalid",
83312
+ "challenge_required"
83313
+ ]
83314
+ }
83315
+ }
83316
+ }
83317
+ ]
83318
+ }
83319
+ }
83320
+ }
83321
+ },
82991
83322
  "429": {
82992
83323
  "description": "`too_many_requests` — Rate limit exceeded. Honour the `Retry-After` header.",
82993
83324
  "content": {