zyphr 0.1.51 → 0.1.53

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7ec40b14a9b8a2ce14cff88cdb6d2e4cdebd6b1c324a65a8f8c4f1b551f1688
4
- data.tar.gz: dd884a0621a0a3243a6b1ffa98e6acc8821f1b4efaaf841f12df6307fba729cb
3
+ metadata.gz: c48e48e0a4e1c2a2ea9d58e507adcee64e9cbac7a31c336da15d0ca3b0df3d51
4
+ data.tar.gz: c8accc89829202be56cdcae385e1ffd1df20da4bd89bbb2c46d70944eebe9ad8
5
5
  SHA512:
6
- metadata.gz: 799f68978d7a8ea632126b16f2addb82b7e16f41e75c23f12abe809c5465ac74a7046276d371720f90472b4f0228353a3ccb9d48fbbf50ed443da2f9cf565a52
7
- data.tar.gz: c17b1bdd2725d25d2c117ca6460e306ab1fe2cf96fddbcb43624f52f9dffa4546abd24ef2f13c66eb9c699e21ece24ef7e92f3d52f714ae712380fb09dcc21f6
6
+ metadata.gz: f3281a542c1412e8722f4a45a9363b956b8aa78133d77d0bd8dc56a9a40e827e88f8f05f8b80d75436786eb50e0772714dcc20c7fa0db00ff61bd86d2162eda3
7
+ data.tar.gz: bb9cd301b7568d3b9ff54f04555f1f1006c8a29a847c0c2f79986e45ac1368aa4d74daae347df7c3ba73f51fed00ac27e83f6d889faf29c2fbb8fe5125878b0a
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)
@@ -10,6 +10,7 @@
10
10
  | **signing_algorithm** | **String** | JWT signing algorithm for this application's end-user tokens. | |
11
11
  | **test_recipients** | **Array<String>** | The auth-email allowlist. In `allowlist` mode, only these addresses receive auth emails; in `unrestricted` mode it is ignored. Settable via PATCH /auth/application (sc-7600). | |
12
12
  | **auth_email_mode** | **String** | Explicit auth-email gate mode (sc-7673). `unrestricted` sends auth emails to everyone. `allowlist` restricts auth email to `test_recipients` — and an EMPTY allowlist in this mode fails CLOSED (blocks all auth email). This replaces the previous behavior where the gate was inferred from whether `test_recipients` was empty. Defaults to `unrestricted`. | |
13
+ | **password_disallow_breached** | **Boolean** | When true (sc-7680), passwords found in the HaveIBeenPwned breach corpus are rejected at register/reset (and returned `valid:false` by `/auth/password-strength`). When false (default), breach info is advisory only. Fail-open: a breach-source outage never blocks auth. | |
13
14
 
14
15
  ## Example
15
16
 
@@ -22,7 +23,8 @@ instance = Zyphr::ApplicationSelf.new(
22
23
  environment: null,
23
24
  signing_algorithm: null,
24
25
  test_recipients: null,
25
- auth_email_mode: null
26
+ auth_email_mode: null,
27
+ password_disallow_breached: null
26
28
  )
27
29
  ```
28
30
 
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
+
@@ -6,6 +6,7 @@
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **test_recipients** | **Array&lt;String&gt;** | Email addresses allowed to receive auth emails when auth_email_mode is &#39;allowlist&#39;. Ignored in &#39;unrestricted&#39; mode. Optional — omit to leave the current list unchanged. | [optional] |
8
8
  | **auth_email_mode** | **String** | Optional (sc-7673). Explicit auth-email gate mode. &#39;unrestricted&#39; sends to everyone; &#39;allowlist&#39; restricts to test_recipients (an EMPTY list in allowlist mode fails closed — blocks all auth email). Omit to leave the current mode unchanged. | [optional] |
9
+ | **password_disallow_breached** | **Boolean** | Optional (sc-7680/sc-7697). When true, reject HIBP-breached passwords at register/reset. Omit to leave unchanged. | [optional] |
9
10
 
10
11
  ## Example
11
12
 
@@ -14,7 +15,8 @@ require 'zyphr'
14
15
 
15
16
  instance = Zyphr::SetSelfApplicationTestRecipientsRequest.new(
16
17
  test_recipients: null,
17
- auth_email_mode: null
18
+ auth_email_mode: null,
19
+ password_disallow_breached: null
18
20
  )
19
21
  ```
20
22
 
