zyphr 0.1.49 → 0.1.51

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: 17635891761ec918c2a1feb5baf11520be9b51838210accab7449cc18b0afe4a
4
- data.tar.gz: 6aa9d43d86a68e716dd2f7571f648bd3f898db1eca9d673f29e1d6c0f3c52f43
3
+ metadata.gz: f7ec40b14a9b8a2ce14cff88cdb6d2e4cdebd6b1c324a65a8f8c4f1b551f1688
4
+ data.tar.gz: dd884a0621a0a3243a6b1ffa98e6acc8821f1b4efaaf841f12df6307fba729cb
5
5
  SHA512:
6
- metadata.gz: f5ee08fe9c4eeef999128e99152514ffd2b9f8d4f6c9b3e38b94c96ec1402c0a1ac938e8b736b38caa1e315e1e1ba9a9b48742e97e1e076c7348b7c022cc6176
7
- data.tar.gz: a3371945d133e515c6261c0063978a79a1cba97b99593963d9325321fdc901fe551f09c897be380bee4db9af26b8e16fe9049357a2c0bfd554bc92550d0d3c60
6
+ metadata.gz: 799f68978d7a8ea632126b16f2addb82b7e16f41e75c23f12abe809c5465ac74a7046276d371720f90472b4f0228353a3ccb9d48fbbf50ed443da2f9cf565a52
7
+ data.tar.gz: c17b1bdd2725d25d2c117ca6460e306ab1fe2cf96fddbcb43624f52f9dffa4546abd24ef2f13c66eb9c699e21ece24ef7e92f3d52f714ae712380fb09dcc21f6
@@ -8,7 +8,8 @@
8
8
  | **name** | **String** | Human-readable application name. | |
9
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
10
  | **signing_algorithm** | **String** | JWT signing algorithm for this application's end-user tokens. | |
11
- | **test_recipients** | **Array<String>** | The auth-email test allowlist. When non-empty, only these addresses receive auth emails (the gate from sc-7443); an empty array disables the gate. Settable via PATCH /auth/application (sc-7600). | |
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
+ | **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`. | |
12
13
 
13
14
  ## Example
14
15
 
@@ -20,7 +21,8 @@ instance = Zyphr::ApplicationSelf.new(
20
21
  name: null,
21
22
  environment: null,
22
23
  signing_algorithm: null,
23
- test_recipients: null
24
+ test_recipients: null,
25
+ auth_email_mode: null
24
26
  )
25
27
  ```
26
28
 
@@ -108,7 +108,7 @@ Zyphr.configure do |config|
108
108
  end
109
109
 
110
110
  api_instance = Zyphr::AuthApplicationApi.new
111
- set_self_application_test_recipients_request = Zyphr::SetSelfApplicationTestRecipientsRequest.new({test_recipients: ['test_recipients_example']}) # SetSelfApplicationTestRecipientsRequest |
111
+ set_self_application_test_recipients_request = Zyphr::SetSelfApplicationTestRecipientsRequest.new # SetSelfApplicationTestRecipientsRequest |
112
112
 
113
113
  begin
114
114
  # Set the authenticating application's auth-email test allowlist
@@ -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
 
@@ -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
- | **score** | **Integer** | Strength score, 0-100. | |
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
@@ -4,7 +4,8 @@
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
- | **test_recipients** | **Array<String>** | Email addresses allowed to receive auth emails. An empty array clears the allowlist (disables the gate). | |
7
+ | **test_recipients** | **Array<String>** | Email addresses allowed to receive auth emails when auth_email_mode is 'allowlist'. Ignored in 'unrestricted' mode. Optional omit to leave the current list unchanged. | [optional] |
8
+ | **auth_email_mode** | **String** | Optional (sc-7673). Explicit auth-email gate mode. 'unrestricted' sends to everyone; 'allowlist' restricts to test_recipients (an EMPTY list in allowlist mode fails closed — blocks all auth email). Omit to leave the current mode unchanged. | [optional] |
8
9
 
9
10
  ## Example
10
11
 
@@ -12,7 +13,8 @@
12
13
  require 'zyphr'
13
14
 
