zyphr 0.1.43 → 0.1.44
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 +17 -4
- data/docs/ApplicationSelf.md +24 -0
- data/docs/ApplicationSelfResponse.md +20 -0
- data/docs/AuthApplicationApi.md +81 -0
- data/docs/AuthEmailTemplateTestRequest.md +1 -1
- data/docs/AuthEmailTemplatesApi.md +1 -1
- data/docs/AuthMethods.md +28 -0
- data/docs/AuthUserDirectoryApi.md +77 -0
- data/docs/GetEndUserAuthMethods200Response.md +20 -0
- data/lib/zyphr/api/auth_application_api.rb +79 -0
- data/lib/zyphr/api/auth_email_templates_api.rb +2 -2
- data/lib/zyphr/api/auth_user_directory_api.rb +63 -0
- data/lib/zyphr/models/application_self.rb +342 -0
- data/lib/zyphr/models/application_self_response.rb +229 -0
- data/lib/zyphr/models/auth_email_template_test_request.rb +1 -1
- data/lib/zyphr/models/auth_methods.rb +376 -0
- data/lib/zyphr/models/get_end_user_auth_methods200_response.rb +229 -0
- data/lib/zyphr.rb +5 -0
- data/spec/api/auth_application_api_spec.rb +46 -0
- data/spec/api/auth_email_templates_api_spec.rb +1 -1
- data/spec/api/auth_user_directory_api_spec.rb +12 -0
- data/spec/models/application_self_response_spec.rb +42 -0
- data/spec/models/application_self_spec.rb +62 -0
- data/spec/models/auth_methods_spec.rb +66 -0
- data/spec/models/get_end_user_auth_methods200_response_spec.rb +42 -0
- data/zyphr.gemspec +1 -1
- metadata +21 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bdb232c25df3ba83aad2f1e205941038b186be722997d3f4a0b9a4d4866c5fec
|
|
4
|
+
data.tar.gz: c5e28ca2a16b510deca00ff1f99d769f273363bdde11c34afcd8617df54860e4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 187ff2bea23ac4b9bd35b5c999a63f25a14e659924d5382d57062fae4a0d20ebb8a64eca421ceb1b517ef17ff855f8465ee9e9a8f64c962af4088f975df3dcd9
|
|
7
|
+
data.tar.gz: 54e87dc5d28157446a0feb49196231cf49789db4f2f87982fc2cffde9d2efced47d662e42bd4fa5610f28c64ff19d73900cf65c69b4eaa6fdcbaffab66d6e8f4
|
data/README.md
CHANGED
|
@@ -104,6 +104,13 @@ require 'zyphr'
|
|
|
104
104
|
|
|
105
105
|
# Setup authorization
|
|
106
106
|
Zyphr.configure do |config|
|
|
107
|
+
# Configure API key authorization: ApplicationSecret
|
|
108
|
+
config.api_key['X-Application-Secret'] = 'YOUR API KEY'
|
|
109
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
110
|
+
# config.api_key_prefix['X-Application-Secret'] = 'Bearer'
|
|
111
|
+
# Configure faraday connection
|
|
112
|
+
config.configure_faraday_connection { |connection| 'YOUR CONNECTION CONFIG PROC' }
|
|
113
|
+
|
|
107
114
|
# Configure API key authorization: ApplicationPublicKey
|
|
108
115
|
config.api_key['X-Application-Key'] = 'YOUR API KEY'
|
|
109
116
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
@@ -112,14 +119,14 @@ Zyphr.configure do |config|
|
|
|
112
119
|
config.configure_faraday_connection { |connection| 'YOUR CONNECTION CONFIG PROC' }
|
|
113
120
|
end
|
|
114
121
|
|
|
115
|
-
api_instance = Zyphr::
|
|
122
|
+
api_instance = Zyphr::AuthApplicationApi.new
|
|
116
123
|
|
|
117
124
|
begin
|
|
118
|
-
#
|
|
119
|
-
result = api_instance.
|
|
125
|
+
#Get the authenticating application
|
|
126
|
+
result = api_instance.get_self_application
|
|
120
127
|
p result
|
|
121
128
|
rescue Zyphr::ApiError => e
|
|
122
|
-
puts "Exception when calling
|
|
129
|
+
puts "Exception when calling AuthApplicationApi->get_self_application: #{e}"
|
|
123
130
|
end
|
|
124
131
|
|
|
125
132
|
```
|
|
@@ -130,6 +137,7 @@ All URIs are relative to *https://api.zyphr.dev/v1*
|
|
|
130
137
|
|
|
131
138
|
Class | Method | HTTP request | Description
|
|
132
139
|
------------ | ------------- | ------------- | -------------
|
|
140
|
+
*Zyphr::AuthApplicationApi* | [**get_self_application**](docs/AuthApplicationApi.md#get_self_application) | **GET** /auth/application | Get the authenticating application
|
|
133
141
|
*Zyphr::AuthEmailOTPApi* | [**check_email_otp_availability**](docs/AuthEmailOTPApi.md#check_email_otp_availability) | **GET** /auth/email-otp/available | Check email OTP availability
|
|
134
142
|
*Zyphr::AuthEmailOTPApi* | [**send_email_otp_login**](docs/AuthEmailOTPApi.md#send_email_otp_login) | **POST** /auth/email-otp/login/send | Send email OTP for login
|
|
135
143
|
*Zyphr::AuthEmailOTPApi* | [**send_email_otp_registration**](docs/AuthEmailOTPApi.md#send_email_otp_registration) | **POST** /auth/email-otp/register/send | Send email OTP for registration
|
|
@@ -195,6 +203,7 @@ Class | Method | HTTP request | Description
|
|
|
195
203
|
*Zyphr::AuthSessionsApi* | [**revoke_all_end_user_sessions**](docs/AuthSessionsApi.md#revoke_all_end_user_sessions) | **POST** /auth/sessions/revoke-all | Revoke all sessions
|
|
196
204
|
*Zyphr::AuthSessionsApi* | [**revoke_end_user_session**](docs/AuthSessionsApi.md#revoke_end_user_session) | **POST** /auth/sessions/revoke | Revoke a session
|
|
197
205
|
*Zyphr::AuthUserDirectoryApi* | [**delete_end_user_by_application**](docs/AuthUserDirectoryApi.md#delete_end_user_by_application) | **DELETE** /auth/users/{user_id} | Delete an end user (server-side admin)
|
|
206
|
+
*Zyphr::AuthUserDirectoryApi* | [**get_end_user_auth_methods**](docs/AuthUserDirectoryApi.md#get_end_user_auth_methods) | **GET** /auth/users/{user_id}/auth-methods | Get an end user's sign-in methods (server-side admin)
|
|
198
207
|
*Zyphr::AuthUserDirectoryApi* | [**get_end_user_by_email**](docs/AuthUserDirectoryApi.md#get_end_user_by_email) | **GET** /auth/users/by-email | Look up an end user by email (server-side admin)
|
|
199
208
|
*Zyphr::AuthUserDirectoryApi* | [**get_end_user_by_id**](docs/AuthUserDirectoryApi.md#get_end_user_by_id) | **GET** /auth/users/{user_id} | Get an end user by id (server-side admin)
|
|
200
209
|
*Zyphr::AuthUserDirectoryApi* | [**get_end_user_claims**](docs/AuthUserDirectoryApi.md#get_end_user_claims) | **GET** /auth/users/{user_id}/claims | Get an end user's stored custom claims (server-side admin)
|
|
@@ -393,6 +402,8 @@ Class | Method | HTTP request | Description
|
|
|
393
402
|
- [Zyphr::ApiError](docs/ApiError.md)
|
|
394
403
|
- [Zyphr::ApiErrorError](docs/ApiErrorError.md)
|
|
395
404
|
- [Zyphr::ApiErrorMeta](docs/ApiErrorMeta.md)
|
|
405
|
+
- [Zyphr::ApplicationSelf](docs/ApplicationSelf.md)
|
|
406
|
+
- [Zyphr::ApplicationSelfResponse](docs/ApplicationSelfResponse.md)
|
|
396
407
|
- [Zyphr::AuthEmailTemplate](docs/AuthEmailTemplate.md)
|
|
397
408
|
- [Zyphr::AuthEmailTemplateDefault](docs/AuthEmailTemplateDefault.md)
|
|
398
409
|
- [Zyphr::AuthEmailTemplateDefaultResponse](docs/AuthEmailTemplateDefaultResponse.md)
|
|
@@ -413,6 +424,7 @@ Class | Method | HTTP request | Description
|
|
|
413
424
|
- [Zyphr::AuthLoginResponse](docs/AuthLoginResponse.md)
|
|
414
425
|
- [Zyphr::AuthLoginResult](docs/AuthLoginResult.md)
|
|
415
426
|
- [Zyphr::AuthLoginResultMfaChallenge](docs/AuthLoginResultMfaChallenge.md)
|
|
427
|
+
- [Zyphr::AuthMethods](docs/AuthMethods.md)
|
|
416
428
|
- [Zyphr::AuthResult](docs/AuthResult.md)
|
|
417
429
|
- [Zyphr::AuthResultResponse](docs/AuthResultResponse.md)
|
|
418
430
|
- [Zyphr::AuthSession](docs/AuthSession.md)
|
|
@@ -506,6 +518,7 @@ Class | Method | HTTP request | Description
|
|
|
506
518
|
- [Zyphr::GenerateWaaSPortalToken201Response](docs/GenerateWaaSPortalToken201Response.md)
|
|
507
519
|
- [Zyphr::GetDomain200Response](docs/GetDomain200Response.md)
|
|
508
520
|
- [Zyphr::GetDomain200ResponseMeta](docs/GetDomain200ResponseMeta.md)
|
|
521
|
+
- [Zyphr::GetEndUserAuthMethods200Response](docs/GetEndUserAuthMethods200Response.md)
|
|
509
522
|
- [Zyphr::GetEndUserById200Response](docs/GetEndUserById200Response.md)
|
|
510
523
|
- [Zyphr::GetEndUserClaims200Response](docs/GetEndUserClaims200Response.md)
|
|
511
524
|
- [Zyphr::GetEndUserClaims200ResponseData](docs/GetEndUserClaims200ResponseData.md)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Zyphr::ApplicationSelf
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **id** | **String** | The application's unique id (application_id). | |
|
|
8
|
+
| **name** | **String** | Human-readable application name. | |
|
|
9
|
+
| **environment** | **String** | The environment mode of the credentials used to authenticate this request. `null` when the environment cannot be determined (e.g. a legacy application-level key that predates environment-scoped keys) — not defaulted to a guessed value. | |
|
|
10
|
+
| **signing_algorithm** | **String** | JWT signing algorithm for this application's end-user tokens. | |
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'zyphr'
|
|
16
|
+
|
|
17
|
+
instance = Zyphr::ApplicationSelf.new(
|
|
18
|
+
id: null,
|
|
19
|
+
name: null,
|
|
20
|
+
environment: null,
|
|
21
|
+
signing_algorithm: null
|
|
22
|
+
)
|
|
23
|
+
```
|
|
24
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Zyphr::ApplicationSelfResponse
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **data** | [**ApplicationSelf**](ApplicationSelf.md) | | [optional] |
|
|
8
|
+
| **meta** | [**RequestMeta**](RequestMeta.md) | | [optional] |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'zyphr'
|
|
14
|
+
|
|
15
|
+
instance = Zyphr::ApplicationSelfResponse.new(
|
|
16
|
+
data: null,
|
|
17
|
+
meta: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Zyphr::AuthApplicationApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://api.zyphr.dev/v1*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
| ------ | ------------ | ----------- |
|
|
7
|
+
| [**get_self_application**](AuthApplicationApi.md#get_self_application) | **GET** /auth/application | Get the authenticating application |
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## get_self_application
|
|
11
|
+
|
|
12
|
+
> <ApplicationSelfResponse> get_self_application
|
|
13
|
+
|
|
14
|
+
Get the authenticating application
|
|
15
|
+
|
|
16
|
+
Return non-sensitive metadata about the application whose credentials authenticated this request. Lets an integrator read their own application_id (the sole tenant discriminator embedded in every end-user token) directly from the API, rather than only from the dashboard UI or by decoding a token. Returns only id, name, the calling environment's mode, and the JWT signing algorithm — never secrets, signing keys, or account-internal fields.
|
|
17
|
+
|
|
18
|
+
### Examples
|
|
19
|
+
|
|
20
|
+
```ruby
|
|
21
|
+
require 'time'
|
|
22
|
+
require 'zyphr'
|
|
23
|
+
# setup authorization
|
|
24
|
+
Zyphr.configure do |config|
|
|
25
|
+
# Configure API key authorization: ApplicationSecret
|
|
26
|
+
config.api_key['X-Application-Secret'] = 'YOUR API KEY'
|
|
27
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
28
|
+
# config.api_key_prefix['X-Application-Secret'] = 'Bearer'
|
|
29
|
+
|
|
30
|
+
# Configure API key authorization: ApplicationPublicKey
|
|
31
|
+
config.api_key['X-Application-Key'] = 'YOUR API KEY'
|
|
32
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
33
|
+
# config.api_key_prefix['X-Application-Key'] = 'Bearer'
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
api_instance = Zyphr::AuthApplicationApi.new
|
|
37
|
+
|
|
38
|
+
begin
|
|
39
|
+
# Get the authenticating application
|
|
40
|
+
result = api_instance.get_self_application
|
|
41
|
+
p result
|
|
42
|
+
rescue Zyphr::ApiError => e
|
|
43
|
+
puts "Error when calling AuthApplicationApi->get_self_application: #{e}"
|
|
44
|
+
end
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
#### Using the get_self_application_with_http_info variant
|
|
48
|
+
|
|
49
|
+
This returns an Array which contains the response data, status code and headers.
|
|
50
|
+
|
|
51
|
+
> <Array(<ApplicationSelfResponse>, Integer, Hash)> get_self_application_with_http_info
|
|
52
|
+
|
|
53
|
+
```ruby
|
|
54
|
+
begin
|
|
55
|
+
# Get the authenticating application
|
|
56
|
+
data, status_code, headers = api_instance.get_self_application_with_http_info
|
|
57
|
+
p status_code # => 2xx
|
|
58
|
+
p headers # => { ... }
|
|
59
|
+
p data # => <ApplicationSelfResponse>
|
|
60
|
+
rescue Zyphr::ApiError => e
|
|
61
|
+
puts "Error when calling AuthApplicationApi->get_self_application_with_http_info: #{e}"
|
|
62
|
+
end
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Parameters
|
|
66
|
+
|
|
67
|
+
This endpoint does not need any parameter.
|
|
68
|
+
|
|
69
|
+
### Return type
|
|
70
|
+
|
|
71
|
+
[**ApplicationSelfResponse**](ApplicationSelfResponse.md)
|
|
72
|
+
|
|
73
|
+
### Authorization
|
|
74
|
+
|
|
75
|
+
[ApplicationSecret](../README.md#ApplicationSecret), [ApplicationPublicKey](../README.md#ApplicationPublicKey)
|
|
76
|
+
|
|
77
|
+
### HTTP request headers
|
|
78
|
+
|
|
79
|
+
- **Content-Type**: Not defined
|
|
80
|
+
- **Accept**: application/json
|
|
81
|
+
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
| **to** | **String** | Recipient email. Must be in the application's `test_recipients` allowlist. | |
|
|
7
|
+
| **to** | **String** | Recipient email. Must be in the application's `test_recipients` allowlist. When non-empty, `test_recipients` gates ALL auth emails the application sends (magic link, password reset, verification, OTP) — only listed recipients receive auth email — which keeps non-production applications safe from mass sends. An empty allowlist imposes no restriction. | |
|
|
8
8
|
| **variables** | **Hash<String, Object>** | | [optional] |
|
|
9
9
|
|
|
10
10
|
## Example
|
|
@@ -631,7 +631,7 @@ end
|
|
|
631
631
|
|
|
632
632
|
Send a test render of a template
|
|
633
633
|
|
|
634
|
-
Renders the template (override or default) using sample/provided variables and sends to the recipient. The recipient must be in the application `test_recipients` allowlist. Rate-limited.
|
|
634
|
+
Renders the template (override or default) using sample/provided variables and sends to the recipient. The recipient must be in the application `test_recipients` allowlist. Rate-limited. When non-empty, `test_recipients` gates ALL auth emails this application sends (magic link, password reset, email verification, and email OTP) — not just these test renders. Only listed recipients receive auth email; any other recipient is silently blocked. Use it to make a non-production application safe from mass sends. An empty allowlist (the default) imposes no restriction and every recipient receives auth email normally.
|
|
635
635
|
|
|
636
636
|
### Examples
|
|
637
637
|
|
data/docs/AuthMethods.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Zyphr::AuthMethods
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **has_password** | **Boolean** | True if the user has a password credential (false for OAuth-only / passwordless users). | |
|
|
8
|
+
| **oauth_providers** | **Array<String>** | Distinct OAuth providers linked to the user (e.g. google, apple). | |
|
|
9
|
+
| **mfa_enabled** | **Boolean** | True if the user has multi-factor authentication enabled. | |
|
|
10
|
+
| **email_verified** | **Boolean** | True if the user's email address has been verified. | |
|
|
11
|
+
| **phone_verified** | **Boolean** | True if the user's phone number has been verified. | |
|
|
12
|
+
| **passkeys** | **Integer** | Number of WebAuthn passkeys registered for the user. | |
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```ruby
|
|
17
|
+
require 'zyphr'
|
|
18
|
+
|
|
19
|
+
instance = Zyphr::AuthMethods.new(
|
|
20
|
+
has_password: null,
|
|
21
|
+
oauth_providers: null,
|
|
22
|
+
mfa_enabled: null,
|
|
23
|
+
email_verified: null,
|
|
24
|
+
phone_verified: null,
|
|
25
|
+
passkeys: null
|
|
26
|
+
)
|
|
27
|
+
```
|
|
28
|
+
|
|
@@ -5,6 +5,7 @@ All URIs are relative to *https://api.zyphr.dev/v1*
|
|
|
5
5
|
| Method | HTTP request | Description |
|
|
6
6
|
| ------ | ------------ | ----------- |
|
|
7
7
|
| [**delete_end_user_by_application**](AuthUserDirectoryApi.md#delete_end_user_by_application) | **DELETE** /auth/users/{user_id} | Delete an end user (server-side admin) |
|
|
8
|
+
| [**get_end_user_auth_methods**](AuthUserDirectoryApi.md#get_end_user_auth_methods) | **GET** /auth/users/{user_id}/auth-methods | Get an end user's sign-in methods (server-side admin) |
|
|
8
9
|
| [**get_end_user_by_email**](AuthUserDirectoryApi.md#get_end_user_by_email) | **GET** /auth/users/by-email | Look up an end user by email (server-side admin) |
|
|
9
10
|
| [**get_end_user_by_id**](AuthUserDirectoryApi.md#get_end_user_by_id) | **GET** /auth/users/{user_id} | Get an end user by id (server-side admin) |
|
|
10
11
|
| [**get_end_user_claims**](AuthUserDirectoryApi.md#get_end_user_claims) | **GET** /auth/users/{user_id}/claims | Get an end user's stored custom claims (server-side admin) |
|
|
@@ -89,6 +90,82 @@ nil (empty response body)
|
|
|
89
90
|
- **Accept**: Not defined
|
|
90
91
|
|
|
91
92
|
|
|
93
|
+
## get_end_user_auth_methods
|
|
94
|
+
|
|
95
|
+
> <GetEndUserAuthMethods200Response> get_end_user_auth_methods(user_id)
|
|
96
|
+
|
|
97
|
+
Get an end user's sign-in methods (server-side admin)
|
|
98
|
+
|
|
99
|
+
Secret-key-scoped, aggregate view of the sign-in methods configured for a single end user within the authenticating application. Reports whether the user has a password, which OAuth providers are linked, whether MFA is enabled, whether email/phone are verified, and how many passkeys are registered — everything a customer admin needs to build a \"sign-in methods\" screen. Scoped to the application — a caller can never read a user belonging to another application.
|
|
100
|
+
|
|
101
|
+
### Examples
|
|
102
|
+
|
|
103
|
+
```ruby
|
|
104
|
+
require 'time'
|
|
105
|
+
require 'zyphr'
|
|
106
|
+
# setup authorization
|
|
107
|
+
Zyphr.configure do |config|
|
|
108
|
+
# Configure API key authorization: ApplicationSecret
|
|
109
|
+
config.api_key['X-Application-Secret'] = 'YOUR API KEY'
|
|
110
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
111
|
+
# config.api_key_prefix['X-Application-Secret'] = 'Bearer'
|
|
112
|
+
|
|
113
|
+
# Configure API key authorization: ApplicationPublicKey
|
|
114
|
+
config.api_key['X-Application-Key'] = 'YOUR API KEY'
|
|
115
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
116
|
+
# config.api_key_prefix['X-Application-Key'] = 'Bearer'
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
api_instance = Zyphr::AuthUserDirectoryApi.new
|
|
120
|
+
user_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String |
|
|
121
|
+
|
|
122
|
+
begin
|
|
123
|
+
# Get an end user's sign-in methods (server-side admin)
|
|
124
|
+
result = api_instance.get_end_user_auth_methods(user_id)
|
|
125
|
+
p result
|
|
126
|
+
rescue Zyphr::ApiError => e
|
|
127
|
+
puts "Error when calling AuthUserDirectoryApi->get_end_user_auth_methods: #{e}"
|
|
128
|
+
end
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
#### Using the get_end_user_auth_methods_with_http_info variant
|
|
132
|
+
|
|
133
|
+
This returns an Array which contains the response data, status code and headers.
|
|
134
|
+
|
|
135
|
+
> <Array(<GetEndUserAuthMethods200Response>, Integer, Hash)> get_end_user_auth_methods_with_http_info(user_id)
|
|
136
|
+
|
|
137
|
+
```ruby
|
|
138
|
+
begin
|
|
139
|
+
# Get an end user's sign-in methods (server-side admin)
|
|
140
|
+
data, status_code, headers = api_instance.get_end_user_auth_methods_with_http_info(user_id)
|
|
141
|
+
p status_code # => 2xx
|
|
142
|
+
p headers # => { ... }
|
|
143
|
+
p data # => <GetEndUserAuthMethods200Response>
|
|
144
|
+
rescue Zyphr::ApiError => e
|
|
145
|
+
puts "Error when calling AuthUserDirectoryApi->get_end_user_auth_methods_with_http_info: #{e}"
|
|
146
|
+
end
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Parameters
|
|
150
|
+
|
|
151
|
+
| Name | Type | Description | Notes |
|
|
152
|
+
| ---- | ---- | ----------- | ----- |
|
|
153
|
+
| **user_id** | **String** | | |
|
|
154
|
+
|
|
155
|
+
### Return type
|
|
156
|
+
|
|
157
|
+
[**GetEndUserAuthMethods200Response**](GetEndUserAuthMethods200Response.md)
|
|
158
|
+
|
|
159
|
+
### Authorization
|
|
160
|
+
|
|
161
|
+
[ApplicationSecret](../README.md#ApplicationSecret), [ApplicationPublicKey](../README.md#ApplicationPublicKey)
|
|
162
|
+
|
|
163
|
+
### HTTP request headers
|
|
164
|
+
|
|
165
|
+
- **Content-Type**: Not defined
|
|
166
|
+
- **Accept**: application/json
|
|
167
|
+
|
|
168
|
+
|
|
92
169
|
## get_end_user_by_email
|
|
93
170
|
|
|
94
171
|
> <GetEndUserById200Response> get_end_user_by_email(email)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Zyphr::GetEndUserAuthMethods200Response
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **data** | [**AuthMethods**](AuthMethods.md) | | [optional] |
|
|
8
|
+
| **meta** | [**GetDomain200ResponseMeta**](GetDomain200ResponseMeta.md) | | [optional] |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'zyphr'
|
|
14
|
+
|
|
15
|
+
instance = Zyphr::GetEndUserAuthMethods200Response.new(
|
|
16
|
+
data: null,
|
|
17
|
+
meta: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zyphr API
|
|
3
|
+
|
|
4
|
+
#Zyphr is a multi-channel notification platform that enables developers to send emails, push notifications, SMS, and in-app messages through a unified API. ## Authentication All API requests require authentication using an API key. Include your API key in the `X-API-Key` header: ``` X-API-Key: zy_live_xxxxxxxxxxxx ``` API keys can be created in the Zyphr Dashboard. Use `zy_test_*` keys for testing and `zy_live_*` keys for production. ## Rate Limiting The API implements rate limiting to ensure fair usage. Rate limit information is included in response headers: - `X-RateLimit-Limit`: Maximum requests per window - `X-RateLimit-Remaining`: Remaining requests in current window - `X-RateLimit-Reset`: Unix timestamp when the window resets ## Account Sending Status Every authenticated response carries the account's current sending state so you can surface it in your own tooling without a separate call: - `X-Account-Sending-Status`: `active`, `throttled`, or `frozen` - `X-Account-Sending-Status-Reason`: human-readable reason (present only when the status is `throttled` or `frozen`) This header is informational and non-blocking on non-send endpoints (reads, billing, and deliverability stay available). Send-capable endpoints additionally enforce the state: a frozen account receives `403 account_frozen` and a throttled account receives `429 account_throttled`, both with the reason in the error message. ## Errors All errors follow a consistent format: ```json { \"error\": { \"code\": \"error_code\", \"message\": \"Human readable message\", \"details\": {} }, \"meta\": { \"request_id\": \"req_xxxx\" } } ```
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: support@zyphr.dev
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.12.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Zyphr
|
|
16
|
+
class AuthApplicationApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Get the authenticating application
|
|
23
|
+
# Return non-sensitive metadata about the application whose credentials authenticated this request. Lets an integrator read their own application_id (the sole tenant discriminator embedded in every end-user token) directly from the API, rather than only from the dashboard UI or by decoding a token. Returns only id, name, the calling environment's mode, and the JWT signing algorithm — never secrets, signing keys, or account-internal fields.
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @return [ApplicationSelfResponse]
|
|
26
|
+
def get_self_application(opts = {})
|
|
27
|
+
data, _status_code, _headers = get_self_application_with_http_info(opts)
|
|
28
|
+
data
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Get the authenticating application
|
|
32
|
+
# Return non-sensitive metadata about the application whose credentials authenticated this request. Lets an integrator read their own application_id (the sole tenant discriminator embedded in every end-user token) directly from the API, rather than only from the dashboard UI or by decoding a token. Returns only id, name, the calling environment's mode, and the JWT signing algorithm — never secrets, signing keys, or account-internal fields.
|
|
33
|
+
# @param [Hash] opts the optional parameters
|
|
34
|
+
# @return [Array<(ApplicationSelfResponse, Integer, Hash)>] ApplicationSelfResponse data, response status code and response headers
|
|
35
|
+
def get_self_application_with_http_info(opts = {})
|
|
36
|
+
if @api_client.config.debugging
|
|
37
|
+
@api_client.config.logger.debug 'Calling API: AuthApplicationApi.get_self_application ...'
|
|
38
|
+
end
|
|
39
|
+
# resource path
|
|
40
|
+
local_var_path = '/auth/application'
|
|
41
|
+
|
|
42
|
+
# query parameters
|
|
43
|
+
query_params = opts[:query_params] || {}
|
|
44
|
+
|
|
45
|
+
# header parameters
|
|
46
|
+
header_params = opts[:header_params] || {}
|
|
47
|
+
# HTTP header 'Accept' (if needed)
|
|
48
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
49
|
+
|
|
50
|
+
# form parameters
|
|
51
|
+
form_params = opts[:form_params] || {}
|
|
52
|
+
|
|
53
|
+
# http body (model)
|
|
54
|
+
post_body = opts[:debug_body]
|
|
55
|
+
|
|
56
|
+
# return_type
|
|
57
|
+
return_type = opts[:debug_return_type] || 'ApplicationSelfResponse'
|
|
58
|
+
|
|
59
|
+
# auth_names
|
|
60
|
+
auth_names = opts[:debug_auth_names] || ['ApplicationSecret', 'ApplicationPublicKey']
|
|
61
|
+
|
|
62
|
+
new_options = opts.merge(
|
|
63
|
+
:operation => :"AuthApplicationApi.get_self_application",
|
|
64
|
+
:header_params => header_params,
|
|
65
|
+
:query_params => query_params,
|
|
66
|
+
:form_params => form_params,
|
|
67
|
+
:body => post_body,
|
|
68
|
+
:auth_names => auth_names,
|
|
69
|
+
:return_type => return_type
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
73
|
+
if @api_client.config.debugging
|
|
74
|
+
@api_client.config.logger.debug "API called: AuthApplicationApi#get_self_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
75
|
+
end
|
|
76
|
+
return data, status_code, headers
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
@@ -538,7 +538,7 @@ module Zyphr
|
|
|
538
538
|
end
|
|
539
539
|
|
|
540
540
|
# Send a test render of a template
|
|
541
|
-
# Renders the template (override or default) using sample/provided variables and sends to the recipient. The recipient must be in the application `test_recipients` allowlist. Rate-limited.
|
|
541
|
+
# Renders the template (override or default) using sample/provided variables and sends to the recipient. The recipient must be in the application `test_recipients` allowlist. Rate-limited. When non-empty, `test_recipients` gates ALL auth emails this application sends (magic link, password reset, email verification, and email OTP) — not just these test renders. Only listed recipients receive auth email; any other recipient is silently blocked. Use it to make a non-production application safe from mass sends. An empty allowlist (the default) imposes no restriction and every recipient receives auth email normally.
|
|
542
542
|
# @param type [AuthEmailType]
|
|
543
543
|
# @param auth_email_template_test_request [AuthEmailTemplateTestRequest]
|
|
544
544
|
# @param [Hash] opts the optional parameters
|
|
@@ -549,7 +549,7 @@ module Zyphr
|
|
|
549
549
|
end
|
|
550
550
|
|
|
551
551
|
# Send a test render of a template
|
|
552
|
-
# Renders the template (override or default) using sample/provided variables and sends to the recipient. The recipient must be in the application `test_recipients` allowlist. Rate-limited.
|
|
552
|
+
# Renders the template (override or default) using sample/provided variables and sends to the recipient. The recipient must be in the application `test_recipients` allowlist. Rate-limited. When non-empty, `test_recipients` gates ALL auth emails this application sends (magic link, password reset, email verification, and email OTP) — not just these test renders. Only listed recipients receive auth email; any other recipient is silently blocked. Use it to make a non-production application safe from mass sends. An empty allowlist (the default) imposes no restriction and every recipient receives auth email normally.
|
|
553
553
|
# @param type [AuthEmailType]
|
|
554
554
|
# @param auth_email_template_test_request [AuthEmailTemplateTestRequest]
|
|
555
555
|
# @param [Hash] opts the optional parameters
|
|
@@ -80,6 +80,69 @@ module Zyphr
|
|
|
80
80
|
return data, status_code, headers
|
|
81
81
|
end
|
|
82
82
|
|
|
83
|
+
# Get an end user's sign-in methods (server-side admin)
|
|
84
|
+
# Secret-key-scoped, aggregate view of the sign-in methods configured for a single end user within the authenticating application. Reports whether the user has a password, which OAuth providers are linked, whether MFA is enabled, whether email/phone are verified, and how many passkeys are registered — everything a customer admin needs to build a \"sign-in methods\" screen. Scoped to the application — a caller can never read a user belonging to another application.
|
|
85
|
+
# @param user_id [String]
|
|
86
|
+
# @param [Hash] opts the optional parameters
|
|
87
|
+
# @return [GetEndUserAuthMethods200Response]
|
|
88
|
+
def get_end_user_auth_methods(user_id, opts = {})
|
|
89
|
+
data, _status_code, _headers = get_end_user_auth_methods_with_http_info(user_id, opts)
|
|
90
|
+
data
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Get an end user's sign-in methods (server-side admin)
|
|
94
|
+
# Secret-key-scoped, aggregate view of the sign-in methods configured for a single end user within the authenticating application. Reports whether the user has a password, which OAuth providers are linked, whether MFA is enabled, whether email/phone are verified, and how many passkeys are registered — everything a customer admin needs to build a \"sign-in methods\" screen. Scoped to the application — a caller can never read a user belonging to another application.
|
|
95
|
+
# @param user_id [String]
|
|
96
|
+
# @param [Hash] opts the optional parameters
|
|
97
|
+
# @return [Array<(GetEndUserAuthMethods200Response, Integer, Hash)>] GetEndUserAuthMethods200Response data, response status code and response headers
|
|
98
|
+
def get_end_user_auth_methods_with_http_info(user_id, opts = {})
|
|
99
|
+
if @api_client.config.debugging
|
|
100
|
+
@api_client.config.logger.debug 'Calling API: AuthUserDirectoryApi.get_end_user_auth_methods ...'
|
|
101
|
+
end
|
|
102
|
+
# verify the required parameter 'user_id' is set
|
|
103
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
104
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AuthUserDirectoryApi.get_end_user_auth_methods"
|
|
105
|
+
end
|
|
106
|
+
# resource path
|
|
107
|
+
local_var_path = '/auth/users/{user_id}/auth-methods'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
|
|
108
|
+
|
|
109
|
+
# query parameters
|
|
110
|
+
query_params = opts[:query_params] || {}
|
|
111
|
+
|
|
112
|
+
# header parameters
|
|
113
|
+
header_params = opts[:header_params] || {}
|
|
114
|
+
# HTTP header 'Accept' (if needed)
|
|
115
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
116
|
+
|
|
117
|
+
# form parameters
|
|
118
|
+
form_params = opts[:form_params] || {}
|
|
119
|
+
|
|
120
|
+
# http body (model)
|
|
121
|
+
post_body = opts[:debug_body]
|
|
122
|
+
|
|
123
|
+
# return_type
|
|
124
|
+
return_type = opts[:debug_return_type] || 'GetEndUserAuthMethods200Response'
|
|
125
|
+
|
|
126
|
+
# auth_names
|
|
127
|
+
auth_names = opts[:debug_auth_names] || ['ApplicationSecret', 'ApplicationPublicKey']
|
|
128
|
+
|
|
129
|
+
new_options = opts.merge(
|
|
130
|
+
:operation => :"AuthUserDirectoryApi.get_end_user_auth_methods",
|
|
131
|
+
:header_params => header_params,
|
|
132
|
+
:query_params => query_params,
|
|
133
|
+
:form_params => form_params,
|
|
134
|
+
:body => post_body,
|
|
135
|
+
:auth_names => auth_names,
|
|
136
|
+
:return_type => return_type
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
140
|
+
if @api_client.config.debugging
|
|
141
|
+
@api_client.config.logger.debug "API called: AuthUserDirectoryApi#get_end_user_auth_methods\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
142
|
+
end
|
|
143
|
+
return data, status_code, headers
|
|
144
|
+
end
|
|
145
|
+
|
|
83
146
|
# Look up an end user by email (server-side admin)
|
|
84
147
|
# Secret-key-scoped lookup of a single end user by email address within the authenticating application. Scoped to the application — never resolves a user from another application. Does not return the password hash.
|
|
85
148
|
# @param email [String]
|