passageidentity 0.7.1 → 1.0.1

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.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/lib/openapi_client/api/magic_links_api.rb +1 -1
  3. data/lib/openapi_client/api/tokens_api.rb +1 -1
  4. data/lib/openapi_client/api/user_devices_api.rb +1 -1
  5. data/lib/openapi_client/api/users_api.rb +19 -19
  6. data/lib/openapi_client/api_client.rb +1 -1
  7. data/lib/openapi_client/api_error.rb +1 -1
  8. data/lib/openapi_client/configuration.rb +1 -1
  9. data/lib/openapi_client/models/apple_user_social_connection.rb +1 -1
  10. data/lib/openapi_client/models/create_magic_link_request.rb +22 -3
  11. data/lib/openapi_client/models/{create_user_request.rb → create_user_args.rb} +4 -4
  12. data/lib/openapi_client/models/github_user_social_connection.rb +1 -1
  13. data/lib/openapi_client/models/google_user_social_connection.rb +1 -1
  14. data/lib/openapi_client/models/link.rb +1 -1
  15. data/lib/openapi_client/models/list_devices_response.rb +1 -1
  16. data/lib/openapi_client/models/list_paginated_users_item.rb +1 -1
  17. data/lib/openapi_client/models/list_paginated_users_response.rb +1 -1
  18. data/lib/openapi_client/models/magic_link.rb +2 -1
  19. data/lib/openapi_client/models/magic_link_channel.rb +1 -1
  20. data/lib/openapi_client/models/{theme_type.rb → magic_link_language.rb} +12 -8
  21. data/lib/openapi_client/models/magic_link_response.rb +1 -1
  22. data/lib/openapi_client/models/magic_link_type.rb +1 -1
  23. data/lib/openapi_client/models/model400_error.rb +1 -1
  24. data/lib/openapi_client/models/model401_error.rb +1 -1
  25. data/lib/openapi_client/models/model403_error.rb +1 -1
  26. data/lib/openapi_client/models/model404_error.rb +1 -1
  27. data/lib/openapi_client/models/model500_error.rb +1 -1
  28. data/lib/openapi_client/models/nonce.rb +1 -1
  29. data/lib/openapi_client/models/paginated_links.rb +1 -1
  30. data/lib/openapi_client/models/{user_info.rb → passage_user.rb} +4 -4
  31. data/lib/openapi_client/models/social_connection_type.rb +1 -1
  32. data/lib/openapi_client/models/{update_user_request.rb → update_user_args.rb} +4 -4
  33. data/lib/openapi_client/models/user_event_action.rb +1 -1
  34. data/lib/openapi_client/models/user_event_status.rb +1 -1
  35. data/lib/openapi_client/models/user_recent_event.rb +1 -1
  36. data/lib/openapi_client/models/user_response.rb +2 -2
  37. data/lib/openapi_client/models/user_social_connections.rb +1 -1
  38. data/lib/openapi_client/models/user_status.rb +1 -1
  39. data/lib/openapi_client/models/web_authn_devices.rb +1 -1
  40. data/lib/openapi_client/models/web_authn_icons.rb +1 -1
  41. data/lib/openapi_client/models/web_authn_type.rb +1 -1
  42. data/lib/openapi_client/version.rb +1 -1
  43. data/lib/openapi_client.rb +5 -20
  44. data/lib/passageidentity/auth.rb +43 -156
  45. data/lib/passageidentity/client.rb +16 -96
  46. data/lib/passageidentity/user.rb +246 -0
  47. data/lib/passageidentity/version.rb +1 -1
  48. metadata +42 -40
  49. data/lib/models/update_magic_link_auth_method.rb +0 -276
  50. data/lib/models/update_otp_auth_method.rb +0 -276
  51. data/lib/models/update_passkeys_auth_method.rb +0 -216
  52. data/lib/openapi_client/api/apps_api.rb +0 -85
  53. data/lib/openapi_client/models/app_info.rb +0 -886
  54. data/lib/openapi_client/models/app_response.rb +0 -221
  55. data/lib/openapi_client/models/auth_methods.rb +0 -254
  56. data/lib/openapi_client/models/element_customization.rb +0 -457
  57. data/lib/openapi_client/models/font_family.rb +0 -58
  58. data/lib/openapi_client/models/layout_config.rb +0 -285
  59. data/lib/openapi_client/models/layouts.rb +0 -241
  60. data/lib/openapi_client/models/magic_link_auth_method.rb +0 -295
  61. data/lib/openapi_client/models/otp_auth_method.rb +0 -295
  62. data/lib/openapi_client/models/passkeys_auth_method.rb +0 -221
  63. data/lib/openapi_client/models/technologies.rb +0 -46
  64. data/lib/openapi_client/models/ttl_display_unit.rb +0 -42
  65. data/lib/openapi_client/models/user_metadata_field.rb +0 -323
  66. data/lib/openapi_client/models/user_metadata_field_type.rb +0 -44
  67. data/lib/passageidentity/user_api.rb +0 -218
