zyphr 0.1.50 → 0.1.52
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 +6 -0
- data/docs/AuthOAuthApi.md +154 -0
- data/docs/OAuthAuthorizeResponse.md +20 -0
- data/docs/OAuthAuthorizeResponseData.md +20 -0
- data/docs/OAuthLinkResponse.md +20 -0
- data/docs/OAuthLinkResponseData.md +20 -0
- data/docs/PasswordPolicy.md +3 -1
- data/docs/PasswordStrength.md +6 -2
- data/lib/zyphr/api/auth_o_auth_api.rb +144 -0
- data/lib/zyphr/models/o_auth_authorize_response.rb +229 -0
- data/lib/zyphr/models/o_auth_authorize_response_data.rb +231 -0
- data/lib/zyphr/models/o_auth_link_response.rb +229 -0
- data/lib/zyphr/models/o_auth_link_response_data.rb +229 -0
- data/lib/zyphr/models/password_policy.rb +31 -4
- data/lib/zyphr/models/password_strength.rb +66 -3
- data/lib/zyphr.rb +4 -0
- data/spec/api/auth_o_auth_api_spec.rb +26 -0
- data/spec/models/o_auth_authorize_response_data_spec.rb +42 -0
- data/spec/models/o_auth_authorize_response_spec.rb +42 -0
- data/spec/models/o_auth_link_response_data_spec.rb +42 -0
- data/spec/models/o_auth_link_response_spec.rb +42 -0
- data/spec/models/password_policy_spec.rb +6 -0
- data/spec/models/password_strength_spec.rb +12 -0
- data/zyphr.gemspec +1 -1
- metadata +17 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f75ed6cc534f48323ebfd87603494f864ccaa1a04c92fe195f57259314cb8f37
|
|
4
|
+
data.tar.gz: 718da4c96ac21ee903d062e2571cf277ba0f79cfc60c6afd73ffe9b92eb57277
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d502a6ef3e460bbbf38adda6c8c0a9752860e07e1fbf50fdd51191e6964ee494a9ab6fa3142ba4bb6ad5046e2a0436dce6edbde6458c5d843c3eefb09eb5e326
|
|
7
|
+
data.tar.gz: 92a8acd011029ec21a5b872189a875ae4529a387cf669f560b36a63b20ad89b3dc1eb5bee28a167b0aac65f663e8f0b7146e766264873178e2344fcbf8cc1c34
|
data/README.md
CHANGED
|
@@ -167,6 +167,7 @@ Class | Method | HTTP request | Description
|
|
|
167
167
|
*Zyphr::AuthMFAApi* | [**verify_mfa_enrollment**](docs/AuthMFAApi.md#verify_mfa_enrollment) | **POST** /auth/mfa/verify-enrollment | Verify MFA enrollment
|
|
168
168
|
*Zyphr::AuthMagicLinksApi* | [**send_magic_link**](docs/AuthMagicLinksApi.md#send_magic_link) | **POST** /auth/magic-link/send | Send a magic link
|
|
169
169
|
*Zyphr::AuthMagicLinksApi* | [**verify_magic_link**](docs/AuthMagicLinksApi.md#verify_magic_link) | **POST** /auth/magic-link/verify | Verify a magic link
|
|
170
|
+
*Zyphr::AuthOAuthApi* | [**complete_o_auth_link**](docs/AuthOAuthApi.md#complete_o_auth_link) | **POST** /auth/oauth/{provider}/link/callback | Complete linking an OAuth provider to the current account
|
|
170
171
|
*Zyphr::AuthOAuthApi* | [**disconnect_o_auth_provider**](docs/AuthOAuthApi.md#disconnect_o_auth_provider) | **DELETE** /auth/oauth/{provider} | Disconnect OAuth provider
|
|
171
172
|
*Zyphr::AuthOAuthApi* | [**get_o_auth_authorization_url**](docs/AuthOAuthApi.md#get_o_auth_authorization_url) | **GET** /auth/oauth/{provider}/authorize | Get OAuth authorization URL
|
|
172
173
|
*Zyphr::AuthOAuthApi* | [**get_o_auth_connection_info**](docs/AuthOAuthApi.md#get_o_auth_connection_info) | **GET** /auth/oauth/connections/{provider} | Get OAuth connection info
|
|
@@ -175,6 +176,7 @@ Class | Method | HTTP request | Description
|
|
|
175
176
|
*Zyphr::AuthOAuthApi* | [**list_o_auth_connections**](docs/AuthOAuthApi.md#list_o_auth_connections) | **GET** /auth/oauth/connections | List OAuth connections
|
|
176
177
|
*Zyphr::AuthOAuthApi* | [**list_o_auth_providers**](docs/AuthOAuthApi.md#list_o_auth_providers) | **GET** /auth/oauth/providers | List OAuth providers
|
|
177
178
|
*Zyphr::AuthOAuthApi* | [**refresh_o_auth_tokens**](docs/AuthOAuthApi.md#refresh_o_auth_tokens) | **POST** /auth/oauth/tokens/{provider}/refresh | Refresh OAuth provider tokens
|
|
179
|
+
*Zyphr::AuthOAuthApi* | [**start_o_auth_link**](docs/AuthOAuthApi.md#start_o_auth_link) | **GET** /auth/oauth/{provider}/link | Start linking an OAuth provider to the current account
|
|
178
180
|
*Zyphr::AuthOrganizationsApi* | [**add_organization_member**](docs/AuthOrganizationsApi.md#add_organization_member) | **POST** /auth/organizations/{id}/members | Add a member to an organization
|
|
179
181
|
*Zyphr::AuthOrganizationsApi* | [**create_organization**](docs/AuthOrganizationsApi.md#create_organization) | **POST** /auth/organizations | Create an organization
|
|
180
182
|
*Zyphr::AuthOrganizationsApi* | [**delete_organization**](docs/AuthOrganizationsApi.md#delete_organization) | **DELETE** /auth/organizations/{id} | Delete an organization
|
|
@@ -598,6 +600,8 @@ Class | Method | HTTP request | Description
|
|
|
598
600
|
- [Zyphr::MfaVerifyRequest](docs/MfaVerifyRequest.md)
|
|
599
601
|
- [Zyphr::OAuthAuthorizationUrlResponse](docs/OAuthAuthorizationUrlResponse.md)
|
|
600
602
|
- [Zyphr::OAuthAuthorizationUrlResponseData](docs/OAuthAuthorizationUrlResponseData.md)
|
|
603
|
+
- [Zyphr::OAuthAuthorizeResponse](docs/OAuthAuthorizeResponse.md)
|
|
604
|
+
- [Zyphr::OAuthAuthorizeResponseData](docs/OAuthAuthorizeResponseData.md)
|
|
601
605
|
- [Zyphr::OAuthCallbackRequest](docs/OAuthCallbackRequest.md)
|
|
602
606
|
- [Zyphr::OAuthCallbackResponse](docs/OAuthCallbackResponse.md)
|
|
603
607
|
- [Zyphr::OAuthCallbackResponseData](docs/OAuthCallbackResponseData.md)
|
|
@@ -606,6 +610,8 @@ Class | Method | HTTP request | Description
|
|
|
606
610
|
- [Zyphr::OAuthConnectionInfoResponseData](docs/OAuthConnectionInfoResponseData.md)
|
|
607
611
|
- [Zyphr::OAuthConnectionsResponse](docs/OAuthConnectionsResponse.md)
|
|
608
612
|
- [Zyphr::OAuthConnectionsResponseData](docs/OAuthConnectionsResponseData.md)
|
|
613
|
+
- [Zyphr::OAuthLinkResponse](docs/OAuthLinkResponse.md)
|
|
614
|
+
- [Zyphr::OAuthLinkResponseData](docs/OAuthLinkResponseData.md)
|
|
609
615
|
- [Zyphr::OAuthProvider](docs/OAuthProvider.md)
|
|
610
616
|
- [Zyphr::OAuthProviderInfo](docs/OAuthProviderInfo.md)
|
|
611
617
|
- [Zyphr::OAuthProviderName](docs/OAuthProviderName.md)
|
data/docs/AuthOAuthApi.md
CHANGED
|
@@ -4,6 +4,7 @@ All URIs are relative to *https://api.zyphr.dev/v1*
|
|
|
4
4
|
|
|
5
5
|
| Method | HTTP request | Description |
|
|
6
6
|
| ------ | ------------ | ----------- |
|
|
7
|
+
| [**complete_o_auth_link**](AuthOAuthApi.md#complete_o_auth_link) | **POST** /auth/oauth/{provider}/link/callback | Complete linking an OAuth provider to the current account |
|
|
7
8
|
| [**disconnect_o_auth_provider**](AuthOAuthApi.md#disconnect_o_auth_provider) | **DELETE** /auth/oauth/{provider} | Disconnect OAuth provider |
|
|
8
9
|
| [**get_o_auth_authorization_url**](AuthOAuthApi.md#get_o_auth_authorization_url) | **GET** /auth/oauth/{provider}/authorize | Get OAuth authorization URL |
|
|
9
10
|
| [**get_o_auth_connection_info**](AuthOAuthApi.md#get_o_auth_connection_info) | **GET** /auth/oauth/connections/{provider} | Get OAuth connection info |
|
|
@@ -12,6 +13,83 @@ All URIs are relative to *https://api.zyphr.dev/v1*
|
|
|
12
13
|
| [**list_o_auth_connections**](AuthOAuthApi.md#list_o_auth_connections) | **GET** /auth/oauth/connections | List OAuth connections |
|
|
13
14
|
| [**list_o_auth_providers**](AuthOAuthApi.md#list_o_auth_providers) | **GET** /auth/oauth/providers | List OAuth providers |
|
|
14
15
|
| [**refresh_o_auth_tokens**](AuthOAuthApi.md#refresh_o_auth_tokens) | **POST** /auth/oauth/tokens/{provider}/refresh | Refresh OAuth provider tokens |
|
|
16
|
+
| [**start_o_auth_link**](AuthOAuthApi.md#start_o_auth_link) | **GET** /auth/oauth/{provider}/link | Start linking an OAuth provider to the current account |
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## complete_o_auth_link
|
|
20
|
+
|
|
21
|
+
> <OAuthLinkResponse> complete_o_auth_link(provider, o_auth_callback_request)
|
|
22
|
+
|
|
23
|
+
Complete linking an OAuth provider to the current account
|
|
24
|
+
|
|
25
|
+
Complete an authenticated account-linking flow started via the link authorize endpoint. Attaches the resolved provider identity to the current end user. Rejects if the provider identity is already linked to a different account, if the provider did not verify the email, or if the linking session does not belong to the authenticated user.
|
|
26
|
+
|
|
27
|
+
### Examples
|
|
28
|
+
|
|
29
|
+
```ruby
|
|
30
|
+
require 'time'
|
|
31
|
+
require 'zyphr'
|
|
32
|
+
# setup authorization
|
|
33
|
+
Zyphr.configure do |config|
|
|
34
|
+
# Configure Bearer authorization (JWT): EndUserToken
|
|
35
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
36
|
+
|
|
37
|
+
# Configure API key authorization: ApplicationPublicKey
|
|
38
|
+
config.api_key['X-Application-Key'] = 'YOUR API KEY'
|
|
39
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
40
|
+
# config.api_key_prefix['X-Application-Key'] = 'Bearer'
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
api_instance = Zyphr::AuthOAuthApi.new
|
|
44
|
+
provider = Zyphr::OAuthProviderName::GOOGLE # OAuthProviderName | OAuth provider name
|
|
45
|
+
o_auth_callback_request = Zyphr::OAuthCallbackRequest.new({code: 'code_example', state: 'state_example'}) # OAuthCallbackRequest |
|
|
46
|
+
|
|
47
|
+
begin
|
|
48
|
+
# Complete linking an OAuth provider to the current account
|
|
49
|
+
result = api_instance.complete_o_auth_link(provider, o_auth_callback_request)
|
|
50
|
+
p result
|
|
51
|
+
rescue Zyphr::ApiError => e
|
|
52
|
+
puts "Error when calling AuthOAuthApi->complete_o_auth_link: #{e}"
|
|
53
|
+
end
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
#### Using the complete_o_auth_link_with_http_info variant
|
|
57
|
+
|
|
58
|
+
This returns an Array which contains the response data, status code and headers.
|
|
59
|
+
|
|
60
|
+
> <Array(<OAuthLinkResponse>, Integer, Hash)> complete_o_auth_link_with_http_info(provider, o_auth_callback_request)
|
|
61
|
+
|
|
62
|
+
```ruby
|
|
63
|
+
begin
|
|
64
|
+
# Complete linking an OAuth provider to the current account
|
|
65
|
+
data, status_code, headers = api_instance.complete_o_auth_link_with_http_info(provider, o_auth_callback_request)
|
|
66
|
+
p status_code # => 2xx
|
|
67
|
+
p headers # => { ... }
|
|
68
|
+
p data # => <OAuthLinkResponse>
|
|
69
|
+
rescue Zyphr::ApiError => e
|
|
70
|
+
puts "Error when calling AuthOAuthApi->complete_o_auth_link_with_http_info: #{e}"
|
|
71
|
+
end
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Parameters
|
|
75
|
+
|
|
76
|
+
| Name | Type | Description | Notes |
|
|
77
|
+
| ---- | ---- | ----------- | ----- |
|
|
78
|
+
| **provider** | [**OAuthProviderName**](.md) | OAuth provider name | |
|
|
79
|
+
| **o_auth_callback_request** | [**OAuthCallbackRequest**](OAuthCallbackRequest.md) | | |
|
|
80
|
+
|
|
81
|
+
### Return type
|
|
82
|
+
|
|
83
|
+
[**OAuthLinkResponse**](OAuthLinkResponse.md)
|
|
84
|
+
|
|
85
|
+
### Authorization
|
|
86
|
+
|
|
87
|
+
[EndUserToken](../README.md#EndUserToken), [ApplicationPublicKey](../README.md#ApplicationPublicKey)
|
|
88
|
+
|
|
89
|
+
### HTTP request headers
|
|
90
|
+
|
|
91
|
+
- **Content-Type**: application/json
|
|
92
|
+
- **Accept**: application/json
|
|
15
93
|
|
|
16
94
|
|
|
17
95
|
## disconnect_o_auth_provider
|
|
@@ -595,3 +673,79 @@ end
|
|
|
595
673
|
- **Content-Type**: application/json
|
|
596
674
|
- **Accept**: application/json
|
|
597
675
|
|
|
676
|
+
|
|
677
|
+
## start_o_auth_link
|
|
678
|
+
|
|
679
|
+
> <OAuthAuthorizeResponse> start_o_auth_link(provider, redirect_uri)
|
|
680
|
+
|
|
681
|
+
Start linking an OAuth provider to the current account
|
|
682
|
+
|
|
683
|
+
Begin an authenticated account-linking flow. Unlike the sign-in authorize endpoint, this binds the current end user into the OAuth state so the matching link callback attaches the returned provider identity to THIS account instead of finding-or-creating a user. Requires an end-user token.
|
|
684
|
+
|
|
685
|
+
### Examples
|
|
686
|
+
|
|
687
|
+
```ruby
|
|
688
|
+
require 'time'
|
|
689
|
+
require 'zyphr'
|
|
690
|
+
# setup authorization
|
|
691
|
+
Zyphr.configure do |config|
|
|
692
|
+
# Configure Bearer authorization (JWT): EndUserToken
|
|
693
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
694
|
+
|
|
695
|
+
# Configure API key authorization: ApplicationPublicKey
|
|
696
|
+
config.api_key['X-Application-Key'] = 'YOUR API KEY'
|
|
697
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
698
|
+
# config.api_key_prefix['X-Application-Key'] = 'Bearer'
|
|
699
|
+
end
|
|
700
|
+
|
|
701
|
+
api_instance = Zyphr::AuthOAuthApi.new
|
|
702
|
+
provider = Zyphr::OAuthProviderName::GOOGLE # OAuthProviderName | OAuth provider name
|
|
703
|
+
redirect_uri = 'redirect_uri_example' # String | Redirect URI registered for the application
|
|
704
|
+
|
|
705
|
+
begin
|
|
706
|
+
# Start linking an OAuth provider to the current account
|
|
707
|
+
result = api_instance.start_o_auth_link(provider, redirect_uri)
|
|
708
|
+
p result
|
|
709
|
+
rescue Zyphr::ApiError => e
|
|
710
|
+
puts "Error when calling AuthOAuthApi->start_o_auth_link: #{e}"
|
|
711
|
+
end
|
|
712
|
+
```
|
|
713
|
+
|
|
714
|
+
#### Using the start_o_auth_link_with_http_info variant
|
|
715
|
+
|
|
716
|
+
This returns an Array which contains the response data, status code and headers.
|
|
717
|
+
|
|
718
|
+
> <Array(<OAuthAuthorizeResponse>, Integer, Hash)> start_o_auth_link_with_http_info(provider, redirect_uri)
|
|
719
|
+
|
|
720
|
+
```ruby
|
|
721
|
+
begin
|
|
722
|
+
# Start linking an OAuth provider to the current account
|
|
723
|
+
data, status_code, headers = api_instance.start_o_auth_link_with_http_info(provider, redirect_uri)
|
|
724
|
+
p status_code # => 2xx
|
|
725
|
+
p headers # => { ... }
|
|
726
|
+
p data # => <OAuthAuthorizeResponse>
|
|
727
|
+
rescue Zyphr::ApiError => e
|
|
728
|
+
puts "Error when calling AuthOAuthApi->start_o_auth_link_with_http_info: #{e}"
|
|
729
|
+
end
|
|
730
|
+
```
|
|
731
|
+
|
|
732
|
+
### Parameters
|
|
733
|
+
|
|
734
|
+
| Name | Type | Description | Notes |
|
|
735
|
+
| ---- | ---- | ----------- | ----- |
|
|
736
|
+
| **provider** | [**OAuthProviderName**](.md) | OAuth provider name | |
|
|
737
|
+
| **redirect_uri** | **String** | Redirect URI registered for the application | |
|
|
738
|
+
|
|
739
|
+
### Return type
|
|
740
|
+
|
|
741
|
+
[**OAuthAuthorizeResponse**](OAuthAuthorizeResponse.md)
|
|
742
|
+
|
|
743
|
+
### Authorization
|
|
744
|
+
|
|
745
|
+
[EndUserToken](../README.md#EndUserToken), [ApplicationPublicKey](../README.md#ApplicationPublicKey)
|
|
746
|
+
|
|
747
|
+
### HTTP request headers
|
|
748
|
+
|
|
749
|
+
- **Content-Type**: Not defined
|
|
750
|
+
- **Accept**: application/json
|
|
751
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Zyphr::OAuthAuthorizeResponse
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **data** | [**OAuthAuthorizeResponseData**](OAuthAuthorizeResponseData.md) | | [optional] |
|
|
8
|
+
| **meta** | [**RequestMeta**](RequestMeta.md) | | [optional] |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'zyphr'
|
|
14
|
+
|
|
15
|
+
instance = Zyphr::OAuthAuthorizeResponse.new(
|
|
16
|
+
data: null,
|
|
17
|
+
meta: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Zyphr::OAuthAuthorizeResponseData
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **authorization_url** | **String** | Provider authorization URL to redirect the user to | [optional] |
|
|
8
|
+
| **state** | **String** | Opaque one-time state token for the callback | [optional] |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'zyphr'
|
|
14
|
+
|
|
15
|
+
instance = Zyphr::OAuthAuthorizeResponseData.new(
|
|
16
|
+
authorization_url: null,
|
|
17
|
+
state: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Zyphr::OAuthLinkResponse
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **data** | [**OAuthLinkResponseData**](OAuthLinkResponseData.md) | | [optional] |
|
|
8
|
+
| **meta** | [**RequestMeta**](RequestMeta.md) | | [optional] |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'zyphr'
|
|
14
|
+
|
|
15
|
+
instance = Zyphr::OAuthLinkResponse.new(
|
|
16
|
+
data: null,
|
|
17
|
+
meta: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Zyphr::OAuthLinkResponseData
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **success** | **Boolean** | | [optional] |
|
|
8
|
+
| **provider_info** | [**OAuthProviderInfo**](OAuthProviderInfo.md) | | [optional] |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'zyphr'
|
|
14
|
+
|
|
15
|
+
instance = Zyphr::OAuthLinkResponseData.new(
|
|
16
|
+
success: null,
|
|
17
|
+
provider_info: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
data/docs/PasswordPolicy.md
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
| **require_numbers** | **Boolean** | Whether at least one number (0-9) is required. | |
|
|
12
12
|
| **require_special** | **Boolean** | Whether at least one special character is required. | |
|
|
13
13
|
| **disallow_common** | **Boolean** | Whether commonly used passwords are rejected. | |
|
|
14
|
+
| **disallow_breached** | **Boolean** | Whether passwords found in the HaveIBeenPwned breach corpus are rejected at registration/reset. Checked via k-anonymity (only a 5-char SHA-1 prefix leaves our infrastructure) and fail-open: if the breach source is unavailable the password is allowed. Default false (advisory only — the breach signal is returned but does not gate acceptance unless enabled). | |
|
|
14
15
|
|
|
15
16
|
## Example
|
|
16
17
|
|
|
@@ -24,7 +25,8 @@ instance = Zyphr::PasswordPolicy.new(
|
|
|
24
25
|
require_lowercase: null,
|
|
25
26
|
require_numbers: null,
|
|
26
27
|
require_special: null,
|
|
27
|
-
disallow_common: null
|
|
28
|
+
disallow_common: null,
|
|
29
|
+
disallow_breached: null
|
|
28
30
|
)
|
|
29
31
|
```
|
|
30
32
|
|
data/docs/PasswordStrength.md
CHANGED
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
| **valid** | **Boolean** | Whether the password would be accepted by the server's enforcement path. A password that is valid here is accepted by registration. | |
|
|
8
|
-
| **
|
|
7
|
+
| **valid** | **Boolean** | Whether the password would be accepted by the server's enforcement path. A password that is valid here is accepted by registration. When the application enables `disallow_breached`, a breached password is `valid: false` here AND rejected by register/reset (no drift). | |
|
|
8
|
+
| **breached** | **Boolean** | Whether the password appears in the HaveIBeenPwned breach corpus. This is a distinct signal from `valid` and is always returned regardless of the app's `disallow_breached` setting. Fail-open: if the breach source is unavailable this is `false`. | |
|
|
9
|
+
| **breach_count** | **Integer** | HIBP occurrence count for the password (0 if not breached or if the breach lookup failed/was unavailable). | |
|
|
10
|
+
| **score** | **Integer** | Strength score, 0-100. A pure composition measure — independent of the breach signal. | |
|
|
9
11
|
| **label** | **String** | Strength label derived from the score. | |
|
|
10
12
|
| **feedback** | **Array<String>** | Actionable feedback — policy errors plus strength-improvement suggestions. | |
|
|
11
13
|
|
|
@@ -16,6 +18,8 @@ require 'zyphr'
|
|
|
16
18
|
|
|
17
19
|
instance = Zyphr::PasswordStrength.new(
|
|
18
20
|
valid: null,
|
|
21
|
+
breached: null,
|
|
22
|
+
breach_count: null,
|
|
19
23
|
score: null,
|
|
20
24
|
label: null,
|
|
21
25
|
feedback: null
|
|
@@ -19,6 +19,80 @@ module Zyphr
|
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
|
+
# Complete linking an OAuth provider to the current account
|
|
23
|
+
# Complete an authenticated account-linking flow started via the link authorize endpoint. Attaches the resolved provider identity to the current end user. Rejects if the provider identity is already linked to a different account, if the provider did not verify the email, or if the linking session does not belong to the authenticated user.
|
|
24
|
+
# @param provider [OAuthProviderName] OAuth provider name
|
|
25
|
+
# @param o_auth_callback_request [OAuthCallbackRequest]
|
|
26
|
+
# @param [Hash] opts the optional parameters
|
|
27
|
+
# @return [OAuthLinkResponse]
|
|
28
|
+
def complete_o_auth_link(provider, o_auth_callback_request, opts = {})
|
|
29
|
+
data, _status_code, _headers = complete_o_auth_link_with_http_info(provider, o_auth_callback_request, opts)
|
|
30
|
+
data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Complete linking an OAuth provider to the current account
|
|
34
|
+
# Complete an authenticated account-linking flow started via the link authorize endpoint. Attaches the resolved provider identity to the current end user. Rejects if the provider identity is already linked to a different account, if the provider did not verify the email, or if the linking session does not belong to the authenticated user.
|
|
35
|
+
# @param provider [OAuthProviderName] OAuth provider name
|
|
36
|
+
# @param o_auth_callback_request [OAuthCallbackRequest]
|
|
37
|
+
# @param [Hash] opts the optional parameters
|
|
38
|
+
# @return [Array<(OAuthLinkResponse, Integer, Hash)>] OAuthLinkResponse data, response status code and response headers
|
|
39
|
+
def complete_o_auth_link_with_http_info(provider, o_auth_callback_request, opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: AuthOAuthApi.complete_o_auth_link ...'
|
|
42
|
+
end
|
|
43
|
+
# verify the required parameter 'provider' is set
|
|
44
|
+
if @api_client.config.client_side_validation && provider.nil?
|
|
45
|
+
fail ArgumentError, "Missing the required parameter 'provider' when calling AuthOAuthApi.complete_o_auth_link"
|
|
46
|
+
end
|
|
47
|
+
# verify the required parameter 'o_auth_callback_request' is set
|
|
48
|
+
if @api_client.config.client_side_validation && o_auth_callback_request.nil?
|
|
49
|
+
fail ArgumentError, "Missing the required parameter 'o_auth_callback_request' when calling AuthOAuthApi.complete_o_auth_link"
|
|
50
|
+
end
|
|
51
|
+
# resource path
|
|
52
|
+
local_var_path = '/auth/oauth/{provider}/link/callback'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s))
|
|
53
|
+
|
|
54
|
+
# query parameters
|
|
55
|
+
query_params = opts[:query_params] || {}
|
|
56
|
+
|
|
57
|
+
# header parameters
|
|
58
|
+
header_params = opts[:header_params] || {}
|
|
59
|
+
# HTTP header 'Accept' (if needed)
|
|
60
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
61
|
+
# HTTP header 'Content-Type'
|
|
62
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
63
|
+
if !content_type.nil?
|
|
64
|
+
header_params['Content-Type'] = content_type
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# form parameters
|
|
68
|
+
form_params = opts[:form_params] || {}
|
|
69
|
+
|
|
70
|
+
# http body (model)
|
|
71
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(o_auth_callback_request)
|
|
72
|
+
|
|
73
|
+
# return_type
|
|
74
|
+
return_type = opts[:debug_return_type] || 'OAuthLinkResponse'
|
|
75
|
+
|
|
76
|
+
# auth_names
|
|
77
|
+
auth_names = opts[:debug_auth_names] || ['EndUserToken', 'ApplicationPublicKey']
|
|
78
|
+
|
|
79
|
+
new_options = opts.merge(
|
|
80
|
+
:operation => :"AuthOAuthApi.complete_o_auth_link",
|
|
81
|
+
:header_params => header_params,
|
|
82
|
+
:query_params => query_params,
|
|
83
|
+
:form_params => form_params,
|
|
84
|
+
:body => post_body,
|
|
85
|
+
:auth_names => auth_names,
|
|
86
|
+
:return_type => return_type
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
90
|
+
if @api_client.config.debugging
|
|
91
|
+
@api_client.config.logger.debug "API called: AuthOAuthApi#complete_o_auth_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
92
|
+
end
|
|
93
|
+
return data, status_code, headers
|
|
94
|
+
end
|
|
95
|
+
|
|
22
96
|
# Disconnect OAuth provider
|
|
23
97
|
# Disconnect an OAuth provider from the current user.
|
|
24
98
|
# @param provider [OAuthProviderName] OAuth provider name
|
|
@@ -546,5 +620,75 @@ module Zyphr
|
|
|
546
620
|
end
|
|
547
621
|
return data, status_code, headers
|
|
548
622
|
end
|
|
623
|
+
|
|
624
|
+
# Start linking an OAuth provider to the current account
|
|
625
|
+
# Begin an authenticated account-linking flow. Unlike the sign-in authorize endpoint, this binds the current end user into the OAuth state so the matching link callback attaches the returned provider identity to THIS account instead of finding-or-creating a user. Requires an end-user token.
|
|
626
|
+
# @param provider [OAuthProviderName] OAuth provider name
|
|
627
|
+
# @param redirect_uri [String] Redirect URI registered for the application
|
|
628
|
+
# @param [Hash] opts the optional parameters
|
|
629
|
+
# @return [OAuthAuthorizeResponse]
|
|
630
|
+
def start_o_auth_link(provider, redirect_uri, opts = {})
|
|
631
|
+
data, _status_code, _headers = start_o_auth_link_with_http_info(provider, redirect_uri, opts)
|
|
632
|
+
data
|
|
633
|
+
end
|
|
634
|
+
|
|
635
|
+
# Start linking an OAuth provider to the current account
|
|
636
|
+
# Begin an authenticated account-linking flow. Unlike the sign-in authorize endpoint, this binds the current end user into the OAuth state so the matching link callback attaches the returned provider identity to THIS account instead of finding-or-creating a user. Requires an end-user token.
|
|
637
|
+
# @param provider [OAuthProviderName] OAuth provider name
|
|
638
|
+
# @param redirect_uri [String] Redirect URI registered for the application
|
|
639
|
+
# @param [Hash] opts the optional parameters
|
|
640
|
+
# @return [Array<(OAuthAuthorizeResponse, Integer, Hash)>] OAuthAuthorizeResponse data, response status code and response headers
|
|
641
|
+
def start_o_auth_link_with_http_info(provider, redirect_uri, opts = {})
|
|
642
|
+
if @api_client.config.debugging
|
|
643
|
+
@api_client.config.logger.debug 'Calling API: AuthOAuthApi.start_o_auth_link ...'
|
|
644
|
+
end
|
|
645
|
+
# verify the required parameter 'provider' is set
|
|
646
|
+
if @api_client.config.client_side_validation && provider.nil?
|
|
647
|
+
fail ArgumentError, "Missing the required parameter 'provider' when calling AuthOAuthApi.start_o_auth_link"
|
|
648
|
+
end
|
|
649
|
+
# verify the required parameter 'redirect_uri' is set
|
|
650
|
+
if @api_client.config.client_side_validation && redirect_uri.nil?
|
|
651
|
+
fail ArgumentError, "Missing the required parameter 'redirect_uri' when calling AuthOAuthApi.start_o_auth_link"
|
|
652
|
+
end
|
|
653
|
+
# resource path
|
|
654
|
+
local_var_path = '/auth/oauth/{provider}/link'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s))
|
|
655
|
+
|
|
656
|
+
# query parameters
|
|
657
|
+
query_params = opts[:query_params] || {}
|
|
658
|
+
query_params[:'redirect_uri'] = redirect_uri
|
|
659
|
+
|
|
660
|
+
# header parameters
|
|
661
|
+
header_params = opts[:header_params] || {}
|
|
662
|
+
# HTTP header 'Accept' (if needed)
|
|
663
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
664
|
+
|
|
665
|
+
# form parameters
|
|
666
|
+
form_params = opts[:form_params] || {}
|
|
667
|
+
|
|
668
|
+
# http body (model)
|
|
669
|
+
post_body = opts[:debug_body]
|
|
670
|
+
|
|
671
|
+
# return_type
|
|
672
|
+
return_type = opts[:debug_return_type] || 'OAuthAuthorizeResponse'
|
|
673
|
+
|
|
674
|
+
# auth_names
|
|
675
|
+
auth_names = opts[:debug_auth_names] || ['EndUserToken', 'ApplicationPublicKey']
|
|
676
|
+
|
|
677
|
+
new_options = opts.merge(
|
|
678
|
+
:operation => :"AuthOAuthApi.start_o_auth_link",
|
|
679
|
+
:header_params => header_params,
|
|
680
|
+
:query_params => query_params,
|
|
681
|
+
:form_params => form_params,
|
|
682
|
+
:body => post_body,
|
|
683
|
+
:auth_names => auth_names,
|
|
684
|
+
:return_type => return_type
|
|
685
|
+
)
|
|
686
|
+
|
|
687
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
688
|
+
if @api_client.config.debugging
|
|
689
|
+
@api_client.config.logger.debug "API called: AuthOAuthApi#start_o_auth_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
690
|
+
end
|
|
691
|
+
return data, status_code, headers
|
|
692
|
+
end
|
|
549
693
|
end
|
|
550
694
|
end
|