14
15
  instance = Zyphr::SetSelfApplicationTestRecipientsRequest.new(
15
- test_recipients: null
16
+ test_recipients: null,
17
+ auth_email_mode: null
16
18
  )
17
19
  ```
18
20
 
@@ -28,9 +28,12 @@ module Zyphr
28
28
  # JWT signing algorithm for this application's end-user tokens.
29
29
  attr_accessor :signing_algorithm
30
30
 
31
- # The auth-email test allowlist. When non-empty, only these addresses receive auth emails (the gate from sc-7443); an empty array disables the gate. Settable via PATCH /auth/application (sc-7600).
31
+ # 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).
32
32
  attr_accessor :test_recipients
33
33
 
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
+ attr_accessor :auth_email_mode
36
+
34
37
  class EnumAttributeValidator
35
38
  attr_reader :datatype
36
39
  attr_reader :allowable_values
@@ -60,7 +63,8 @@ module Zyphr
60
63
  :'name' => :'name',
61
64
  :'environment' => :'environment',
62
65
  :'signing_algorithm' => :'signing_algorithm',
63
- :'test_recipients' => :'test_recipients'
66
+ :'test_recipients' => :'test_recipients',
67
+ :'auth_email_mode' => :'auth_email_mode'
64
68
  }
65
69
  end
66
70
 
@@ -81,7 +85,8 @@ module Zyphr
81
85
  :'name' => :'String',
82
86
  :'environment' => :'String',
83
87
  :'signing_algorithm' => :'String',
84
- :'test_recipients' => :'Array<String>'
88
+ :'test_recipients' => :'Array<String>',
89
+ :'auth_email_mode' => :'String'
85
90
  }
86
91
  end
87
92
 
@@ -139,6 +144,12 @@ module Zyphr
139
144
  else
140
145
  self.test_recipients = nil
141
146
  end
147
+
148
+ if attributes.key?(:'auth_email_mode')
149
+ self.auth_email_mode = attributes[:'auth_email_mode']
150
+ else
151
+ self.auth_email_mode = nil
152
+ end
142
153
  end
143
154
 
144
155
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -162,6 +173,10 @@ module Zyphr
162
173
  invalid_properties.push('invalid value for "test_recipients", test_recipients cannot be nil.')
163
174
  end
164
175
 
176
+ if @auth_email_mode.nil?
177
+ invalid_properties.push('invalid value for "auth_email_mode", auth_email_mode cannot be nil.')
178
+ end
179
+
165
180
  invalid_properties
166
181
  end
167
182
 
@@ -177,6 +192,9 @@ module Zyphr
177
192
  signing_algorithm_validator = EnumAttributeValidator.new('String', ["HS256", "RS256", "ES256"])
178
193
  return false unless signing_algorithm_validator.valid?(@signing_algorithm)
179
194
  return false if @test_recipients.nil?
195
+ return false if @auth_email_mode.nil?
196
+ auth_email_mode_validator = EnumAttributeValidator.new('String', ["allowlist", "unrestricted"])
197
+ return false unless auth_email_mode_validator.valid?(@auth_email_mode)
180
198
  true
181
199
  end
182
200
 
@@ -230,6 +248,16 @@ module Zyphr
230
248
  @test_recipients = test_recipients
231
249
  end
232
250
 
251
+ # Custom attribute writer method checking allowed values (enum).
252
+ # @param [Object] auth_email_mode Object to be assigned
253
+ def auth_email_mode=(auth_email_mode)
254
+ validator = EnumAttributeValidator.new('String', ["allowlist", "unrestricted"])
255
+ unless validator.valid?(auth_email_mode)
256
+ fail ArgumentError, "invalid value for \"auth_email_mode\", must be one of #{validator.allowable_values}."
257
+ end
258
+ @auth_email_mode = auth_email_mode
259
+ end
260
+
233
261
  # Checks equality by comparing each attribute.
234
262
  # @param [Object] Object to be compared
235
263
  def ==(o)
@@ -239,7 +267,8 @@ module Zyphr
239
267
  name == o.name &&
240
268
  environment == o.environment &&
241
269
  signing_algorithm == o.signing_algorithm &&
242
- test_recipients == o.test_recipients
270
+ test_recipients == o.test_recipients &&
271
+ auth_email_mode == o.auth_email_mode
243
272
  end
244
273
 
245
274
  # @see the `==` method
@@ -251,7 +280,7 @@ module Zyphr
251
280
  # Calculates hash code according to all attributes.
252
281
  # @return [Integer] Hash code
253
282
  def hash
254
- [id, name, environment, signing_algorithm, test_recipients].hash
283
+ [id, name, environment, signing_algorithm, test_recipients, auth_email_mode].hash
255
284
  end
256
285
 
257
286
  # Builds the object from hash
@@ -37,6 +37,9 @@ module Zyphr
37
37
  # Whether commonly used passwords are rejected.
38
38
  attr_accessor :disallow_common
39
39
 
40
+ # 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).
41
+ attr_accessor :disallow_breached
42
+
40
43
  # Attribute mapping from ruby-style variable name to JSON key.
41
44
  def self.attribute_map
42
45
  {
@@ -46,7 +49,8 @@ module Zyphr
46
49
  :'require_lowercase' => :'require_lowercase',
47
50
  :'require_numbers' => :'require_numbers',
48
51
  :'require_special' => :'require_special',
49
- :'disallow_common' => :'disallow_common'
52
+ :'disallow_common' => :'disallow_common',
53
+ :'disallow_breached' => :'disallow_breached'
50
54
  }
51
55
  end
52
56
 
@@ -69,7 +73,8 @@ module Zyphr
69
73
  :'require_lowercase' => :'Boolean',
70
74
  :'require_numbers' => :'Boolean',
71
75
  :'require_special' => :'Boolean',
72
- :'disallow_common' => :'Boolean'
76
+ :'disallow_common' => :'Boolean',
77
+ :'disallow_breached' => :'Boolean'
73
78
  }
74
79
  end
75
80
 
@@ -136,6 +141,12 @@ module Zyphr
136
141
  else
137
142
  self.disallow_common = nil
138
143
  end
144
+
145
+ if attributes.key?(:'disallow_breached')
146
+ self.disallow_breached = attributes[:'disallow_breached']
147
+ else
148
+ self.disallow_breached = nil
149
+ end
139
150
  end
140
151
 
141
152
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -171,6 +182,10 @@ module Zyphr
171
182
  invalid_properties.push('invalid value for "disallow_common", disallow_common cannot be nil.')
172
183
  end
173
184
 
185
+ if @disallow_breached.nil?
186
+ invalid_properties.push('invalid value for "disallow_breached", disallow_breached cannot be nil.')
187
+ end
188
+
174
189
  invalid_properties
175
190
  end
176
191
 
@@ -185,6 +200,7 @@ module Zyphr
185
200
  return false if @require_numbers.nil?
186
201
  return false if @require_special.nil?
187
202
  return false if @disallow_common.nil?
203
+ return false if @disallow_breached.nil?
188
204
  true
189
205
  end
190
206
 
@@ -258,6 +274,16 @@ module Zyphr
258
274
  @disallow_common = disallow_common
259
275
  end
260
276
 
277
+ # Custom attribute writer method with validation
278
+ # @param [Object] disallow_breached Value to be assigned
279
+ def disallow_breached=(disallow_breached)
280
+ if disallow_breached.nil?
281
+ fail ArgumentError, 'disallow_breached cannot be nil'
282
+ end
283
+
284
+ @disallow_breached = 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)
@@ -269,7 +295,8 @@ module Zyphr
269
295
  require_lowercase == o.require_lowercase &&
270
296
  require_numbers == o.require_numbers &&
271
297
  require_special == o.require_special &&
272
- disallow_common == o.disallow_common
298
+ disallow_common == o.disallow_common &&
299
+ disallow_breached == o.disallow_breached
273
300
  end
274
301
 
275
302
  # @see the `==` method
@@ -281,7 +308,7 @@ module Zyphr
281
308
  # Calculates hash code according to all attributes.
282
309
  # @return [Integer] Hash code
283
310
  def hash
284
- [min_length, max_length, require_uppercase, require_lowercase, require_numbers, require_special, disallow_common].hash
311
+ [min_length, max_length, require_uppercase, require_lowercase, require_numbers, require_special, disallow_common, disallow_breached].hash
285
312
  end
286
313
 
287
314
  # Builds the object from hash
@@ -15,10 +15,16 @@ require 'time'
15
15
 
16
16
  module Zyphr
17
17
  class PasswordStrength
18
- # Whether the password would be accepted by the server's enforcement path. A password that is valid here is accepted by registration.
18
+ # 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).
19
19
  attr_accessor :valid
20
20
 
21
- # Strength score, 0-100.
21
+ # 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`.
22
+ attr_accessor :breached
23
+
24
+ # HIBP occurrence count for the password (0 if not breached or if the breach lookup failed/was unavailable).
25
+ attr_accessor :breach_count
26
+
27
+ # Strength score, 0-100. A pure composition measure — independent of the breach signal.
22
28
  attr_accessor :score