@@ -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
@@ -34,6 +34,9 @@ module Zyphr
34
34
  # Explicit auth-email gate mode (sc-7673). `unrestricted` sends auth emails to everyone. `allowlist` restricts auth email to `test_recipients` — and an EMPTY allowlist in this mode fails CLOSED (blocks all auth email). This replaces the previous behavior where the gate was inferred from whether `test_recipients` was empty. Defaults to `unrestricted`.
35
35
  attr_accessor :auth_email_mode
36
36
 
37
+ # When true (sc-7680), passwords found in the HaveIBeenPwned breach corpus are rejected at register/reset (and returned `valid:false` by `/auth/password-strength`). When false (default), breach info is advisory only. Fail-open: a breach-source outage never blocks auth.
38
+ attr_accessor :password_disallow_breached
39
+
37
40
  class EnumAttributeValidator
38
41
  attr_reader :datatype
39
42
  attr_reader :allowable_values
@@ -64,7 +67,8 @@ module Zyphr
64
67
  :'environment' => :'environment',
65
68
  :'signing_algorithm' => :'signing_algorithm',
66
69
  :'test_recipients' => :'test_recipients',
67
- :'auth_email_mode' => :'auth_email_mode'
70
+ :'auth_email_mode' => :'auth_email_mode',
71
+ :'password_disallow_breached' => :'password_disallow_breached'
68
72
  }
69
73
  end
70
74
 
@@ -86,7 +90,8 @@ module Zyphr
86
90
  :'environment' => :'String',
87
91
  :'signing_algorithm' => :'String',
88
92
  :'test_recipients' => :'Array<String>',
89
- :'auth_email_mode' => :'String'
93
+ :'auth_email_mode' => :'String',
94
+ :'password_disallow_breached' => :'Boolean'
90
95
  }
91
96
  end
92
97
 
@@ -150,6 +155,12 @@ module Zyphr
150
155
  else
151
156
  self.auth_email_mode = nil
152
157
  end
158
+
159
+ if attributes.key?(:'password_disallow_breached')
160
+ self.password_disallow_breached = attributes[:'password_disallow_breached']
161
+ else
162
+ self.password_disallow_breached = nil
163
+ end
153
164
  end
154
165
 
155
166
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -177,6 +188,10 @@ module Zyphr
177
188
  invalid_properties.push('invalid value for "auth_email_mode", auth_email_mode cannot be nil.')
178
189
  end
179
190
 
191
+ if @password_disallow_breached.nil?
192
+ invalid_properties.push('invalid value for "password_disallow_breached", password_disallow_breached cannot be nil.')
193
+ end
194
+
180
195
  invalid_properties
181
196
  end
182
197
 
@@ -195,6 +210,7 @@ module Zyphr
195
210
  return false if @auth_email_mode.nil?
196
211
  auth_email_mode_validator = EnumAttributeValidator.new('String', ["allowlist", "unrestricted"])
197
212
  return false unless auth_email_mode_validator.valid?(@auth_email_mode)
213
+ return false if @password_disallow_breached.nil?
198
214
  true
199
215
  end
200
216
 
@@ -258,6 +274,16 @@ module Zyphr
258
274
  @auth_email_mode = auth_email_mode
259
275
  end
260
276
 
277
+ # Custom attribute writer method with validation
278
+ # @param [Object] password_disallow_breached Value to be assigned
279
+ def password_disallow_breached=(password_disallow_breached)
280
+ if password_disallow_breached.nil?
281
+ fail ArgumentError, 'password_disallow_breached cannot be nil'
282
+ end
283
+
284
+ @password_disallow_breached = password_disallow_breached
285
+ end
286
+
261
287
  # Checks equality by comparing each attribute.
262
288
  # @param [Object] Object to be compared
263
289
  def ==(o)
@@ -268,7 +294,8 @@ module Zyphr
268
294
  environment == o.environment &&
269
295
  signing_algorithm == o.signing_algorithm &&
270
296
  test_recipients == o.test_recipients &&
271
- auth_email_mode == o.auth_email_mode
297
+ auth_email_mode == o.auth_email_mode &&
298
+ password_disallow_breached == o.password_disallow_breached
272
299
  end
273
300
 
274
301
  # @see the `==` method
@@ -280,7 +307,7 @@ module Zyphr
280
307
  # Calculates hash code according to all attributes.
281
308
  # @return [Integer] Hash code
282
309
  def hash
283
- [id, name, environment, signing_algorithm, test_recipients, auth_email_mode].hash
310
+ [id, name, environment, signing_algorithm, test_recipients, auth_email_mode, password_disallow_breached].hash
284
311
  end
285
312
 
286
313
  # Builds the object from hash