zyphr 0.1.47 → 0.1.49

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: 1631c8b08187f685f9ba0705937529c10b793216403e569e084b19bbe76eed98
4
- data.tar.gz: d459bb04c1089992c9c18a2287a5cdf859fdef80e94fe8859a78b659c4b56c4c
3
+ metadata.gz: 17635891761ec918c2a1feb5baf11520be9b51838210accab7449cc18b0afe4a
4
+ data.tar.gz: 6aa9d43d86a68e716dd2f7571f648bd3f898db1eca9d673f29e1d6c0f3c52f43
5
5
  SHA512:
6
- metadata.gz: dbdbfe7cb026b80ff24bfb3760983f9be06c4aaa2da6bdcd3d1386e29ac838c0ce1a927cfedfa48079ca3aab11dd4c6a4f47e065064c82a382253fdeeb01a14f
7
- data.tar.gz: befc207eb3218353d296f8b14466fdb9fcf53a008c576381c843c998c8875bad60131e5bdb0b97785eb7bbd9aedc501e09f882ed1d3157f46f6350e771e65a1c
6
+ metadata.gz: f5ee08fe9c4eeef999128e99152514ffd2b9f8d4f6c9b3e38b94c96ec1402c0a1ac938e8b736b38caa1e315e1e1ba9a9b48742e97e1e076c7348b7c022cc6176
7
+ data.tar.gz: a3371945d133e515c6261c0063978a79a1cba97b99593963d9325321fdc901fe551f09c897be380bee4db9af26b8e16fe9049357a2c0bfd554bc92550d0d3c60
data/README.md CHANGED
@@ -326,6 +326,7 @@ Class | Method | HTTP request | Description
326
326
  *Zyphr::TopicsApi* | [**list_topics**](docs/TopicsApi.md#list_topics) | **GET** /topics | List topics
327
327
  *Zyphr::TopicsApi* | [**remove_topic_subscribers**](docs/TopicsApi.md#remove_topic_subscribers) | **DELETE** /topics/{key}/subscribers | Remove subscribers from a topic
328
328
  *Zyphr::TopicsApi* | [**update_topic**](docs/TopicsApi.md#update_topic) | **PATCH** /topics/{key} | Update a topic
329
+ *Zyphr::UtilityApi* | [**check_password_strength**](docs/UtilityApi.md#check_password_strength) | **POST** /auth/password-strength | Check password strength
329
330
  *Zyphr::UtilityApi* | [**get_password_requirements**](docs/UtilityApi.md#get_password_requirements) | **GET** /auth/password-requirements | Get password requirements
330
331
  *Zyphr::WaaSApplicationsApi* | [**create_waa_s_application**](docs/WaaSApplicationsApi.md#create_waa_s_application) | **POST** /v1/waas/applications | Create a WaaS application
331
332
  *Zyphr::WaaSApplicationsApi* | [**delete_waa_s_application**](docs/WaaSApplicationsApi.md#delete_waa_s_application) | **DELETE** /v1/waas/applications/{appId} | Delete a WaaS application
@@ -623,9 +624,12 @@ Class | Method | HTTP request | Description
623
624
  - [Zyphr::OrganizationMembershipWithUser](docs/OrganizationMembershipWithUser.md)
624
625
  - [Zyphr::OrganizationResponse](docs/OrganizationResponse.md)
625
626
  - [Zyphr::PaginationMeta](docs/PaginationMeta.md)
626
- - [Zyphr::PasswordRequirements](docs/PasswordRequirements.md)
627
+ - [Zyphr::PasswordPolicy](docs/PasswordPolicy.md)
627
628
  - [Zyphr::PasswordRequirementsResponse](docs/PasswordRequirementsResponse.md)
628
629
  - [Zyphr::PasswordRequirementsResponseData](docs/PasswordRequirementsResponseData.md)
630
+ - [Zyphr::PasswordStrength](docs/PasswordStrength.md)
631
+ - [Zyphr::PasswordStrengthRequest](docs/PasswordStrengthRequest.md)
632
+ - [Zyphr::PasswordStrengthResponse](docs/PasswordStrengthResponse.md)
629
633
  - [Zyphr::PayloadTooLargeError](docs/PayloadTooLargeError.md)
630
634
  - [Zyphr::PayloadTooLargeErrorError](docs/PayloadTooLargeErrorError.md)
631
635
  - [Zyphr::PayloadTooLargeErrorErrorDetails](docs/PayloadTooLargeErrorErrorDetails.md)
@@ -87,7 +87,7 @@ This endpoint does not need any parameter.
87
87
 
88
88
  Refresh access token
89
89
 
90
- Refresh access token using a refresh token. Accepts optional custom_claims to update JWT claims (if not provided, preserves existing claims).
90
+ Refresh an end-user access token using a refresh token. Authenticated with the publishable application key (`X-Application-Key`) — no application secret is required, so client-side apps (browser / mobile) can refresh directly. The refresh token is the credential: it must be valid, unexpired, unrevoked, and issued for this application. Refresh tokens are single-use — each refresh returns a NEW refresh token and invalidates the one you presented, so persist the new token before the next refresh. Accepts optional custom_claims to update JWT claims (if not provided, current stored claims are preserved).
91
91
 
92
92
  ### Examples
93
93
 
@@ -0,0 +1,30 @@
1
+ # Zyphr::PasswordPolicy
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **min_length** | **Integer** | Minimum password length. | |
8
+ | **max_length** | **Integer** | Maximum password length. | |
9
+ | **require_uppercase** | **Boolean** | Whether at least one uppercase letter (A-Z) is required. | |
10
+ | **require_lowercase** | **Boolean** | Whether at least one lowercase letter (a-z) is required. | |
11
+ | **require_numbers** | **Boolean** | Whether at least one number (0-9) is required. | |
12
+ | **require_special** | **Boolean** | Whether at least one special character is required. | |
13
+ | **disallow_common** | **Boolean** | Whether commonly used passwords are rejected. | |
14
+
15
+ ## Example
16
+
17
+ ```ruby
18
+ require 'zyphr'
19
+
20
+ instance = Zyphr::PasswordPolicy.new(
21
+ min_length: null,
22
+ max_length: null,
23
+ require_uppercase: null,
24
+ require_lowercase: null,
25
+ require_numbers: null,
26
+ require_special: null,
27
+ disallow_common: null
28
+ )
29
+ ```
30
+
@@ -4,7 +4,8 @@
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
- | **requirements** | [**PasswordRequirements**](PasswordRequirements.md) | | [optional] |
7
+ | **policy** | [**PasswordPolicy**](PasswordPolicy.md) | | |
8
+ | **requirements** | **Array<String>** | Human-readable display strings for the active password rules (e.g. \"At least 8 characters\"). Backward-compatible with the original response shape. | |
8
9
 
9
10
  ## Example
10
11
 
@@ -12,6 +13,7 @@
12
13
  require 'zyphr'
13
14
 
14
15
  instance = Zyphr::PasswordRequirementsResponseData.new(
16
+ policy: null,
15
17
  requirements: null
16
18
  )
17
19
  ```
@@ -0,0 +1,24 @@
1
+ # Zyphr::PasswordStrength
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
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
+ | **score** | **Integer** | Strength score, 0-100. | |
9
+ | **label** | **String** | Strength label derived from the score. | |
10
+ | **feedback** | **Array<String>** | Actionable feedback — policy errors plus strength-improvement suggestions. | |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'zyphr'
16
+
17
+ instance = Zyphr::PasswordStrength.new(
18
+ valid: null,
19
+ score: null,
20
+ label: null,
21
+ feedback: null
22
+ )
23
+ ```
24
+
@@ -0,0 +1,20 @@
1
+ # Zyphr::PasswordStrengthRequest
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **password** | **String** | The password to evaluate. | |
8
+ | **email** | **String** | Optional. When provided, the password is checked for similarity to the email's local-part; a match is flagged and marks the password invalid. | [optional] |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'zyphr'
14
+
15
+ instance = Zyphr::PasswordStrengthRequest.new(
16
+ password: null,
17
+ email: null
18
+ )
19
+ ```
20
+
@@ -0,0 +1,20 @@
1
+ # Zyphr::PasswordStrengthResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **data** | [**PasswordStrength**](PasswordStrength.md) | | [optional] |
8
+ | **meta** | [**RequestMeta**](RequestMeta.md) | | [optional] |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'zyphr'
14
+
15
+ instance = Zyphr::PasswordStrengthResponse.new(
16
+ data: null,
17
+ meta: null
18
+ )
19
+ ```
20
+
data/docs/UtilityApi.md CHANGED
@@ -4,16 +4,88 @@ All URIs are relative to *https://api.zyphr.dev/v1*
4
4
 
5
5
  | Method | HTTP request | Description |
6
6
  | ------ | ------------ | ----------- |
7
+ | [**check_password_strength**](UtilityApi.md#check_password_strength) | **POST** /auth/password-strength | Check password strength |
7
8
  | [**get_password_requirements**](UtilityApi.md#get_password_requirements) | **GET** /auth/password-requirements | Get password requirements |
8
9
 
9
10
 
11
+ ## check_password_strength
12
+
13
+ > <PasswordStrengthResponse> check_password_strength(password_strength_request)
14
+
15
+ Check password strength
16
+
17
+ Pre-submit password check for a live registration/reset experience. Returns whether the password would be accepted by the server (`valid`), a strength `score` (0-100) and `label`, and actionable `feedback`. When an `email` is supplied, a password that resembles the email's local-part is flagged and marked invalid. The password is never logged or persisted.
18
+
19
+ ### Examples
20
+
21
+ ```ruby
22
+ require 'time'
23
+ require 'zyphr'
24
+ # setup authorization
25
+ Zyphr.configure do |config|
26
+ # Configure API key authorization: ApplicationPublicKey
27
+ config.api_key['X-Application-Key'] = 'YOUR API KEY'
28
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
29
+ # config.api_key_prefix['X-Application-Key'] = 'Bearer'
30
+ end
31
+
32
+ api_instance = Zyphr::UtilityApi.new
33
+ password_strength_request = Zyphr::PasswordStrengthRequest.new({password: 'password_example'}) # PasswordStrengthRequest |
34
+
35
+ begin
36
+ # Check password strength
37
+ result = api_instance.check_password_strength(password_strength_request)
38
+ p result
39
+ rescue Zyphr::ApiError => e
40
+ puts "Error when calling UtilityApi->check_password_strength: #{e}"
41
+ end
42
+ ```
43
+
44
+ #### Using the check_password_strength_with_http_info variant
45
+
46
+ This returns an Array which contains the response data, status code and headers.
47
+
48
+ > <Array(<PasswordStrengthResponse>, Integer, Hash)> check_password_strength_with_http_info(password_strength_request)
49
+
50
+ ```ruby
51
+ begin
52
+ # Check password strength
53
+ data, status_code, headers = api_instance.check_password_strength_with_http_info(password_strength_request)
54
+ p status_code # => 2xx
55
+ p headers # => { ... }
56
+ p data # => <PasswordStrengthResponse>
57
+ rescue Zyphr::ApiError => e
58
+ puts "Error when calling UtilityApi->check_password_strength_with_http_info: #{e}"
59
+ end
60
+ ```
61
+
62
+ ### Parameters
63
+
64
+ | Name | Type | Description | Notes |
65
+ | ---- | ---- | ----------- | ----- |
66
+ | **password_strength_request** | [**PasswordStrengthRequest**](PasswordStrengthRequest.md) | | |
67
+
68
+ ### Return type
69
+
70
+ [**PasswordStrengthResponse**](PasswordStrengthResponse.md)
71
+
72
+ ### Authorization
73
+
74
+ [ApplicationPublicKey](../README.md#ApplicationPublicKey)
75
+
76
+ ### HTTP request headers
77
+
78
+ - **Content-Type**: application/json
79
+ - **Accept**: application/json
80
+
81
+
10
82
  ## get_password_requirements
11
83
 
12
84
  > <PasswordRequirementsResponse> get_password_requirements
13
85
 
14
86
  Get password requirements
15
87
 
16
- Get password requirements for the application. Useful for client-side validation before registration.
88
+ Get password requirements for the application. Returns both a structured `policy` object (for driving a live requirements checklist) and human-readable `requirements` display strings. Useful for client-side validation before registration.
17
89
 
18
90
  ### Examples
19
91
 
@@ -77,7 +77,7 @@ module Zyphr
77
77
  end
78
78
 
79
79
  # Refresh access token
80
- # Refresh access token using a refresh token. Accepts optional custom_claims to update JWT claims (if not provided, preserves existing claims).
80
+ # Refresh an end-user access token using a refresh token. Authenticated with the publishable application key (`X-Application-Key`) — no application secret is required, so client-side apps (browser / mobile) can refresh directly. The refresh token is the credential: it must be valid, unexpired, unrevoked, and issued for this application. Refresh tokens are single-use — each refresh returns a NEW refresh token and invalidates the one you presented, so persist the new token before the next refresh. Accepts optional custom_claims to update JWT claims (if not provided, current stored claims are preserved).
81
81
  # @param refresh_session_request [RefreshSessionRequest]
82
82
  # @param [Hash] opts the optional parameters
83
83
  # @return [RefreshTokenResponse]
@@ -87,7 +87,7 @@ module Zyphr
87
87
  end
88
88
 
89
89
  # Refresh access token
90
- # Refresh access token using a refresh token. Accepts optional custom_claims to update JWT claims (if not provided, preserves existing claims).
90
+ # Refresh an end-user access token using a refresh token. Authenticated with the publishable application key (&#x60;X-Application-Key&#x60;) — no application secret is required, so client-side apps (browser / mobile) can refresh directly. The refresh token is the credential: it must be valid, unexpired, unrevoked, and issued for this application. Refresh tokens are single-use — each refresh returns a NEW refresh token and invalidates the one you presented, so persist the new token before the next refresh. Accepts optional custom_claims to update JWT claims (if not provided, current stored claims are preserved).
91
91
  # @param refresh_session_request [RefreshSessionRequest]
92
92
  # @param [Hash] opts the optional parameters
93
93
  # @return [Array<(RefreshTokenResponse, Integer, Hash)>] RefreshTokenResponse data, response status code and response headers
@@ -19,8 +19,76 @@ module Zyphr
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # Check password strength
23
+ # Pre-submit password check for a live registration/reset experience. Returns whether the password would be accepted by the server (`valid`), a strength `score` (0-100) and `label`, and actionable `feedback`. When an `email` is supplied, a password that resembles the email's local-part is flagged and marked invalid. The password is never logged or persisted.
24
+ # @param password_strength_request [PasswordStrengthRequest]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [PasswordStrengthResponse]
27
+ def check_password_strength(password_strength_request, opts = {})
28
+ data, _status_code, _headers = check_password_strength_with_http_info(password_strength_request, opts)
29
+ data
30
+ end
31
+
32
+ # Check password strength
33
+ # Pre-submit password check for a live registration/reset experience. Returns whether the password would be accepted by the server (&#x60;valid&#x60;), a strength &#x60;score&#x60; (0-100) and &#x60;label&#x60;, and actionable &#x60;feedback&#x60;. When an &#x60;email&#x60; is supplied, a password that resembles the email&#39;s local-part is flagged and marked invalid. The password is never logged or persisted.
34
+ # @param password_strength_request [PasswordStrengthRequest]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(PasswordStrengthResponse, Integer, Hash)>] PasswordStrengthResponse data, response status code and response headers
37
+ def check_password_strength_with_http_info(password_strength_request, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: UtilityApi.check_password_strength ...'
40
+ end
41
+ # verify the required parameter 'password_strength_request' is set
42
+ if @api_client.config.client_side_validation && password_strength_request.nil?
43
+ fail ArgumentError, "Missing the required parameter 'password_strength_request' when calling UtilityApi.check_password_strength"
44
+ end
45
+ # resource path
46
+ local_var_path = '/auth/password-strength'
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
55
+ # HTTP header 'Content-Type'
56
+ content_type = @api_client.select_header_content_type(['application/json'])
57
+ if !content_type.nil?
58
+ header_params['Content-Type'] = content_type
59
+ end
60
+
61
+ # form parameters
62
+ form_params = opts[:form_params] || {}
63
+
64
+ # http body (model)
65
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(password_strength_request)
66
+
67
+ # return_type
68
+ return_type = opts[:debug_return_type] || 'PasswordStrengthResponse'
69
+
70
+ # auth_names
71
+ auth_names = opts[:debug_auth_names] || ['ApplicationPublicKey']
72
+
73
+ new_options = opts.merge(
74
+ :operation => :"UtilityApi.check_password_strength",
75
+ :header_params => header_params,
76
+ :query_params => query_params,
77
+ :form_params => form_params,
78
+ :body => post_body,
79
+ :auth_names => auth_names,
80
+ :return_type => return_type
81
+ )
82
+
83
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
84
+ if @api_client.config.debugging
85
+ @api_client.config.logger.debug "API called: UtilityApi#check_password_strength\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
86
+ end
87
+ return data, status_code, headers
88
+ end
89
+
22
90
  # Get password requirements
23
- # Get password requirements for the application. Useful for client-side validation before registration.
91
+ # Get password requirements for the application. Returns both a structured `policy` object (for driving a live requirements checklist) and human-readable `requirements` display strings. Useful for client-side validation before registration.
24
92
  # @param [Hash] opts the optional parameters
25
93
  # @return [PasswordRequirementsResponse]
26
94
  def get_password_requirements(opts = {})
@@ -29,7 +97,7 @@ module Zyphr
29
97
  end
30
98
 
31
99
  # Get password requirements
32
- # Get password requirements for the application. Useful for client-side validation before registration.
100
+ # Get password requirements for the application. Returns both a structured &#x60;policy&#x60; object (for driving a live requirements checklist) and human-readable &#x60;requirements&#x60; display strings. Useful for client-side validation before registration.
33
101
  # @param [Hash] opts the optional parameters
34
102
  # @return [Array<(PasswordRequirementsResponse, Integer, Hash)>] PasswordRequirementsResponse data, response status code and response headers
35
103
  def get_password_requirements_with_http_info(opts = {})