23
29
 
24
30
  # Strength label derived from the score.
@@ -53,6 +59,8 @@ module Zyphr
53
59
  def self.attribute_map
54
60
  {
55
61
  :'valid' => :'valid',
62
+ :'breached' => :'breached',
63
+ :'breach_count' => :'breach_count',
56
64
  :'score' => :'score',
57
65
  :'label' => :'label',
58
66
  :'feedback' => :'feedback'
@@ -73,6 +81,8 @@ module Zyphr
73
81
  def self.openapi_types
74
82
  {
75
83
  :'valid' => :'Boolean',
84
+ :'breached' => :'Boolean',
85
+ :'breach_count' => :'Integer',
76
86
  :'score' => :'Integer',
77
87
  :'label' => :'String',
78
88
  :'feedback' => :'Array<String>'
@@ -107,6 +117,18 @@ module Zyphr
107
117
  self.valid = nil
108
118
  end
109
119
 
120
+ if attributes.key?(:'breached')
121
+ self.breached = attributes[:'breached']
122
+ else
123
+ self.breached = nil
124
+ end
125
+
126
+ if attributes.key?(:'breach_count')
127
+ self.breach_count = attributes[:'breach_count']
128
+ else
129
+ self.breach_count = nil
130
+ end
131
+
110
132
  if attributes.key?(:'score')
111
133
  self.score = attributes[:'score']
112
134
  else
@@ -137,6 +159,18 @@ module Zyphr
137
159
  invalid_properties.push('invalid value for "valid", valid cannot be nil.')
138
160
  end
139
161
 
162
+ if @breached.nil?
163
+ invalid_properties.push('invalid value for "breached", breached cannot be nil.')
164
+ end
165
+
166
+ if @breach_count.nil?
167
+ invalid_properties.push('invalid value for "breach_count", breach_count cannot be nil.')
168
+ end
169
+
170
+ if @breach_count < 0
171
+ invalid_properties.push('invalid value for "breach_count", must be greater than or equal to 0.')
172
+ end
173
+
140
174
  if @score.nil?
141
175
  invalid_properties.push('invalid value for "score", score cannot be nil.')
142
176
  end
@@ -165,6 +199,9 @@ module Zyphr
165
199
  def valid?
166
200
  warn '[DEPRECATED] the `valid?` method is obsolete'
167
201
  return false if @valid.nil?
202
+ return false if @breached.nil?
203
+ return false if @breach_count.nil?
204
+ return false if @breach_count < 0
168
205
  return false if @score.nil?
169
206
  return false if @score > 100
170
207
  return false if @score < 0
@@ -185,6 +222,30 @@ module Zyphr
185
222
  @valid = valid
186
223
  end
187
224
 
225
+ # Custom attribute writer method with validation
226
+ # @param [Object] breached Value to be assigned
227
+ def breached=(breached)
228
+ if breached.nil?
229
+ fail ArgumentError, 'breached cannot be nil'
230
+ end
231
+
232
+ @breached = breached
233
+ end
234
+
235
+ # Custom attribute writer method with validation
236
+ # @param [Object] breach_count Value to be assigned
237
+ def breach_count=(breach_count)
238
+ if breach_count.nil?
239
+ fail ArgumentError, 'breach_count cannot be nil'
240
+ end
241
+
242
+ if breach_count < 0
243
+ fail ArgumentError, 'invalid value for "breach_count", must be greater than or equal to 0.'
244
+ end
245
+
246
+ @breach_count = breach_count
247
+ end
248
+
188
249
  # Custom attribute writer method with validation
189
250
  # @param [Object] score Value to be assigned
190
251
  def score=(score)
@@ -229,6 +290,8 @@ module Zyphr
229
290
  return true if self.equal?(o)
230
291
  self.class == o.class &&
231
292
  valid == o.valid &&
293
+ breached == o.breached &&
294
+ breach_count == o.breach_count &&
232
295
  score == o.score &&
233
296
  label == o.label &&
234
297
  feedback == o.feedback
@@ -243,7 +306,7 @@ module Zyphr
243
306
  # Calculates hash code according to all attributes.
244
307
  # @return [Integer] Hash code
245
308
  def hash
246
- [valid, score, label, feedback].hash
309
+ [valid, breached, breach_count, score, label, feedback].hash
247
310
  end
248
311
 
249
312
  # Builds the object from hash
@@ -14,14 +14,41 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Zyphr
17
+ # Provide test_recipients and/or auth_email_mode. Omitting one leaves that value unchanged; sending neither is a 400.
17
18
  class SetSelfApplicationTestRecipientsRequest
18
- # Email addresses allowed to receive auth emails. An empty array clears the allowlist (disables the gate).
19
+ # Email addresses allowed to receive auth emails when auth_email_mode is 'allowlist'. Ignored in 'unrestricted' mode. Optional omit to leave the current list unchanged.
19
20
  attr_accessor :test_recipients
20
21
 
22
+ # Optional (sc-7673). Explicit auth-email gate mode. 'unrestricted' sends to everyone; 'allowlist' restricts to test_recipients (an EMPTY list in allowlist mode fails closed — blocks all auth email). Omit to leave the current mode unchanged.
23
+ attr_accessor :auth_email_mode
24
+
25
+ class EnumAttributeValidator
26
+ attr_reader :datatype
27
+ attr_reader :allowable_values
28
+
29
+ def initialize(datatype, allowable_values)
30
+ @allowable_values = allowable_values.map do |value|
31
+ case datatype.to_s
32
+ when /Integer/i
33
+ value.to_i
34
+ when /Float/i
35
+ value.to_f
36
+ else
37
+ value
38
+ end
39
+ end
40
+ end
41
+
42
+ def valid?(value)
43
+ !value || allowable_values.include?(value)
44
+ end
45
+ end
46
+
21
47
  # Attribute mapping from ruby-style variable name to JSON key.
22
48
  def self.attribute_map
23
49
  {
24
- :'test_recipients' => :'test_recipients'
50
+ :'test_recipients' => :'test_recipients',
51
+ :'auth_email_mode' => :'auth_email_mode'
25
52
  }
26
53
  end
27
54
 
@@ -38,7 +65,8 @@ module Zyphr
38
65
  # Attribute type mapping.
39
66
  def self.openapi_types
40
67
  {
41
- :'test_recipients' => :'Array<String>'
68
+ :'test_recipients' => :'Array<String>',
69
+ :'auth_email_mode' => :'String'
42
70
  }
43
71
  end
44
72
 
@@ -68,8 +96,10 @@ module Zyphr
68
96
  if (value = attributes[:'test_recipients']).is_a?(Array)
69
97
  self.test_recipients = value
70
98
  end
71
- else
72
- self.test_recipients = nil
99
+ end
100
+
101
+ if attributes.key?(:'auth_email_mode')
102
+ self.auth_email_mode = attributes[:'auth_email_mode']
73
103
  end
74
104
  end
75
105
 
@@ -78,10 +108,6 @@ module Zyphr
78
108
  def list_invalid_properties
79
109
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
80
110
  invalid_properties = Array.new
81
- if @test_recipients.nil?
82
- invalid_properties.push('invalid value for "test_recipients", test_recipients cannot be nil.')
83
- end
84
-
85
111
  invalid_properties
86
112
  end
87
113
 
@@ -89,18 +115,19 @@ module Zyphr
89
115
  # @return true if the model is valid
90
116
  def valid?
91
117
  warn '[DEPRECATED] the `valid?` method is obsolete'
92
- return false if @test_recipients.nil?
118
+ auth_email_mode_validator = EnumAttributeValidator.new('String', ["allowlist", "unrestricted"])
119
+ return false unless auth_email_mode_validator.valid?(@auth_email_mode)
93
120
  true
94
121
  end
95
122
 
96
- # Custom attribute writer method with validation
97
- # @param [Object] test_recipients Value to be assigned
98
- def test_recipients=(test_recipients)
99
- if test_recipients.nil?
100
- fail ArgumentError, 'test_recipients cannot be nil'
123
+ # Custom attribute writer method checking allowed values (enum).
124
+ # @param [Object] auth_email_mode Object to be assigned
125
+ def auth_email_mode=(auth_email_mode)
126
+ validator = EnumAttributeValidator.new('String', ["allowlist", "unrestricted"])
127
+ unless validator.valid?(auth_email_mode)
128
+ fail ArgumentError, "invalid value for \"auth_email_mode\", must be one of #{validator.allowable_values}."
101
129
  end
102
-
103
- @test_recipients = test_recipients
130
+ @auth_email_mode = auth_email_mode
104
131
  end
105
132
 
106
133
  # Checks equality by comparing each attribute.
@@ -108,7 +135,8 @@ module Zyphr
108
135
  def ==(o)
109
136
  return true if self.equal?(o)
110
137
  self.class == o.class &&
111
- test_recipients == o.test_recipients
138
+ test_recipients == o.test_recipients &&
139
+ auth_email_mode == o.auth_email_mode
112
140
  end
113
141
 
114
142
  # @see the `==` method
@@ -120,7 +148,7 @@ module Zyphr
120
148
  # Calculates hash code according to all attributes.
121
149
  # @return [Integer] Hash code
122
150
  def hash
123
- [test_recipients].hash
151
+ [test_recipients, auth_email_mode].hash
124
152
  end
125
153
 
126
154
  # Builds the object from hash
@@ -65,4 +65,14 @@ describe Zyphr::ApplicationSelf do
65
65
  end
66
66
  end
67
67
 
68
+ describe 'test attribute "auth_email_mode"' do
69
+ it 'should work' do
70
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
71
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["allowlist", "unrestricted"])
72
+ # validator.allowable_values.each do |value|
73
+ # expect { instance.auth_email_mode = value }.not_to raise_error
74
+ # end
75
+ end
76
+ end
77
+
68
78
  end
@@ -69,4 +69,10 @@ describe Zyphr::PasswordPolicy do
69
69
  end
70
70
  end
71
71
 
72
+ describe 'test attribute "disallow_breached"' do
73
+ it 'should work' do
74
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
75
+ end
76
+ end
77
+
72
78
  end
@@ -33,6 +33,18 @@ describe Zyphr::PasswordStrength do
33
33
  end
34
34
  end
35
35
 
36
+ describe 'test attribute "breached"' do
37
+ it 'should work' do
38
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
+ end
40
+ end
41
+
42
+ describe 'test attribute "breach_count"' do
43
+ it 'should work' do
44
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
45
+ end
46
+ end
47
+
36
48
  describe 'test attribute "score"' do
37
49
  it 'should work' do
38
50
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
@@ -33,4 +33,14 @@ describe Zyphr::SetSelfApplicationTestRecipientsRequest do
33
33
  end
34
34
  end
35
35
 
36
+ describe 'test attribute "auth_email_mode"' do
37
+ it 'should work' do
38
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["allowlist", "unrestricted"])
40
+ # validator.allowable_values.each do |value|
41
+ # expect { instance.auth_email_mode = value }.not_to raise_error
42
+ # end
43
+ end
44
+ end
45
+
36
46
  end
data/zyphr.gemspec CHANGED
@@ -17,7 +17,7 @@ require "zyphr/version"
17
17
 
18
18
  Gem::Specification.new do |s|
19
19
  s.name = "zyphr"
20
- s.version = '0.1.49'
20
+ s.version = '0.1.51'
21
21
  s.platform = Gem::Platform::RUBY
22
22
  s.authors = ["Zyphr"]
23
23
  s.email = ["support@zyphr.dev"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zyphr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.49
4
+ version: 0.1.51
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zyphr