zyphr 0.1.68 → 0.1.70
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/README.md +5 -0
- data/docs/AuthMagicLinksApi.md +5 -5
- data/docs/AuthPasswordResetApi.md +5 -5
- data/docs/AuthUserDirectoryApi.md +1 -1
- data/docs/ForgotPasswordRequest.md +3 -1
- data/docs/ForgotPasswordResult.md +20 -0
- data/docs/ForgotPasswordResultData.md +22 -0
- data/docs/InviteEndUser200ResponseData.md +2 -0
- data/docs/InviteEndUserRequest.md +3 -1
- data/docs/MagicLinkSendRequest.md +3 -1
- data/docs/MagicLinkSendResult.md +20 -0
- data/docs/MagicLinkSendResultData.md +20 -0
- data/docs/ReturnedAuthLink.md +22 -0
- data/docs/WebhooksApi.md +1 -1
- data/lib/zyphr/api/auth_magic_links_api.rb +5 -5
- data/lib/zyphr/api/auth_password_reset_api.rb +5 -5
- data/lib/zyphr/api/auth_user_directory_api.rb +2 -2
- data/lib/zyphr/api/webhooks_api.rb +2 -2
- data/lib/zyphr/models/forgot_password_request.rb +16 -4
- data/lib/zyphr/models/forgot_password_result.rb +229 -0
- data/lib/zyphr/models/forgot_password_result_data.rb +275 -0
- data/lib/zyphr/models/invite_end_user200_response_data.rb +10 -1
- data/lib/zyphr/models/invite_end_user_request.rb +16 -4
- data/lib/zyphr/models/magic_link_send_request.rb +16 -4
- data/lib/zyphr/models/magic_link_send_result.rb +229 -0
- data/lib/zyphr/models/magic_link_send_result_data.rb +229 -0
- data/lib/zyphr/models/returned_auth_link.rb +292 -0
- data/lib/zyphr.rb +5 -0
- data/spec/api/auth_magic_links_api_spec.rb +2 -2
- data/spec/api/auth_password_reset_api_spec.rb +2 -2
- data/spec/api/auth_user_directory_api_spec.rb +1 -1
- data/spec/api/webhooks_api_spec.rb +1 -1
- data/spec/models/forgot_password_request_spec.rb +6 -0
- data/spec/models/forgot_password_result_data_spec.rb +52 -0
- data/spec/models/forgot_password_result_spec.rb +42 -0
- data/spec/models/invite_end_user200_response_data_spec.rb +6 -0
- data/spec/models/invite_end_user_request_spec.rb +6 -0
- data/spec/models/magic_link_send_request_spec.rb +6 -0
- data/spec/models/magic_link_send_result_data_spec.rb +42 -0
- data/spec/models/magic_link_send_result_spec.rb +42 -0
- data/spec/models/returned_auth_link_spec.rb +48 -0
- data/zyphr.gemspec +1 -1
- metadata +22 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ec25f83ab94d668fb0e695cea147b873355b441a475342b8ee4ceadc07c5fee0
|
|
4
|
+
data.tar.gz: 540ca72ea16878da2e76ea11959a267267e6163fb37251e93bdf60ffc537dd9b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2a46fb8778200bcd7a06c943d2c35974bcaff35697416728776be4420d28c6f673ea1ef6c346c0b4e657907710eddb03566e545f06104526ac769039103ca2ee
|
|
7
|
+
data.tar.gz: 7790e1ccab6c414ca5043e43273517599ded85f20d6b0e354b70b4a90a17392b5c4ec8e3d99b9dfe443f2c4909507fb38892037e2753c176781115182c9d020c
|
data/README.md
CHANGED
|
@@ -505,6 +505,8 @@ Class | Method | HTTP request | Description
|
|
|
505
505
|
- [Zyphr::ExecutionRetryResponse](docs/ExecutionRetryResponse.md)
|
|
506
506
|
- [Zyphr::ExecutionRetryResponseData](docs/ExecutionRetryResponseData.md)
|
|
507
507
|
- [Zyphr::ForgotPasswordRequest](docs/ForgotPasswordRequest.md)
|
|
508
|
+
- [Zyphr::ForgotPasswordResult](docs/ForgotPasswordResult.md)
|
|
509
|
+
- [Zyphr::ForgotPasswordResultData](docs/ForgotPasswordResultData.md)
|
|
508
510
|
- [Zyphr::GenerateSubscriberToken200Response](docs/GenerateSubscriberToken200Response.md)
|
|
509
511
|
- [Zyphr::GenerateSubscriberToken200ResponseData](docs/GenerateSubscriberToken200ResponseData.md)
|
|
510
512
|
- [Zyphr::GenerateSubscriberTokenRequest](docs/GenerateSubscriberTokenRequest.md)
|
|
@@ -558,6 +560,8 @@ Class | Method | HTTP request | Description
|
|
|
558
560
|
- [Zyphr::ListWorkflows200ResponseMeta](docs/ListWorkflows200ResponseMeta.md)
|
|
559
561
|
- [Zyphr::LoginRequest](docs/LoginRequest.md)
|
|
560
562
|
- [Zyphr::MagicLinkSendRequest](docs/MagicLinkSendRequest.md)
|
|
563
|
+
- [Zyphr::MagicLinkSendResult](docs/MagicLinkSendResult.md)
|
|
564
|
+
- [Zyphr::MagicLinkSendResultData](docs/MagicLinkSendResultData.md)
|
|
561
565
|
- [Zyphr::MagicLinkVerifyRequest](docs/MagicLinkVerifyRequest.md)
|
|
562
566
|
- [Zyphr::MagicLinkVerifyResponse](docs/MagicLinkVerifyResponse.md)
|
|
563
567
|
- [Zyphr::MagicLinkVerifyResponseData](docs/MagicLinkVerifyResponseData.md)
|
|
@@ -666,6 +670,7 @@ Class | Method | HTTP request | Description
|
|
|
666
670
|
- [Zyphr::ResetPasswordResponse](docs/ResetPasswordResponse.md)
|
|
667
671
|
- [Zyphr::ResubscribeRequest](docs/ResubscribeRequest.md)
|
|
668
672
|
- [Zyphr::ResubscribeResponse](docs/ResubscribeResponse.md)
|
|
673
|
+
- [Zyphr::ReturnedAuthLink](docs/ReturnedAuthLink.md)
|
|
669
674
|
- [Zyphr::RevokeAllSessionsResponse](docs/RevokeAllSessionsResponse.md)
|
|
670
675
|
- [Zyphr::RevokeAllSessionsResponseData](docs/RevokeAllSessionsResponseData.md)
|
|
671
676
|
- [Zyphr::RevokeSessionRequest](docs/RevokeSessionRequest.md)
|
data/docs/AuthMagicLinksApi.md
CHANGED
|
@@ -10,11 +10,11 @@ All URIs are relative to *https://api.zyphr.dev/v1*
|
|
|
10
10
|
|
|
11
11
|
## send_magic_link
|
|
12
12
|
|
|
13
|
-
> <
|
|
13
|
+
> <MagicLinkSendResult> send_magic_link(magic_link_send_request)
|
|
14
14
|
|
|
15
15
|
Send a magic link
|
|
16
16
|
|
|
17
|
-
Send a magic link email for passwordless authentication.
|
|
17
|
+
Send a magic link email for passwordless authentication. **Sending the email yourself:** pass `return_link: true` (with `redirect_url`) and Zyphr mints the link but sends nothing, returning it in `data.link`. Requires your application secret, so call it server-side only.
|
|
18
18
|
|
|
19
19
|
### Examples
|
|
20
20
|
|
|
@@ -50,7 +50,7 @@ end
|
|
|
50
50
|
|
|
51
51
|
This returns an Array which contains the response data, status code and headers.
|
|
52
52
|
|
|
53
|
-
> <Array(<
|
|
53
|
+
> <Array(<MagicLinkSendResult>, Integer, Hash)> send_magic_link_with_http_info(magic_link_send_request)
|
|
54
54
|
|
|
55
55
|
```ruby
|
|
56
56
|
begin
|
|
@@ -58,7 +58,7 @@ begin
|
|
|
58
58
|
data, status_code, headers = api_instance.send_magic_link_with_http_info(magic_link_send_request)
|
|
59
59
|
p status_code # => 2xx
|
|
60
60
|
p headers # => { ... }
|
|
61
|
-
p data # => <
|
|
61
|
+
p data # => <MagicLinkSendResult>
|
|
62
62
|
rescue Zyphr::ApiError => e
|
|
63
63
|
puts "Error when calling AuthMagicLinksApi->send_magic_link_with_http_info: #{e}"
|
|
64
64
|
end
|
|
@@ -72,7 +72,7 @@ end
|
|
|
72
72
|
|
|
73
73
|
### Return type
|
|
74
74
|
|
|
75
|
-
[**
|
|
75
|
+
[**MagicLinkSendResult**](MagicLinkSendResult.md)
|
|
76
76
|
|
|
77
77
|
### Authorization
|
|
78
78
|
|
|
@@ -11,11 +11,11 @@ All URIs are relative to *https://api.zyphr.dev/v1*
|
|
|
11
11
|
|
|
12
12
|
## forgot_password
|
|
13
13
|
|
|
14
|
-
> <
|
|
14
|
+
> <ForgotPasswordResult> forgot_password(forgot_password_request)
|
|
15
15
|
|
|
16
16
|
Request a password reset
|
|
17
17
|
|
|
18
|
-
Request a password reset email. Creates a reset token and sends an email to the user. Always returns success to prevent email enumeration — the response is identical whether or not the address is registered. An identity with **no password set** still receives a link, which sets a first password. This covers users migrated from a provider that cannot export password hashes. The one case where no email is sent (beyond an unknown address) is an identity that has no password but *does* have another way in — a linked OAuth provider and/or a passkey. Those users are not locked out, so no set-password link is sent; the attempt is recorded as a suppressed message visible via `GET /emails`.
|
|
18
|
+
Request a password reset email. Creates a reset token and sends an email to the user. Always returns success to prevent email enumeration — the response is identical whether or not the address is registered. An identity with **no password set** still receives a link, which sets a first password. This covers users migrated from a provider that cannot export password hashes. The one case where no email is sent (beyond an unknown address) is an identity that has no password but *does* have another way in — a linked OAuth provider and/or a passkey. Those users are not locked out, so no set-password link is sent; the attempt is recorded as a suppressed message visible via `GET /emails`. **Sending the email yourself:** pass `return_link: true` (with `redirect_url`) and Zyphr mints the token but sends nothing, returning the link in `data.link`. When no link is minted, `data.link` is null and `data.link_suppressed_reason` says why. Unlike the default response, this reveals whether the address is registered — acceptable only because the endpoint requires your application secret, so it must only be called server-side.
|
|
19
19
|
|
|
20
20
|
### Examples
|
|
21
21
|
|
|
@@ -51,7 +51,7 @@ end
|
|
|
51
51
|
|
|
52
52
|
This returns an Array which contains the response data, status code and headers.
|
|
53
53
|
|
|
54
|
-
> <Array(<
|
|
54
|
+
> <Array(<ForgotPasswordResult>, Integer, Hash)> forgot_password_with_http_info(forgot_password_request)
|
|
55
55
|
|
|
56
56
|
```ruby
|
|
57
57
|
begin
|
|
@@ -59,7 +59,7 @@ begin
|
|
|
59
59
|
data, status_code, headers = api_instance.forgot_password_with_http_info(forgot_password_request)
|
|
60
60
|
p status_code # => 2xx
|
|
61
61
|
p headers # => { ... }
|
|
62
|
-
p data # => <
|
|
62
|
+
p data # => <ForgotPasswordResult>
|
|
63
63
|
rescue Zyphr::ApiError => e
|
|
64
64
|
puts "Error when calling AuthPasswordResetApi->forgot_password_with_http_info: #{e}"
|
|
65
65
|
end
|
|
@@ -73,7 +73,7 @@ end
|
|
|
73
73
|
|
|
74
74
|
### Return type
|
|
75
75
|
|
|
76
|
-
[**
|
|
76
|
+
[**ForgotPasswordResult**](ForgotPasswordResult.md)
|
|
77
77
|
|
|
78
78
|
### Authorization
|
|
79
79
|
|
|
@@ -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: \"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).
|
|
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). **Sending the email yourself:** pass `return_link: true` with a `send_link` and Zyphr mints that link but sends nothing, returning it in `data.link` (`link_sent` stays false). The same `link_suppressed_reason` values apply when no link can be minted.
|
|
404
404
|
|
|
405
405
|
### Examples
|
|
406
406
|
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **email** | **String** | | |
|
|
8
8
|
| **redirect_url** | **String** | | [optional] |
|
|
9
|
+
| **return_link** | **Boolean** | When true, Zyphr mints the token but sends no email, and returns the link in `data.link` so you can render and send the email yourself (for example through `POST /v1/emails`). Requires `redirect_url`. | [optional][default to false] |
|
|
9
10
|
|
|
10
11
|
## Example
|
|
11
12
|
|
|
@@ -14,7 +15,8 @@ require 'zyphr'
|
|
|
14
15
|
|
|
15
16
|
instance = Zyphr::ForgotPasswordRequest.new(
|
|
16
17
|
email: null,
|
|
17
|
-
redirect_url: null
|
|
18
|
+
redirect_url: null,
|
|
19
|
+
return_link: null
|
|
18
20
|
)
|
|
19
21
|
```
|
|
20
22
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Zyphr::ForgotPasswordResult
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **data** | [**ForgotPasswordResultData**](ForgotPasswordResultData.md) | | [optional] |
|
|
8
|
+
| **meta** | [**GetDomain200ResponseMeta**](GetDomain200ResponseMeta.md) | | [optional] |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'zyphr'
|
|
14
|
+
|
|
15
|
+
instance = Zyphr::ForgotPasswordResult.new(
|
|
16
|
+
data: null,
|
|
17
|
+
meta: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Zyphr::ForgotPasswordResultData
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **success** | **Boolean** | | [optional] |
|
|
8
|
+
| **link** | [**ReturnedAuthLink**](ReturnedAuthLink.md) | Present only when `return_link` was true; null when no link was minted. | [optional] |
|
|
9
|
+
| **link_suppressed_reason** | **String** | Present only when `return_link` was true and `link` is null. | [optional] |
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'zyphr'
|
|
15
|
+
|
|
16
|
+
instance = Zyphr::ForgotPasswordResultData.new(
|
|
17
|
+
success: null,
|
|
18
|
+
link: null,
|
|
19
|
+
link_suppressed_reason: null
|
|
20
|
+
)
|
|
21
|
+
```
|
|
22
|
+
|
|
@@ -7,6 +7,7 @@
|
|
|
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
9
|
| **link_sent** | **Boolean** | True when the requested invitation, magic-link or password-reset email was successfully dispatched. | [optional] |
|
|
10
|
+
| **link** | [**ReturnedAuthLink**](ReturnedAuthLink.md) | | [optional] |
|
|
10
11
|
| **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
12
|
|
|
12
13
|
## Example
|
|
@@ -18,6 +19,7 @@ instance = Zyphr::InviteEndUser200ResponseData.new(
|
|
|
18
19
|
user_id: null,
|
|
19
20
|
created: null,
|
|
20
21
|
link_sent: null,
|
|
22
|
+
link: null,
|
|
21
23
|
link_suppressed_reason: identity_has_other_auth_methods
|
|
22
24
|
)
|
|
23
25
|
```
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
| **metadata** | **Object** | | [optional] |
|
|
10
10
|
| **send_link** | **String** | | [optional][default to 'none'] |
|
|
11
11
|
| **redirect_url** | **String** | | [optional] |
|
|
12
|
+
| **return_link** | **Boolean** | Return the link in `data.link` instead of emailing it. Requires `send_link` other than \"none\". | [optional][default to false] |
|
|
12
13
|
|
|
13
14
|
## Example
|
|
14
15
|
|
|
@@ -20,7 +21,8 @@ instance = Zyphr::InviteEndUserRequest.new(
|
|
|
20
21
|
name: null,
|
|
21
22
|
metadata: null,
|
|
22
23
|
send_link: null,
|
|
23
|
-
redirect_url: null
|
|
24
|
+
redirect_url: null,
|
|
25
|
+
return_link: null
|
|
24
26
|
)
|
|
25
27
|
```
|
|
26
28
|
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **email** | **String** | | |
|
|
8
8
|
| **redirect_url** | **String** | | [optional] |
|
|
9
|
+
| **return_link** | **Boolean** | When true, Zyphr mints the token but sends no email, and returns the link in `data.link` so you can render and send the email yourself (for example through `POST /v1/emails`). Requires `redirect_url`. | [optional][default to false] |
|
|
9
10
|
|
|
10
11
|
## Example
|
|
11
12
|
|
|
@@ -14,7 +15,8 @@ require 'zyphr'
|
|
|
14
15
|
|
|
15
16
|
instance = Zyphr::MagicLinkSendRequest.new(
|
|
16
17
|
email: null,
|
|
17
|
-
redirect_url: null
|
|
18
|
+
redirect_url: null,
|
|
19
|
+
return_link: null
|
|
18
20
|
)
|
|
19
21
|
```
|
|
20
22
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Zyphr::MagicLinkSendResult
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **data** | [**MagicLinkSendResultData**](MagicLinkSendResultData.md) | | [optional] |
|
|
8
|
+
| **meta** | [**GetDomain200ResponseMeta**](GetDomain200ResponseMeta.md) | | [optional] |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'zyphr'
|
|
14
|
+
|
|
15
|
+
instance = Zyphr::MagicLinkSendResult.new(
|
|
16
|
+
data: null,
|
|
17
|
+
meta: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Zyphr::MagicLinkSendResultData
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **success** | **Boolean** | | [optional] |
|
|
8
|
+
| **link** | [**ReturnedAuthLink**](ReturnedAuthLink.md) | | [optional] |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'zyphr'
|
|
14
|
+
|
|
15
|
+
instance = Zyphr::MagicLinkSendResultData.new(
|
|
16
|
+
success: null,
|
|
17
|
+
link: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Zyphr::ReturnedAuthLink
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **url** | **String** | Your `redirect_url` with `?token=` appended — the same URL Zyphr's email would carry. | |
|
|
8
|
+
| **token** | **String** | The raw token, redeemed at the matching endpoint (`/auth/magic-link/verify` or `/auth/reset-password`). | |
|
|
9
|
+
| **expires_at** | **Time** | | |
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'zyphr'
|
|
15
|
+
|
|
16
|
+
instance = Zyphr::ReturnedAuthLink.new(
|
|
17
|
+
url: null,
|
|
18
|
+
token: null,
|
|
19
|
+
expires_at: null
|
|
20
|
+
)
|
|
21
|
+
```
|
|
22
|
+
|
data/docs/WebhooksApi.md
CHANGED
|
@@ -815,7 +815,7 @@ end
|
|
|
815
815
|
|
|
816
816
|
Get webhook usage metrics
|
|
817
817
|
|
|
818
|
-
Get webhook delivery usage statistics for the current billing period.
|
|
818
|
+
Get webhook delivery usage statistics for this project in the current billing period. The plan limit applies to the whole account.
|
|
819
819
|
|
|
820
820
|
### Examples
|
|
821
821
|
|
|
@@ -20,20 +20,20 @@ module Zyphr
|
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
22
|
# Send a magic link
|
|
23
|
-
# Send a magic link email for passwordless authentication.
|
|
23
|
+
# Send a magic link email for passwordless authentication. **Sending the email yourself:** pass `return_link: true` (with `redirect_url`) and Zyphr mints the link but sends nothing, returning it in `data.link`. Requires your application secret, so call it server-side only.
|
|
24
24
|
# @param magic_link_send_request [MagicLinkSendRequest]
|
|
25
25
|
# @param [Hash] opts the optional parameters
|
|
26
|
-
# @return [
|
|
26
|
+
# @return [MagicLinkSendResult]
|
|
27
27
|
def send_magic_link(magic_link_send_request, opts = {})
|
|
28
28
|
data, _status_code, _headers = send_magic_link_with_http_info(magic_link_send_request, opts)
|
|
29
29
|
data
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
# Send a magic link
|
|
33
|
-
# Send a magic link email for passwordless authentication.
|
|
33
|
+
# Send a magic link email for passwordless authentication. **Sending the email yourself:** pass `return_link: true` (with `redirect_url`) and Zyphr mints the link but sends nothing, returning it in `data.link`. Requires your application secret, so call it server-side only.
|
|
34
34
|
# @param magic_link_send_request [MagicLinkSendRequest]
|
|
35
35
|
# @param [Hash] opts the optional parameters
|
|
36
|
-
# @return [Array<(
|
|
36
|
+
# @return [Array<(MagicLinkSendResult, Integer, Hash)>] MagicLinkSendResult data, response status code and response headers
|
|
37
37
|
def send_magic_link_with_http_info(magic_link_send_request, opts = {})
|
|
38
38
|
if @api_client.config.debugging
|
|
39
39
|
@api_client.config.logger.debug 'Calling API: AuthMagicLinksApi.send_magic_link ...'
|
|
@@ -65,7 +65,7 @@ module Zyphr
|
|
|
65
65
|
post_body = opts[:debug_body] || @api_client.object_to_http_body(magic_link_send_request)
|
|
66
66
|
|
|
67
67
|
# return_type
|
|
68
|
-
return_type = opts[:debug_return_type] || '
|
|
68
|
+
return_type = opts[:debug_return_type] || 'MagicLinkSendResult'
|
|
69
69
|
|
|
70
70
|
# auth_names
|
|
71
71
|
auth_names = opts[:debug_auth_names] || ['ApplicationSecret', 'ApplicationPublicKey']
|
|
@@ -20,20 +20,20 @@ module Zyphr
|
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
22
|
# Request a password reset
|
|
23
|
-
# Request a password reset email. Creates a reset token and sends an email to the user. Always returns success to prevent email enumeration — the response is identical whether or not the address is registered. An identity with **no password set** still receives a link, which sets a first password. This covers users migrated from a provider that cannot export password hashes. The one case where no email is sent (beyond an unknown address) is an identity that has no password but *does* have another way in — a linked OAuth provider and/or a passkey. Those users are not locked out, so no set-password link is sent; the attempt is recorded as a suppressed message visible via `GET /emails`.
|
|
23
|
+
# Request a password reset email. Creates a reset token and sends an email to the user. Always returns success to prevent email enumeration — the response is identical whether or not the address is registered. An identity with **no password set** still receives a link, which sets a first password. This covers users migrated from a provider that cannot export password hashes. The one case where no email is sent (beyond an unknown address) is an identity that has no password but *does* have another way in — a linked OAuth provider and/or a passkey. Those users are not locked out, so no set-password link is sent; the attempt is recorded as a suppressed message visible via `GET /emails`. **Sending the email yourself:** pass `return_link: true` (with `redirect_url`) and Zyphr mints the token but sends nothing, returning the link in `data.link`. When no link is minted, `data.link` is null and `data.link_suppressed_reason` says why. Unlike the default response, this reveals whether the address is registered — acceptable only because the endpoint requires your application secret, so it must only be called server-side.
|
|
24
24
|
# @param forgot_password_request [ForgotPasswordRequest]
|
|
25
25
|
# @param [Hash] opts the optional parameters
|
|
26
|
-
# @return [
|
|
26
|
+
# @return [ForgotPasswordResult]
|
|
27
27
|
def forgot_password(forgot_password_request, opts = {})
|
|
28
28
|
data, _status_code, _headers = forgot_password_with_http_info(forgot_password_request, opts)
|
|
29
29
|
data
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
# Request a password reset
|
|
33
|
-
# Request a password reset email. Creates a reset token and sends an email to the user. Always returns success to prevent email enumeration — the response is identical whether or not the address is registered. An identity with **no password set** still receives a link, which sets a first password. This covers users migrated from a provider that cannot export password hashes. The one case where no email is sent (beyond an unknown address) is an identity that has no password but *does* have another way in — a linked OAuth provider and/or a passkey. Those users are not locked out, so no set-password link is sent; the attempt is recorded as a suppressed message visible via `GET /emails`.
|
|
33
|
+
# Request a password reset email. Creates a reset token and sends an email to the user. Always returns success to prevent email enumeration — the response is identical whether or not the address is registered. An identity with **no password set** still receives a link, which sets a first password. This covers users migrated from a provider that cannot export password hashes. The one case where no email is sent (beyond an unknown address) is an identity that has no password but *does* have another way in — a linked OAuth provider and/or a passkey. Those users are not locked out, so no set-password link is sent; the attempt is recorded as a suppressed message visible via `GET /emails`. **Sending the email yourself:** pass `return_link: true` (with `redirect_url`) and Zyphr mints the token but sends nothing, returning the link in `data.link`. When no link is minted, `data.link` is null and `data.link_suppressed_reason` says why. Unlike the default response, this reveals whether the address is registered — acceptable only because the endpoint requires your application secret, so it must only be called server-side.
|
|
34
34
|
# @param forgot_password_request [ForgotPasswordRequest]
|
|
35
35
|
# @param [Hash] opts the optional parameters
|
|
36
|
-
# @return [Array<(
|
|
36
|
+
# @return [Array<(ForgotPasswordResult, Integer, Hash)>] ForgotPasswordResult data, response status code and response headers
|
|
37
37
|
def forgot_password_with_http_info(forgot_password_request, opts = {})
|
|
38
38
|
if @api_client.config.debugging
|
|
39
39
|
@api_client.config.logger.debug 'Calling API: AuthPasswordResetApi.forgot_password ...'
|
|
@@ -65,7 +65,7 @@ module Zyphr
|
|
|
65
65
|
post_body = opts[:debug_body] || @api_client.object_to_http_body(forgot_password_request)
|
|
66
66
|
|
|
67
67
|
# return_type
|
|
68
|
-
return_type = opts[:debug_return_type] || '
|
|
68
|
+
return_type = opts[:debug_return_type] || 'ForgotPasswordResult'
|
|
69
69
|
|
|
70
70
|
# auth_names
|
|
71
71
|
auth_names = opts[:debug_auth_names] || ['ApplicationSecret', 'ApplicationPublicKey']
|
|
@@ -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: \"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).
|
|
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). **Sending the email yourself:** pass `return_link: true` with a `send_link` and Zyphr mints that link but sends nothing, returning it in `data.link` (`link_sent` stays false). The same `link_suppressed_reason` values apply when no link can be minted.
|
|
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: \"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).
|
|
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). **Sending the email yourself:** pass `return_link: true` with a `send_link` and Zyphr mints that link but sends nothing, returning it in `data.link` (`link_sent` stays false). The same `link_suppressed_reason` values apply when no link can be minted.
|
|
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
|
|
@@ -719,7 +719,7 @@ module Zyphr
|
|
|
719
719
|
end
|
|
720
720
|
|
|
721
721
|
# Get webhook usage metrics
|
|
722
|
-
# Get webhook delivery usage statistics for the current billing period.
|
|
722
|
+
# Get webhook delivery usage statistics for this project in the current billing period. The plan limit applies to the whole account.
|
|
723
723
|
# @param [Hash] opts the optional parameters
|
|
724
724
|
# @return [WebhookUsageResponse]
|
|
725
725
|
def get_webhook_usage(opts = {})
|
|
@@ -728,7 +728,7 @@ module Zyphr
|
|
|
728
728
|
end
|
|
729
729
|
|
|
730
730
|
# Get webhook usage metrics
|
|
731
|
-
# Get webhook delivery usage statistics for the current billing period.
|
|
731
|
+
# Get webhook delivery usage statistics for this project in the current billing period. The plan limit applies to the whole account.
|
|
732
732
|
# @param [Hash] opts the optional parameters
|
|
733
733
|
# @return [Array<(WebhookUsageResponse, Integer, Hash)>] WebhookUsageResponse data, response status code and response headers
|
|
734
734
|
def get_webhook_usage_with_http_info(opts = {})
|
|
@@ -19,11 +19,15 @@ module Zyphr
|
|
|
19
19
|
|
|
20
20
|
attr_accessor :redirect_url
|
|
21
21
|
|
|
22
|
+
# When true, Zyphr mints the token but sends no email, and returns the link in `data.link` so you can render and send the email yourself (for example through `POST /v1/emails`). Requires `redirect_url`.
|
|
23
|
+
attr_accessor :return_link
|
|
24
|
+
|
|
22
25
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
26
|
def self.attribute_map
|
|
24
27
|
{
|
|
25
28
|
:'email' => :'email',
|
|
26
|
-
:'redirect_url' => :'redirect_url'
|
|
29
|
+
:'redirect_url' => :'redirect_url',
|
|
30
|
+
:'return_link' => :'return_link'
|
|
27
31
|
}
|
|
28
32
|
end
|
|
29
33
|
|
|
@@ -41,7 +45,8 @@ module Zyphr
|
|
|
41
45
|
def self.openapi_types
|
|
42
46
|
{
|
|
43
47
|
:'email' => :'String',
|
|
44
|
-
:'redirect_url' => :'String'
|
|
48
|
+
:'redirect_url' => :'String',
|
|
49
|
+
:'return_link' => :'Boolean'
|
|
45
50
|
}
|
|
46
51
|
end
|
|
47
52
|
|
|
@@ -76,6 +81,12 @@ module Zyphr
|
|
|
76
81
|
if attributes.key?(:'redirect_url')
|
|
77
82
|
self.redirect_url = attributes[:'redirect_url']
|
|
78
83
|
end
|
|
84
|
+
|
|
85
|
+
if attributes.key?(:'return_link')
|
|
86
|
+
self.return_link = attributes[:'return_link']
|
|
87
|
+
else
|
|
88
|
+
self.return_link = false
|
|
89
|
+
end
|
|
79
90
|
end
|
|
80
91
|
|
|
81
92
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -114,7 +125,8 @@ module Zyphr
|
|
|
114
125
|
return true if self.equal?(o)
|
|
115
126
|
self.class == o.class &&
|
|
116
127
|
email == o.email &&
|
|
117
|
-
redirect_url == o.redirect_url
|
|
128
|
+
redirect_url == o.redirect_url &&
|
|
129
|
+
return_link == o.return_link
|
|
118
130
|
end
|
|
119
131
|
|
|
120
132
|
# @see the `==` method
|
|
@@ -126,7 +138,7 @@ module Zyphr
|
|
|
126
138
|
# Calculates hash code according to all attributes.
|
|
127
139
|
# @return [Integer] Hash code
|
|
128
140
|
def hash
|
|
129
|
-
[email, redirect_url].hash
|
|
141
|
+
[email, redirect_url, return_link].hash
|
|
130
142
|
end
|
|
131
143
|
|
|
132
144
|
# Builds the object from hash
|