zyphr 0.1.65 → 0.1.67
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.
- checksums.yaml +4 -4
- data/docs/AuthEmailTemplatesApi.md +1 -1
- data/docs/AuthMagicLinksApi.md +1 -1
- data/docs/AuthUserDirectoryApi.md +1 -1
- data/docs/BulkUpsertAuthEmailTemplatesRequest.md +5 -1
- data/docs/InviteEndUser200ResponseData.md +2 -2
- data/docs/MagicLinkVerifyResponseData.md +4 -0
- data/lib/zyphr/api/auth_email_templates_api.rb +2 -2
- data/lib/zyphr/api/auth_magic_links_api.rb +2 -2
- data/lib/zyphr/api/auth_user_directory_api.rb +2 -2
- data/lib/zyphr/models/auth_email_type.rb +3 -1
- data/lib/zyphr/models/bulk_upsert_auth_email_templates_request.rb +23 -5
- data/lib/zyphr/models/invite_end_user200_response_data.rb +2 -2
- data/lib/zyphr/models/invite_end_user_request.rb +2 -2
- data/lib/zyphr/models/magic_link_verify_response_data.rb +20 -2
- data/spec/api/auth_email_templates_api_spec.rb +1 -1
- data/spec/api/auth_magic_links_api_spec.rb +1 -1
- data/spec/api/auth_user_directory_api_spec.rb +1 -1
- data/spec/models/bulk_upsert_auth_email_templates_request_spec.rb +12 -0
- data/spec/models/invite_end_user_request_spec.rb +1 -1
- data/spec/models/magic_link_verify_response_data_spec.rb +12 -0
- data/zyphr.gemspec +1 -1
- metadata +499 -499
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fdc21ac68755d4d99a8bbb674bd1c8800983400238aadb050a1e01879c4268df
|
|
4
|
+
data.tar.gz: ff4ce43f126392339b452107bf3bdda1843df6f4140b45b8b74af7d6055b145a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f9925dd6534471523e92d43430e300979fa3f7983328f6bf6c03bbf518de284ec323db3152fd518e6420f7f50c125f0524d81bdecd24cb0d30cecdd86c63e509
|
|
7
|
+
data.tar.gz: 14bc44775a7b816c94a537f2fba2db2367b4bf5169d23c9113dbd428d30e3f17f0526fdff886e65cfcfb0a8d6e64d084526fea3bc0eec6dba4c3b15384f8e3ce
|
|
@@ -22,7 +22,7 @@ All URIs are relative to *https://api.zyphr.dev/v1*
|
|
|
22
22
|
|
|
23
23
|
Bulk-upsert auth email templates
|
|
24
24
|
|
|
25
|
-
Atomic upsert of any subset of magic_link, password_reset, email_verification. Validates all inputs before any write; if any one fails validation or MJML compile, none are saved. Designed for one-shot migration imports from Auth0/Firebase/Clerk/Cognito.
|
|
25
|
+
Atomic upsert of any subset of magic_link, password_reset, email_verification, email_otp, invitation. Validates all inputs before any write; if any one fails validation or MJML compile, none are saved. Designed for one-shot migration imports from Auth0/Firebase/Clerk/Cognito.
|
|
26
26
|
|
|
27
27
|
### Examples
|
|
28
28
|
|
data/docs/AuthMagicLinksApi.md
CHANGED
|
@@ -90,7 +90,7 @@ end
|
|
|
90
90
|
|
|
91
91
|
Verify a magic link
|
|
92
92
|
|
|
93
|
-
Verify a magic link token and authenticate the user. Returns auth result with is_new_user flag.
|
|
93
|
+
Verify a magic link token and authenticate the user. Returns auth result with is_new_user flag. A magic link is a single factor, so a user who has enrolled MFA gets `mfa_required: true` and an `mfa_challenge` instead of tokens; complete the login with the challenge token at `POST /auth/mfa/verify`, exactly as after password login.
|
|
94
94
|
|
|
95
95
|
### Examples
|
|
96
96
|
|
|
@@ -400,7 +400,7 @@ end
|
|
|
400
400
|
|
|
401
401
|
Pre-provision (invite) an end user (server-side admin)
|
|
402
402
|
|
|
403
|
-
Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when `send_link` is set, sends a first-login link so the user can set up their account without self-registration. - `send_link: \"
|
|
403
|
+
Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when `send_link` is set, sends a first-login link so the user can set up their account without self-registration. - `send_link: \"invitation\"` sends the `invitation` auth email: a set-password link (valid 7 days) redeemed at `POST /auth/reset-password`, so the invitee ends up with a password. It has its own per-application template, separate from password reset's. Not sent to an identity that can already sign in. - `send_link: \"password_reset\"` sends a set-password email using the password-reset template. - `send_link: \"magic\"` sends a magic-link sign-in email. The user still has no credential afterwards. - `send_link: \"none\"` (default) creates the user with no email. A `redirect_url` is required whenever `send_link` is not \"none\"; it must match the application's redirect_uris allowlist (custom schemes such as yourapp://path are permitted).
|
|
404
404
|
|
|
405
405
|
### Examples
|
|
406
406
|
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
| **magic_link** | [**UpsertAuthEmailTemplateRequest**](UpsertAuthEmailTemplateRequest.md) | | [optional] |
|
|
8
8
|
| **password_reset** | [**UpsertAuthEmailTemplateRequest**](UpsertAuthEmailTemplateRequest.md) | | [optional] |
|
|
9
9
|
| **email_verification** | [**UpsertAuthEmailTemplateRequest**](UpsertAuthEmailTemplateRequest.md) | | [optional] |
|
|
10
|
+
| **email_otp** | [**UpsertAuthEmailTemplateRequest**](UpsertAuthEmailTemplateRequest.md) | | [optional] |
|
|
11
|
+
| **invitation** | [**UpsertAuthEmailTemplateRequest**](UpsertAuthEmailTemplateRequest.md) | | [optional] |
|
|
10
12
|
|
|
11
13
|
## Example
|
|
12
14
|
|
|
@@ -16,7 +18,9 @@ require 'zyphr'
|
|
|
16
18
|
instance = Zyphr::BulkUpsertAuthEmailTemplatesRequest.new(
|
|
17
19
|
magic_link: null,
|
|
18
20
|
password_reset: null,
|
|
19
|
-
email_verification: null
|
|
21
|
+
email_verification: null,
|
|
22
|
+
email_otp: null,
|
|
23
|
+
invitation: null
|
|
20
24
|
)
|
|
21
25
|
```
|
|
22
26
|
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **user_id** | **String** | | [optional] |
|
|
8
8
|
| **created** | **Boolean** | True when a new user was provisioned; false when an existing user was reused (idempotent on email). | [optional] |
|
|
9
|
-
| **link_sent** | **Boolean** | True when
|
|
10
|
-
| **link_suppressed_reason** | **String** | Present only when `send_link` was requested and `link_sent` is false — explains why, so a caller can distinguish \"suppressed by design\" from \"delivery failed\". Known values: - `identity_has_other_auth_methods` — the identity has no password but does have a linked OAuth provider and/or a passkey, so it is not locked out and no set-password link is sent. The attempt is recorded as a suppressed message, visible via `GET /emails`. - `user_not_found_in_environment` — the identity could not be resolved in the calling environment (a race; it was created or resolved immediately prior). - `recipient_not_allowlisted` — the application's `test_recipients` allowlist blocked the recipient. - `send_failed` — dispatch was attempted and failed with no more specific code. Not a closed set: a mail-provider error code may be surfaced verbatim, so treat an unrecognised value as a generic failure rather than an error. | [optional] |
|
|
9
|
+
| **link_sent** | **Boolean** | True when the requested invitation, magic-link or password-reset email was successfully dispatched. | [optional] |
|
|
10
|
+
| **link_suppressed_reason** | **String** | Present only when `send_link` was requested and `link_sent` is false — explains why, so a caller can distinguish \"suppressed by design\" from \"delivery failed\". Known values: - `identity_has_other_auth_methods` — the identity has no password but does have a linked OAuth provider and/or a passkey, so it is not locked out and no set-password link is sent. The attempt is recorded as a suppressed message, visible via `GET /emails`. (For `send_link: \"invitation\"` the reason is returned here only; no suppressed message is recorded.) - `user_has_password` — `send_link: \"invitation\"` only: the identity already has a password, so there is nothing to accept. Use `password_reset` to send a reset. - `user_not_found_in_environment` — the identity could not be resolved in the calling environment (a race; it was created or resolved immediately prior). - `recipient_not_allowlisted` — the application's `test_recipients` allowlist blocked the recipient. - `send_failed` — dispatch was attempted and failed with no more specific code. Not a closed set: a mail-provider error code may be surfaced verbatim, so treat an unrecognised value as a generic failure rather than an error. | [optional] |
|
|
11
11
|
|
|
12
12
|
## Example
|
|
13
13
|
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **mfa_required** | **Boolean** | | [optional] |
|
|
7
8
|
| **user** | [**AuthUser**](AuthUser.md) | | [optional] |
|
|
8
9
|
| **tokens** | [**AuthTokens**](AuthTokens.md) | | [optional] |
|
|
10
|
+
| **mfa_challenge** | [**AuthLoginResultMfaChallenge**](AuthLoginResultMfaChallenge.md) | | [optional] |
|
|
9
11
|
| **is_new_user** | **Boolean** | | [optional] |
|
|
10
12
|
|
|
11
13
|
## Example
|
|
@@ -14,8 +16,10 @@
|
|
|
14
16
|
require 'zyphr'
|
|
15
17
|
|
|
16
18
|
instance = Zyphr::MagicLinkVerifyResponseData.new(
|
|
19
|
+
mfa_required: null,
|
|
17
20
|
user: null,
|
|
18
21
|
tokens: null,
|
|
22
|
+
mfa_challenge: null,
|
|
19
23
|
is_new_user: null
|
|
20
24
|
)
|
|
21
25
|
```
|
|
@@ -20,7 +20,7 @@ module Zyphr
|
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
22
|
# Bulk-upsert auth email templates
|
|
23
|
-
# Atomic upsert of any subset of magic_link, password_reset, email_verification. Validates all inputs before any write; if any one fails validation or MJML compile, none are saved. Designed for one-shot migration imports from Auth0/Firebase/Clerk/Cognito.
|
|
23
|
+
# Atomic upsert of any subset of magic_link, password_reset, email_verification, email_otp, invitation. Validates all inputs before any write; if any one fails validation or MJML compile, none are saved. Designed for one-shot migration imports from Auth0/Firebase/Clerk/Cognito.
|
|
24
24
|
# @param bulk_upsert_auth_email_templates_request [BulkUpsertAuthEmailTemplatesRequest]
|
|
25
25
|
# @param [Hash] opts the optional parameters
|
|
26
26
|
# @return [BulkUpsertAuthEmailTemplatesResponse]
|
|
@@ -30,7 +30,7 @@ module Zyphr
|
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
# Bulk-upsert auth email templates
|
|
33
|
-
# Atomic upsert of any subset of magic_link, password_reset, email_verification. Validates all inputs before any write; if any one fails validation or MJML compile, none are saved. Designed for one-shot migration imports from Auth0/Firebase/Clerk/Cognito.
|
|
33
|
+
# Atomic upsert of any subset of magic_link, password_reset, email_verification, email_otp, invitation. Validates all inputs before any write; if any one fails validation or MJML compile, none are saved. Designed for one-shot migration imports from Auth0/Firebase/Clerk/Cognito.
|
|
34
34
|
# @param bulk_upsert_auth_email_templates_request [BulkUpsertAuthEmailTemplatesRequest]
|
|
35
35
|
# @param [Hash] opts the optional parameters
|
|
36
36
|
# @return [Array<(BulkUpsertAuthEmailTemplatesResponse, Integer, Hash)>] BulkUpsertAuthEmailTemplatesResponse data, response status code and response headers
|
|
@@ -88,7 +88,7 @@ module Zyphr
|
|
|
88
88
|
end
|
|
89
89
|
|
|
90
90
|
# Verify a magic link
|
|
91
|
-
# Verify a magic link token and authenticate the user. Returns auth result with is_new_user flag.
|
|
91
|
+
# Verify a magic link token and authenticate the user. Returns auth result with is_new_user flag. A magic link is a single factor, so a user who has enrolled MFA gets `mfa_required: true` and an `mfa_challenge` instead of tokens; complete the login with the challenge token at `POST /auth/mfa/verify`, exactly as after password login.
|
|
92
92
|
# @param magic_link_verify_request [MagicLinkVerifyRequest]
|
|
93
93
|
# @param [Hash] opts the optional parameters
|
|
94
94
|
# @return [MagicLinkVerifyResponse]
|
|
@@ -98,7 +98,7 @@ module Zyphr
|
|
|
98
98
|
end
|
|
99
99
|
|
|
100
100
|
# Verify a magic link
|
|
101
|
-
# Verify a magic link token and authenticate the user. Returns auth result with is_new_user flag.
|
|
101
|
+
# Verify a magic link token and authenticate the user. Returns auth result with is_new_user flag. A magic link is a single factor, so a user who has enrolled MFA gets `mfa_required: true` and an `mfa_challenge` instead of tokens; complete the login with the challenge token at `POST /auth/mfa/verify`, exactly as after password login.
|
|
102
102
|
# @param magic_link_verify_request [MagicLinkVerifyRequest]
|
|
103
103
|
# @param [Hash] opts the optional parameters
|
|
104
104
|
# @return [Array<(MagicLinkVerifyResponse, Integer, Hash)>] MagicLinkVerifyResponse data, response status code and response headers
|
|
@@ -334,7 +334,7 @@ module Zyphr
|
|
|
334
334
|
end
|
|
335
335
|
|
|
336
336
|
# Pre-provision (invite) an end user (server-side admin)
|
|
337
|
-
# Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when `send_link` is set, sends a first-login link so the user can set up their account without self-registration. - `send_link: \"
|
|
337
|
+
# Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when `send_link` is set, sends a first-login link so the user can set up their account without self-registration. - `send_link: \"invitation\"` sends the `invitation` auth email: a set-password link (valid 7 days) redeemed at `POST /auth/reset-password`, so the invitee ends up with a password. It has its own per-application template, separate from password reset's. Not sent to an identity that can already sign in. - `send_link: \"password_reset\"` sends a set-password email using the password-reset template. - `send_link: \"magic\"` sends a magic-link sign-in email. The user still has no credential afterwards. - `send_link: \"none\"` (default) creates the user with no email. A `redirect_url` is required whenever `send_link` is not \"none\"; it must match the application's redirect_uris allowlist (custom schemes such as yourapp://path are permitted).
|
|
338
338
|
# @param invite_end_user_request [InviteEndUserRequest]
|
|
339
339
|
# @param [Hash] opts the optional parameters
|
|
340
340
|
# @return [InviteEndUser200Response]
|
|
@@ -344,7 +344,7 @@ module Zyphr
|
|
|
344
344
|
end
|
|
345
345
|
|
|
346
346
|
# Pre-provision (invite) an end user (server-side admin)
|
|
347
|
-
# Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when `send_link` is set, sends a first-login link so the user can set up their account without self-registration. - `send_link: \"
|
|
347
|
+
# Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when `send_link` is set, sends a first-login link so the user can set up their account without self-registration. - `send_link: \"invitation\"` sends the `invitation` auth email: a set-password link (valid 7 days) redeemed at `POST /auth/reset-password`, so the invitee ends up with a password. It has its own per-application template, separate from password reset's. Not sent to an identity that can already sign in. - `send_link: \"password_reset\"` sends a set-password email using the password-reset template. - `send_link: \"magic\"` sends a magic-link sign-in email. The user still has no credential afterwards. - `send_link: \"none\"` (default) creates the user with no email. A `redirect_url` is required whenever `send_link` is not \"none\"; it must match the application's redirect_uris allowlist (custom schemes such as yourapp://path are permitted).
|
|
348
348
|
# @param invite_end_user_request [InviteEndUserRequest]
|
|
349
349
|
# @param [Hash] opts the optional parameters
|
|
350
350
|
# @return [Array<(InviteEndUser200Response, Integer, Hash)>] InviteEndUser200Response data, response status code and response headers
|
|
@@ -18,9 +18,11 @@ module Zyphr
|
|
|
18
18
|
MAGIC_LINK = "magic_link".freeze
|
|
19
19
|
PASSWORD_RESET = "password_reset".freeze
|
|
20
20
|
EMAIL_VERIFICATION = "email_verification".freeze
|
|
21
|
+
EMAIL_OTP = "email_otp".freeze
|
|
22
|
+
INVITATION = "invitation".freeze
|
|
21
23
|
|
|
22
24
|
def self.all_vars
|
|
23
|
-
@all_vars ||= [MAGIC_LINK, PASSWORD_RESET, EMAIL_VERIFICATION].freeze
|
|
25
|
+
@all_vars ||= [MAGIC_LINK, PASSWORD_RESET, EMAIL_VERIFICATION, EMAIL_OTP, INVITATION].freeze
|
|
24
26
|
end
|
|
25
27
|
|
|
26
28
|
# Builds the enum from string
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Zyphr
|
|
17
|
-
# Atomic upsert of any subset of magic_link, password_reset, email_verification. At least one entry must be provided.
|
|
17
|
+
# Atomic upsert of any subset of magic_link, password_reset, email_verification, email_otp, invitation. At least one entry must be provided.
|
|
18
18
|
class BulkUpsertAuthEmailTemplatesRequest
|
|
19
19
|
attr_accessor :magic_link
|
|
20
20
|
|
|
@@ -22,12 +22,18 @@ module Zyphr
|
|
|
22
22
|
|
|
23
23
|
attr_accessor :email_verification
|
|
24
24
|
|
|
25
|
+
attr_accessor :email_otp
|
|
26
|
+
|
|
27
|
+
attr_accessor :invitation
|
|
28
|
+
|
|
25
29
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
26
30
|
def self.attribute_map
|
|
27
31
|
{
|
|
28
32
|
:'magic_link' => :'magic_link',
|
|
29
33
|
:'password_reset' => :'password_reset',
|
|
30
|
-
:'email_verification' => :'email_verification'
|
|
34
|
+
:'email_verification' => :'email_verification',
|
|
35
|
+
:'email_otp' => :'email_otp',
|
|
36
|
+
:'invitation' => :'invitation'
|
|
31
37
|
}
|
|
32
38
|
end
|
|
33
39
|
|
|
@@ -46,7 +52,9 @@ module Zyphr
|
|
|
46
52
|
{
|
|
47
53
|
:'magic_link' => :'UpsertAuthEmailTemplateRequest',
|
|
48
54
|
:'password_reset' => :'UpsertAuthEmailTemplateRequest',
|
|
49
|
-
:'email_verification' => :'UpsertAuthEmailTemplateRequest'
|
|
55
|
+
:'email_verification' => :'UpsertAuthEmailTemplateRequest',
|
|
56
|
+
:'email_otp' => :'UpsertAuthEmailTemplateRequest',
|
|
57
|
+
:'invitation' => :'UpsertAuthEmailTemplateRequest'
|
|
50
58
|
}
|
|
51
59
|
end
|
|
52
60
|
|
|
@@ -83,6 +91,14 @@ module Zyphr
|
|
|
83
91
|
if attributes.key?(:'email_verification')
|
|
84
92
|
self.email_verification = attributes[:'email_verification']
|
|
85
93
|
end
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:'email_otp')
|
|
96
|
+
self.email_otp = attributes[:'email_otp']
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:'invitation')
|
|
100
|
+
self.invitation = attributes[:'invitation']
|
|
101
|
+
end
|
|
86
102
|
end
|
|
87
103
|
|
|
88
104
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -107,7 +123,9 @@ module Zyphr
|
|
|
107
123
|
self.class == o.class &&
|
|
108
124
|
magic_link == o.magic_link &&
|
|
109
125
|
password_reset == o.password_reset &&
|
|
110
|
-
email_verification == o.email_verification
|
|
126
|
+
email_verification == o.email_verification &&
|
|
127
|
+
email_otp == o.email_otp &&
|
|
128
|
+
invitation == o.invitation
|
|
111
129
|
end
|
|
112
130
|
|
|
113
131
|
# @see the `==` method
|
|
@@ -119,7 +137,7 @@ module Zyphr
|
|
|
119
137
|
# Calculates hash code according to all attributes.
|
|
120
138
|
# @return [Integer] Hash code
|
|
121
139
|
def hash
|
|
122
|
-
[magic_link, password_reset, email_verification].hash
|
|
140
|
+
[magic_link, password_reset, email_verification, email_otp, invitation].hash
|
|
123
141
|
end
|
|
124
142
|
|
|
125
143
|
# Builds the object from hash
|
|
@@ -20,10 +20,10 @@ module Zyphr
|
|
|
20
20
|
# True when a new user was provisioned; false when an existing user was reused (idempotent on email).
|
|
21
21
|
attr_accessor :created
|
|
22
22
|
|
|
23
|
-
# True when
|
|
23
|
+
# True when the requested invitation, magic-link or password-reset email was successfully dispatched.
|
|
24
24
|
attr_accessor :link_sent
|
|
25
25
|
|
|
26
|
-
# Present only when `send_link` was requested and `link_sent` is false — explains why, so a caller can distinguish \"suppressed by design\" from \"delivery failed\". Known values: - `identity_has_other_auth_methods` — the identity has no password but does have a linked OAuth provider and/or a passkey, so it is not locked out and no set-password link is sent. The attempt is recorded as a suppressed message, visible via `GET /emails`. - `user_not_found_in_environment` — the identity could not be resolved in the calling environment (a race; it was created or resolved immediately prior). - `recipient_not_allowlisted` — the application's `test_recipients` allowlist blocked the recipient. - `send_failed` — dispatch was attempted and failed with no more specific code. Not a closed set: a mail-provider error code may be surfaced verbatim, so treat an unrecognised value as a generic failure rather than an error.
|
|
26
|
+
# Present only when `send_link` was requested and `link_sent` is false — explains why, so a caller can distinguish \"suppressed by design\" from \"delivery failed\". Known values: - `identity_has_other_auth_methods` — the identity has no password but does have a linked OAuth provider and/or a passkey, so it is not locked out and no set-password link is sent. The attempt is recorded as a suppressed message, visible via `GET /emails`. (For `send_link: \"invitation\"` the reason is returned here only; no suppressed message is recorded.) - `user_has_password` — `send_link: \"invitation\"` only: the identity already has a password, so there is nothing to accept. Use `password_reset` to send a reset. - `user_not_found_in_environment` — the identity could not be resolved in the calling environment (a race; it was created or resolved immediately prior). - `recipient_not_allowlisted` — the application's `test_recipients` allowlist blocked the recipient. - `send_failed` — dispatch was attempted and failed with no more specific code. Not a closed set: a mail-provider error code may be surfaced verbatim, so treat an unrecognised value as a generic failure rather than an error.
|
|
27
27
|
attr_accessor :link_suppressed_reason
|
|
28
28
|
|
|
29
29
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -143,7 +143,7 @@ module Zyphr
|
|
|
143
143
|
def valid?
|
|
144
144
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
145
145
|
return false if @email.nil?
|
|
146
|
-
send_link_validator = EnumAttributeValidator.new('String', ["magic", "password_reset", "none"])
|
|
146
|
+
send_link_validator = EnumAttributeValidator.new('String', ["invitation", "magic", "password_reset", "none"])
|
|
147
147
|
return false unless send_link_validator.valid?(@send_link)
|
|
148
148
|
true
|
|
149
149
|
end
|
|
@@ -161,7 +161,7 @@ module Zyphr
|
|
|
161
161
|
# Custom attribute writer method checking allowed values (enum).
|
|
162
162
|
# @param [Object] send_link Object to be assigned
|
|
163
163
|
def send_link=(send_link)
|
|
164
|
-
validator = EnumAttributeValidator.new('String', ["magic", "password_reset", "none"])
|
|
164
|
+
validator = EnumAttributeValidator.new('String', ["invitation", "magic", "password_reset", "none"])
|
|
165
165
|
unless validator.valid?(send_link)
|
|
166
166
|
fail ArgumentError, "invalid value for \"send_link\", must be one of #{validator.allowable_values}."
|
|
167
167
|
end
|
|
@@ -15,17 +15,23 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Zyphr
|
|
17
17
|
class MagicLinkVerifyResponseData
|
|
18
|
+
attr_accessor :mfa_required
|
|
19
|
+
|
|
18
20
|
attr_accessor :user
|
|
19
21
|
|
|
20
22
|
attr_accessor :tokens
|
|
21
23
|
|
|
24
|
+
attr_accessor :mfa_challenge
|
|
25
|
+
|
|
22
26
|
attr_accessor :is_new_user
|
|
23
27
|
|
|
24
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
29
|
def self.attribute_map
|
|
26
30
|
{
|
|
31
|
+
:'mfa_required' => :'mfa_required',
|
|
27
32
|
:'user' => :'user',
|
|
28
33
|
:'tokens' => :'tokens',
|
|
34
|
+
:'mfa_challenge' => :'mfa_challenge',
|
|
29
35
|
:'is_new_user' => :'is_new_user'
|
|
30
36
|
}
|
|
31
37
|
end
|
|
@@ -43,8 +49,10 @@ module Zyphr
|
|
|
43
49
|
# Attribute type mapping.
|
|
44
50
|
def self.openapi_types
|
|
45
51
|
{
|
|
52
|
+
:'mfa_required' => :'Boolean',
|
|
46
53
|
:'user' => :'AuthUser',
|
|
47
54
|
:'tokens' => :'AuthTokens',
|
|
55
|
+
:'mfa_challenge' => :'AuthLoginResultMfaChallenge',
|
|
48
56
|
:'is_new_user' => :'Boolean'
|
|
49
57
|
}
|
|
50
58
|
end
|
|
@@ -58,7 +66,7 @@ module Zyphr
|
|
|
58
66
|
# List of class defined in allOf (OpenAPI v3)
|
|
59
67
|
def self.openapi_all_of
|
|
60
68
|
[
|
|
61
|
-
:'
|
|
69
|
+
:'AuthLoginResult'
|
|
62
70
|
]
|
|
63
71
|
end
|
|
64
72
|
|
|
@@ -78,6 +86,10 @@ module Zyphr
|
|
|
78
86
|
h[k.to_sym] = v
|
|
79
87
|
}
|
|
80
88
|
|
|
89
|
+
if attributes.key?(:'mfa_required')
|
|
90
|
+
self.mfa_required = attributes[:'mfa_required']
|
|
91
|
+
end
|
|
92
|
+
|
|
81
93
|
if attributes.key?(:'user')
|
|
82
94
|
self.user = attributes[:'user']
|
|
83
95
|
end
|
|
@@ -86,6 +98,10 @@ module Zyphr
|
|
|
86
98
|
self.tokens = attributes[:'tokens']
|
|
87
99
|
end
|
|
88
100
|
|
|
101
|
+
if attributes.key?(:'mfa_challenge')
|
|
102
|
+
self.mfa_challenge = attributes[:'mfa_challenge']
|
|
103
|
+
end
|
|
104
|
+
|
|
89
105
|
if attributes.key?(:'is_new_user')
|
|
90
106
|
self.is_new_user = attributes[:'is_new_user']
|
|
91
107
|
end
|
|
@@ -111,8 +127,10 @@ module Zyphr
|
|
|
111
127
|
def ==(o)
|
|
112
128
|
return true if self.equal?(o)
|
|
113
129
|
self.class == o.class &&
|
|
130
|
+
mfa_required == o.mfa_required &&
|
|
114
131
|
user == o.user &&
|
|
115
132
|
tokens == o.tokens &&
|
|
133
|
+
mfa_challenge == o.mfa_challenge &&
|
|
116
134
|
is_new_user == o.is_new_user
|
|
117
135
|
end
|
|
118
136
|
|
|
@@ -125,7 +143,7 @@ module Zyphr
|
|
|
125
143
|
# Calculates hash code according to all attributes.
|
|
126
144
|
# @return [Integer] Hash code
|
|
127
145
|
def hash
|
|
128
|
-
[user, tokens, is_new_user].hash
|
|
146
|
+
[mfa_required, user, tokens, mfa_challenge, is_new_user].hash
|
|
129
147
|
end
|
|
130
148
|
|
|
131
149
|
# Builds the object from hash
|
|
@@ -34,7 +34,7 @@ describe 'AuthEmailTemplatesApi' do
|
|
|
34
34
|
|
|
35
35
|
# unit tests for bulk_upsert_auth_email_templates
|
|
36
36
|
# Bulk-upsert auth email templates
|
|
37
|
-
# Atomic upsert of any subset of magic_link, password_reset, email_verification. Validates all inputs before any write; if any one fails validation or MJML compile, none are saved. Designed for one-shot migration imports from Auth0/Firebase/Clerk/Cognito.
|
|
37
|
+
# Atomic upsert of any subset of magic_link, password_reset, email_verification, email_otp, invitation. Validates all inputs before any write; if any one fails validation or MJML compile, none are saved. Designed for one-shot migration imports from Auth0/Firebase/Clerk/Cognito.
|
|
38
38
|
# @param bulk_upsert_auth_email_templates_request
|
|
39
39
|
# @param [Hash] opts the optional parameters
|
|
40
40
|
# @return [BulkUpsertAuthEmailTemplatesResponse]
|
|
@@ -46,7 +46,7 @@ describe 'AuthMagicLinksApi' do
|
|
|
46
46
|
|
|
47
47
|
# unit tests for verify_magic_link
|
|
48
48
|
# Verify a magic link
|
|
49
|
-
# Verify a magic link token and authenticate the user. Returns auth result with is_new_user flag.
|
|
49
|
+
# Verify a magic link token and authenticate the user. Returns auth result with is_new_user flag. A magic link is a single factor, so a user who has enrolled MFA gets `mfa_required: true` and an `mfa_challenge` instead of tokens; complete the login with the challenge token at `POST /auth/mfa/verify`, exactly as after password login.
|
|
50
50
|
# @param magic_link_verify_request
|
|
51
51
|
# @param [Hash] opts the optional parameters
|
|
52
52
|
# @return [MagicLinkVerifyResponse]
|
|
@@ -94,7 +94,7 @@ describe 'AuthUserDirectoryApi' do
|
|
|
94
94
|
|
|
95
95
|
# unit tests for invite_end_user
|
|
96
96
|
# Pre-provision (invite) an end user (server-side admin)
|
|
97
|
-
# Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when `send_link` is set, sends a first-login link so the user can set up their account without self-registration. - `send_link: \"
|
|
97
|
+
# Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when `send_link` is set, sends a first-login link so the user can set up their account without self-registration. - `send_link: \"invitation\"` sends the `invitation` auth email: a set-password link (valid 7 days) redeemed at `POST /auth/reset-password`, so the invitee ends up with a password. It has its own per-application template, separate from password reset's. Not sent to an identity that can already sign in. - `send_link: \"password_reset\"` sends a set-password email using the password-reset template. - `send_link: \"magic\"` sends a magic-link sign-in email. The user still has no credential afterwards. - `send_link: \"none\"` (default) creates the user with no email. A `redirect_url` is required whenever `send_link` is not \"none\"; it must match the application's redirect_uris allowlist (custom schemes such as yourapp://path are permitted).
|
|
98
98
|
# @param invite_end_user_request
|
|
99
99
|
# @param [Hash] opts the optional parameters
|
|
100
100
|
# @return [InviteEndUser200Response]
|
|
@@ -45,4 +45,16 @@ describe Zyphr::BulkUpsertAuthEmailTemplatesRequest do
|
|
|
45
45
|
end
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
+
describe 'test attribute "email_otp"' do
|
|
49
|
+
it 'should work' do
|
|
50
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
describe 'test attribute "invitation"' do
|
|
55
|
+
it 'should work' do
|
|
56
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
48
60
|
end
|
|
@@ -48,7 +48,7 @@ describe Zyphr::InviteEndUserRequest do
|
|
|
48
48
|
describe 'test attribute "send_link"' do
|
|
49
49
|
it 'should work' do
|
|
50
50
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
51
|
-
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["magic", "password_reset", "none"])
|
|
51
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["invitation", "magic", "password_reset", "none"])
|
|
52
52
|
# validator.allowable_values.each do |value|
|
|
53
53
|
# expect { instance.send_link = value }.not_to raise_error
|
|
54
54
|
# end
|
|
@@ -27,6 +27,12 @@ describe Zyphr::MagicLinkVerifyResponseData do
|
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
+
describe 'test attribute "mfa_required"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
30
36
|
describe 'test attribute "user"' do
|
|
31
37
|
it 'should work' do
|
|
32
38
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
@@ -39,6 +45,12 @@ describe Zyphr::MagicLinkVerifyResponseData do
|
|
|
39
45
|
end
|
|
40
46
|
end
|
|
41
47
|
|
|
48
|
+
describe 'test attribute "mfa_challenge"' do
|
|
49
|
+
it 'should work' do
|
|
50
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
42
54
|
describe 'test attribute "is_new_user"' do
|
|
43
55
|
it 'should work' do
|
|
44
56
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|