zyphr 0.1.49 → 0.1.50

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: a4fd52fa232b4a334d6ea406412fa92ee9d076583b6038b8e9d0231b5c77c016
4
+ data.tar.gz: 2f2e95c64d51dc3f4c48309a580d7e21960fc5a3665359b5986431e1f833c6b5
5
5
  SHA512:
6
- metadata.gz: f5ee08fe9c4eeef999128e99152514ffd2b9f8d4f6c9b3e38b94c96ec1402c0a1ac938e8b736b38caa1e315e1e1ba9a9b48742e97e1e076c7348b7c022cc6176
7
- data.tar.gz: a3371945d133e515c6261c0063978a79a1cba97b99593963d9325321fdc901fe551f09c897be380bee4db9af26b8e16fe9049357a2c0bfd554bc92550d0d3c60
6
+ metadata.gz: 48bdb019fd49d35023234cc46edb30ed3aa0716a267aefa6fbfb8c3147be8e3cde1bf60bd01f0c12e1e443111fd5bb58f49a853d2c09e1c28b91040103c1f0fe
7
+ data.tar.gz: fc7da20a4d8529d1a12e120bf0ffcf30588f26cc4abbfe8c0ea386c21d3435eac9aca82229a96f416d8d5826542881ec71c62f47c453b75179bdd9fd9f94e734
@@ -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
@@ -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
@@ -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
@@ -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.50'
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.50
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zyphr