@@ -1,295 +0,0 @@
1
- =begin
2
- #Passage Management API
3
-
4
- #Passage's management API to manage your Passage apps and users.
5
-
6
- The version of the OpenAPI document: 1
7
- Contact: support@passage.id
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.11.0-SNAPSHOT
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module OpenapiClient
17
- class MagicLinkAuthMethod
18
- attr_accessor :enabled
19
-
20
- # Maximum time (IN SECONDS) for the auth to expire.
21
- attr_accessor :ttl
22
-
23
- attr_accessor :ttl_display_unit
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
-
47
- # Attribute mapping from ruby-style variable name to JSON key.
48
- def self.attribute_map
49
- {
50
- :'enabled' => :'enabled',
51
- :'ttl' => :'ttl',
52
- :'ttl_display_unit' => :'ttl_display_unit'
53
- }
54
- end
55
-
56
- # Returns all the JSON keys this model knows about
57
- def self.acceptable_attributes
58
- attribute_map.values
59
- end
60
-
61
- # Attribute type mapping.
62
- def self.openapi_types
63
- {
64
- :'enabled' => :'Boolean',
65
- :'ttl' => :'Integer',
66
- :'ttl_display_unit' => :'TtlDisplayUnit'
67
- }
68
- end
69
-
70
- # List of attributes with nullable: true
71
- def self.openapi_nullable
72
- Set.new([
73
- ])
74
- end
75
-
76
- # Initializes the object
77
- # @param [Hash] attributes Model attributes in the form of hash
78
- def initialize(attributes = {})
79
- if (!attributes.is_a?(Hash))
80
- fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::MagicLinkAuthMethod` initialize method"
81
- end
82
-
83
- # check to see if the attribute exists and convert string to symbol for hash key
84
- attributes = attributes.each_with_object({}) { |(k, v), h|
85
- if (!self.class.attribute_map.key?(k.to_sym))
86
- fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::MagicLinkAuthMethod`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
87
- end
88
- h[k.to_sym] = v
89
- }
90
-
91
- if attributes.key?(:'enabled')
92
- self.enabled = attributes[:'enabled']
93
- else
94
- self.enabled = nil
95
- end
96
-
97
- if attributes.key?(:'ttl')
98
- self.ttl = attributes[:'ttl']
99
- else
100
- self.ttl = 300
101
- end
102
-
103
- if attributes.key?(:'ttl_display_unit')
104
- self.ttl_display_unit = attributes[:'ttl_display_unit']
105
- else
106
- self.ttl_display_unit = nil
107
- end
108
- end
109
-
110
- # Show invalid properties with the reasons. Usually used together with valid?
111
- # @return Array for valid properties with the reasons
112
- def list_invalid_properties
113
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
114
- invalid_properties = Array.new
115
- if @enabled.nil?
116
- invalid_properties.push('invalid value for "enabled", enabled cannot be nil.')
117
- end
118
-
119
- if @ttl.nil?
120
- invalid_properties.push('invalid value for "ttl", ttl cannot be nil.')
121
- end
122
-
123
- if @ttl < 60
124
- invalid_properties.push('invalid value for "ttl", must be greater than or equal to 60.')
125
- end
126
-
127
- if @ttl_display_unit.nil?
128
- invalid_properties.push('invalid value for "ttl_display_unit", ttl_display_unit cannot be nil.')
129
- end
130
-
131
- invalid_properties
132
- end
133
-
134
- # Check to see if the all the properties in the model are valid
135
- # @return true if the model is valid
136
- def valid?
137
- warn '[DEPRECATED] the `valid?` method is obsolete'
138
- return false if @enabled.nil?
139
- return false if @ttl.nil?
140
- return false if @ttl < 60
141
- return false if @ttl_display_unit.nil?
142
- true
143
- end
144
-
145
- # Custom attribute writer method with validation
146
- # @param [Object] ttl Value to be assigned
147
- def ttl=(ttl)
148
- if ttl.nil?
149
- fail ArgumentError, 'ttl cannot be nil'
150
- end
151
-
152
- if ttl < 60
153
- fail ArgumentError, 'invalid value for "ttl", must be greater than or equal to 60.'
154
- end
155
-
156
- @ttl = ttl
157
- end
158
-
159
- # Checks equality by comparing each attribute.
160
- # @param [Object] Object to be compared
161
- def ==(o)
162
- return true if self.equal?(o)
163
- self.class == o.class &&
164
- enabled == o.enabled &&
165
- ttl == o.ttl &&
166
- ttl_display_unit == o.ttl_display_unit
167
- end
168
-
169
- # @see the `==` method
170
- # @param [Object] Object to be compared
171
- def eql?(o)
172
- self == o
173
- end
174
-
175
- # Calculates hash code according to all attributes.
176
- # @return [Integer] Hash code
177
- def hash
178
- [enabled, ttl, ttl_display_unit].hash
179
- end
180
-
181
- # Builds the object from hash
182
- # @param [Hash] attributes Model attributes in the form of hash
183
- # @return [Object] Returns the model itself
184
- def self.build_from_hash(attributes)
185
- return nil unless attributes.is_a?(Hash)
186
- attributes = attributes.transform_keys(&:to_sym)
187
- transformed_hash = {}
188
- openapi_types.each_pair do |key, type|
189
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
190
- transformed_hash["#{key}"] = nil
191
- elsif type =~ /\AArray<(.*)>/i
192
- # check to ensure the input is an array given that the attribute
193
- # is documented as an array but the input is not
194
- if attributes[attribute_map[key]].is_a?(Array)
195
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
196
- end
197
- elsif !attributes[attribute_map[key]].nil?
198
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
199
- end
200
- end
201
- new(transformed_hash)
202
- end
203
-
204
- # Deserializes the data based on type
205
- # @param string type Data type
206
- # @param string value Value to be deserialized
207
- # @return [Object] Deserialized data
208
- def self._deserialize(type, value)
209
- case type.to_sym
210
- when :Time
211
- Time.parse(value)
212
- when :Date
213
- Date.parse(value)
214
- when :String
215
- value.to_s
216
- when :Integer
217
- value.to_i
218
- when :Float
219
- value.to_f
220
- when :Boolean
221
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
222
- true
223
- else
224
- false
225
- end
226
- when :Object
227
- # generic object (usually a Hash), return directly
228
- value
229
- when /\AArray<(?<inner_type>.+)>\z/
230
- inner_type = Regexp.last_match[:inner_type]
231
- value.map { |v| _deserialize(inner_type, v) }
232
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
233
- k_type = Regexp.last_match[:k_type]
234
- v_type = Regexp.last_match[:v_type]
235
- {}.tap do |hash|
236
- value.each do |k, v|
237
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
238
- end
239
- end
240
- else # model
241
- # models (e.g. Pet) or oneOf
242
- klass = OpenapiClient.const_get(type)
243
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
244
- end
245
- end
246
-
247
- # Returns the string representation of the object
248
- # @return [String] String presentation of the object
249
- def to_s
250
- to_hash.to_s
251
- end
252
-
253
- # to_body is an alias to to_hash (backward compatibility)
254
- # @return [Hash] Returns the object in the form of hash
255
- def to_body
256
- to_hash
257
- end
258
-
259
- # Returns the object in the form of hash
260
- # @return [Hash] Returns the object in the form of hash
261
- def to_hash
262
- hash = {}
263
- self.class.attribute_map.each_pair do |attr, param|
264
- value = self.send(attr)
265
- if value.nil?
266
- is_nullable = self.class.openapi_nullable.include?(attr)
267
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
268
- end
269
-
270
- hash[param] = _to_hash(value)
271
- end
272
- hash
273
- end
274
-
275
- # Outputs non-array value in the form of hash
276
- # For object, use to_hash. Otherwise, just return the value
277
- # @param [Object] value Any valid value
278
- # @return [Hash] Returns the value in the form of hash
279
- def _to_hash(value)
280
- if value.is_a?(Array)
281
- value.compact.map { |v| _to_hash(v) }
282
- elsif value.is_a?(Hash)
283
- {}.tap do |hash|
284
- value.each { |k, v| hash[k] = _to_hash(v) }
285
- end
286
- elsif value.respond_to? :to_hash
287
- value.to_hash
288
- else
289
- value
290
- end
291
- end
292
-
293
- end
294
-
295
- end
@@ -1,295 +0,0 @@
1
- =begin
2
- #Passage Management API
3
-
4
- #Passage's management API to manage your Passage apps and users.
5
-
6
- The version of the OpenAPI document: 1
7
- Contact: support@passage.id
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.11.0-SNAPSHOT
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module OpenapiClient
17
- class OtpAuthMethod
18
- attr_accessor :enabled
19
-
20
- # Maximum time (IN SECONDS) for the auth to expire.
21
- attr_accessor :ttl
22
-
23
- attr_accessor :ttl_display_unit
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
-
47
- # Attribute mapping from ruby-style variable name to JSON key.
48
- def self.attribute_map
49
- {
50
- :'enabled' => :'enabled',
51
- :'ttl' => :'ttl',
52
- :'ttl_display_unit' => :'ttl_display_unit'
53
- }
54
- end
55
-
56
- # Returns all the JSON keys this model knows about
57
- def self.acceptable_attributes
58
- attribute_map.values
59
- end
60
-
61
- # Attribute type mapping.
62
- def self.openapi_types
63
- {
64
- :'enabled' => :'Boolean',
65
- :'ttl' => :'Integer',
66
- :'ttl_display_unit' => :'TtlDisplayUnit'
67
- }
68
- end
69
-
70
- # List of attributes with nullable: true
71
- def self.openapi_nullable
72
- Set.new([
73
- ])
74
- end
75
-
76
- # Initializes the object
77
- # @param [Hash] attributes Model attributes in the form of hash
78
- def initialize(attributes = {})
79
- if (!attributes.is_a?(Hash))
80
- fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::OtpAuthMethod` initialize method"
81
- end
82
-
83
- # check to see if the attribute exists and convert string to symbol for hash key
84
- attributes = attributes.each_with_object({}) { |(k, v), h|
85
- if (!self.class.attribute_map.key?(k.to_sym))
86
- fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::OtpAuthMethod`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
87
- end
88
- h[k.to_sym] = v
89
- }
90
-
91
- if attributes.key?(:'enabled')
92
- self.enabled = attributes[:'enabled']
93
- else
94
- self.enabled = nil
95
- end
96
-
97
- if attributes.key?(:'ttl')
98
- self.ttl = attributes[:'ttl']
99
- else
100
- self.ttl = 300
101
- end
102
-
103
- if attributes.key?(:'ttl_display_unit')
104
- self.ttl_display_unit = attributes[:'ttl_display_unit']
105
- else
106
- self.ttl_display_unit = nil
107
- end
108
- end
109
-
110
- # Show invalid properties with the reasons. Usually used together with valid?
111
- # @return Array for valid properties with the reasons
112
- def list_invalid_properties
113
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
114
- invalid_properties = Array.new
115
- if @enabled.nil?
116
- invalid_properties.push('invalid value for "enabled", enabled cannot be nil.')
117
- end
118
-
119
- if @ttl.nil?
120
- invalid_properties.push('invalid value for "ttl", ttl cannot be nil.')
121
- end
122
-
123
- if @ttl < 60
124
- invalid_properties.push('invalid value for "ttl", must be greater than or equal to 60.')
125
- end
126
-
127
- if @ttl_display_unit.nil?
128
- invalid_properties.push('invalid value for "ttl_display_unit", ttl_display_unit cannot be nil.')
129
- end
130
-
131
- invalid_properties
132
- end
133
-
134
- # Check to see if the all the properties in the model are valid
135
- # @return true if the model is valid
136
- def valid?
137
- warn '[DEPRECATED] the `valid?` method is obsolete'
138
- return false if @enabled.nil?
139
- return false if @ttl.nil?
140
- return false if @ttl < 60
141
- return false if @ttl_display_unit.nil?
142
- true
143
- end
144
-
145
- # Custom attribute writer method with validation
146
- # @param [Object] ttl Value to be assigned
147
- def ttl=(ttl)
148
- if ttl.nil?
149
- fail ArgumentError, 'ttl cannot be nil'
150
- end
151
-
152
- if ttl < 60
153
- fail ArgumentError, 'invalid value for "ttl", must be greater than or equal to 60.'
154
- end
155
-
156
- @ttl = ttl
157
- end
158
-
159
- # Checks equality by comparing each attribute.
160
- # @param [Object] Object to be compared
161
- def ==(o)
162
- return true if self.equal?(o)
163
- self.class == o.class &&
164
- enabled == o.enabled &&
165
- ttl == o.ttl &&
166
- ttl_display_unit == o.ttl_display_unit
167
- end
168
-
169
- # @see the `==` method
170
- # @param [Object] Object to be compared
171
- def eql?(o)
172
- self == o
173
- end
174
-
175
- # Calculates hash code according to all attributes.
176
- # @return [Integer] Hash code
177
- def hash
178
- [enabled, ttl, ttl_display_unit].hash
179
- end
180
-
181
- # Builds the object from hash
182
- # @param [Hash] attributes Model attributes in the form of hash
183
- # @return [Object] Returns the model itself
184
- def self.build_from_hash(attributes)
185
- return nil unless attributes.is_a?(Hash)
186
- attributes = attributes.transform_keys(&:to_sym)
187
- transformed_hash = {}
188
- openapi_types.each_pair do |key, type|
189
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
190
- transformed_hash["#{key}"] = nil
191
- elsif type =~ /\AArray<(.*)>/i
192
- # check to ensure the input is an array given that the attribute
193
- # is documented as an array but the input is not
194
- if attributes[attribute_map[key]].is_a?(Array)
195
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
196
- end
197
- elsif !attributes[attribute_map[key]].nil?
198
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
199
- end
200
- end
201
- new(transformed_hash)
202
- end
203
-
204
- # Deserializes the data based on type
205
- # @param string type Data type
206
- # @param string value Value to be deserialized
207
- # @return [Object] Deserialized data
208
- def self._deserialize(type, value)
209
- case type.to_sym
210
- when :Time
211
- Time.parse(value)
212
- when :Date
213
- Date.parse(value)
214
- when :String
215
- value.to_s
216
- when :Integer
217
- value.to_i
218
- when :Float
219
- value.to_f
220
- when :Boolean
221
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
222
- true
223
- else
224
- false
225
- end
226
- when :Object
227
- # generic object (usually a Hash), return directly
228
- value
229
- when /\AArray<(?<inner_type>.+)>\z/
230
- inner_type = Regexp.last_match[:inner_type]
231
- value.map { |v| _deserialize(inner_type, v) }
232
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
233
- k_type = Regexp.last_match[:k_type]
234
- v_type = Regexp.last_match[:v_type]
235
- {}.tap do |hash|
236
- value.each do |k, v|
237
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
238
- end
239
- end
240
- else # model
241
- # models (e.g. Pet) or oneOf
242
- klass = OpenapiClient.const_get(type)
243
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
244
- end
245
- end
246
-
247
- # Returns the string representation of the object
248
- # @return [String] String presentation of the object
249
- def to_s
250
- to_hash.to_s
251
- end
252
-
253
- # to_body is an alias to to_hash (backward compatibility)
254
- # @return [Hash] Returns the object in the form of hash
255
- def to_body
256
- to_hash
257
- end
258
-
259
- # Returns the object in the form of hash
260
- # @return [Hash] Returns the object in the form of hash
261
- def to_hash
262
- hash = {}
263
- self.class.attribute_map.each_pair do |attr, param|
264
- value = self.send(attr)
265
- if value.nil?
266
- is_nullable = self.class.openapi_nullable.include?(attr)
267
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
268
- end
269
-
270
- hash[param] = _to_hash(value)
271
- end
272
- hash
273
- end
274
-
275
- # Outputs non-array value in the form of hash
276
- # For object, use to_hash. Otherwise, just return the value
277
- # @param [Object] value Any valid value
278
- # @return [Hash] Returns the value in the form of hash
279
- def _to_hash(value)
280
- if value.is_a?(Array)
281
- value.compact.map { |v| _to_hash(v) }
282
- elsif value.is_a?(Hash)
283
- {}.tap do |hash|
284
- value.each { |k, v| hash[k] = _to_hash(v) }
285
- end
286
- elsif value.respond_to? :to_hash
287
- value.to_hash
288
- else
289
- value
290
- end
291
- end
292
-
293
- end
294
-
295
- end