ory-kratos-client 0.1.0.alpha5 → 0.1.0.alpha6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -4
  3. data/docs/AdminApi.md +48 -0
  4. data/docs/CommonApi.md +48 -0
  5. data/docs/Form.md +3 -3
  6. data/docs/FormField.md +4 -4
  7. data/docs/Identity.md +4 -2
  8. data/docs/LoginRequest.md +5 -5
  9. data/docs/LoginRequestMethod.md +2 -2
  10. data/docs/LoginRequestMethodConfig.md +10 -1
  11. data/docs/ProfileManagementRequest.md +7 -7
  12. data/docs/PublicApi.md +189 -0
  13. data/docs/RegistrationRequest.md +6 -6
  14. data/docs/RegistrationRequestMethodConfig.md +10 -1
  15. data/docs/Session.md +5 -5
  16. data/docs/VerifiableAddress.md +27 -0
  17. data/docs/VerificationRequest.md +29 -0
  18. data/lib/ory-kratos-client.rb +3 -1
  19. data/lib/ory-kratos-client/api/admin_api.rb +64 -1
  20. data/lib/ory-kratos-client/api/common_api.rb +64 -1
  21. data/lib/ory-kratos-client/api/health_api.rb +1 -1
  22. data/lib/ory-kratos-client/api/public_api.rb +251 -1
  23. data/lib/ory-kratos-client/api/version_api.rb +1 -1
  24. data/lib/ory-kratos-client/api_client.rb +1 -1
  25. data/lib/ory-kratos-client/api_error.rb +1 -1
  26. data/lib/ory-kratos-client/configuration.rb +1 -1
  27. data/lib/ory-kratos-client/models/complete_self_service_browser_profile_management_flow_payload.rb +1 -1
  28. data/lib/ory-kratos-client/models/error.rb +1 -1
  29. data/lib/ory-kratos-client/models/error_container.rb +1 -1
  30. data/lib/ory-kratos-client/models/form.rb +16 -1
  31. data/lib/ory-kratos-client/models/form_field.rb +17 -2
  32. data/lib/ory-kratos-client/models/generic_error.rb +1 -1
  33. data/lib/ory-kratos-client/models/generic_error_payload.rb +1 -1
  34. data/lib/ory-kratos-client/models/health_not_ready_status.rb +1 -1
  35. data/lib/ory-kratos-client/models/health_status.rb +1 -1
  36. data/lib/ory-kratos-client/models/identity.rb +18 -2
  37. data/lib/ory-kratos-client/models/login_request.rb +26 -1
  38. data/lib/ory-kratos-client/models/login_request_method.rb +11 -1
  39. data/lib/ory-kratos-client/models/login_request_method_config.rb +74 -3
  40. data/lib/ory-kratos-client/models/profile_management_request.rb +36 -1
  41. data/lib/ory-kratos-client/models/registration_request.rb +31 -1
  42. data/lib/ory-kratos-client/models/registration_request_method.rb +1 -1
  43. data/lib/ory-kratos-client/models/registration_request_method_config.rb +74 -3
  44. data/lib/ory-kratos-client/models/session.rb +26 -1
  45. data/lib/ory-kratos-client/models/verifiable_address.rb +281 -0
  46. data/lib/ory-kratos-client/models/verification_request.rb +265 -0
  47. data/lib/ory-kratos-client/models/version.rb +1 -1
  48. data/lib/ory-kratos-client/version.rb +2 -2
  49. data/ory-kratos-client.gemspec +1 -1
  50. data/spec/models/verifiable_address_spec.rb +71 -0
  51. data/spec/models/verification_request_spec.rb +77 -0
  52. metadata +28 -20
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: latest
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.2
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
@@ -113,12 +113,47 @@ module OryHydraClient
113
113
  # @return Array for valid properties with the reasons
114
114
  def list_invalid_properties
115
115
  invalid_properties = Array.new
116
+ if @expires_at.nil?
117
+ invalid_properties.push('invalid value for "expires_at", expires_at cannot be nil.')
118
+ end
119
+
120
+ if @form.nil?
121
+ invalid_properties.push('invalid value for "form", form cannot be nil.')
122
+ end
123
+
124
+ if @id.nil?
125
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
126
+ end
127
+
128
+ if @identity.nil?
129
+ invalid_properties.push('invalid value for "identity", identity cannot be nil.')
130
+ end
131
+
132
+ if @issued_at.nil?
133
+ invalid_properties.push('invalid value for "issued_at", issued_at cannot be nil.')
134
+ end
135
+
136
+ if @request_url.nil?
137
+ invalid_properties.push('invalid value for "request_url", request_url cannot be nil.')
138
+ end
139
+
140
+ if @update_successful.nil?
141
+ invalid_properties.push('invalid value for "update_successful", update_successful cannot be nil.')
142
+ end
143
+
116
144
  invalid_properties
117
145
  end
118
146
 
119
147
  # Check to see if the all the properties in the model are valid
120
148
  # @return true if the model is valid
121
149
  def valid?
150
+ return false if @expires_at.nil?
151
+ return false if @form.nil?
152
+ return false if @id.nil?
153
+ return false if @identity.nil?
154
+ return false if @issued_at.nil?
155
+ return false if @request_url.nil?
156
+ return false if @update_successful.nil?
122
157
  true
123
158
  end
124
159
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: latest
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.2
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
@@ -107,12 +107,42 @@ module OryHydraClient
107
107
  # @return Array for valid properties with the reasons
108
108
  def list_invalid_properties
109
109
  invalid_properties = Array.new
110
+ if @active.nil?
111
+ invalid_properties.push('invalid value for "active", active cannot be nil.')
112
+ end
113
+
114
+ if @expires_at.nil?
115
+ invalid_properties.push('invalid value for "expires_at", expires_at cannot be nil.')
116
+ end
117
+
118
+ if @id.nil?
119
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
120
+ end
121
+
122
+ if @issued_at.nil?
123
+ invalid_properties.push('invalid value for "issued_at", issued_at cannot be nil.')
124
+ end
125
+
126
+ if @methods.nil?
127
+ invalid_properties.push('invalid value for "methods", methods cannot be nil.')
128
+ end
129
+
130
+ if @request_url.nil?
131
+ invalid_properties.push('invalid value for "request_url", request_url cannot be nil.')
132
+ end
133
+
110
134
  invalid_properties
111
135
  end
112
136
 
113
137
  # Check to see if the all the properties in the model are valid
114
138
  # @return true if the model is valid
115
139
  def valid?
140
+ return false if @active.nil?
141
+ return false if @expires_at.nil?
142
+ return false if @id.nil?
143
+ return false if @issued_at.nil?
144
+ return false if @methods.nil?
145
+ return false if @request_url.nil?
116
146
  true
117
147
  end
118
148
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: latest
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.2
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: latest
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.2
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
@@ -14,15 +14,40 @@ require 'date'
14
14
 
15
15
  module OryHydraClient
16
16
  class RegistrationRequestMethodConfig
17
+ # Action should be used as the form action URL (<form action=\"{{ .Action }}\" method=\"post\">).
18
+ attr_accessor :action
19
+
20
+ # Errors contains all form errors. These will be duplicates of the individual field errors.
21
+ attr_accessor :errors
22
+
23
+ # Fields contains multiple fields
24
+ attr_accessor :fields
25
+
26
+ # Method is the form method (e.g. POST)
27
+ attr_accessor :method
28
+
29
+ # Providers is set for the \"oidc\" request method.
30
+ attr_accessor :providers
31
+
17
32
  # Attribute mapping from ruby-style variable name to JSON key.
18
33
  def self.attribute_map
19
34
  {
35
+ :'action' => :'action',
36
+ :'errors' => :'errors',
37
+ :'fields' => :'fields',
38
+ :'method' => :'method',
39
+ :'providers' => :'providers'
20
40
  }
21
41
  end
22
42
 
23
43
  # Attribute type mapping.
24
44
  def self.openapi_types
25
45
  {
46
+ :'action' => :'String',
47
+ :'errors' => :'Array<Error>',
48
+ :'fields' => :'Array<FormField>',
49
+ :'method' => :'String',
50
+ :'providers' => :'Array<FormField>'
26
51
  }
27
52
  end
28
53
 
@@ -46,18 +71,59 @@ module OryHydraClient
46
71
  end
47
72
  h[k.to_sym] = v
48
73
  }
74
+
75
+ if attributes.key?(:'action')
76
+ self.action = attributes[:'action']
77
+ end
78
+
79
+ if attributes.key?(:'errors')
80
+ if (value = attributes[:'errors']).is_a?(Array)
81
+ self.errors = value
82
+ end
83
+ end
84
+
85
+ if attributes.key?(:'fields')
86
+ if (value = attributes[:'fields']).is_a?(Array)
87
+ self.fields = value
88
+ end
89
+ end
90
+
91
+ if attributes.key?(:'method')
92
+ self.method = attributes[:'method']
93
+ end
94
+
95
+ if attributes.key?(:'providers')
96
+ if (value = attributes[:'providers']).is_a?(Array)
97
+ self.providers = value
98
+ end
99
+ end
49
100
  end
50
101
 
51
102
  # Show invalid properties with the reasons. Usually used together with valid?
52
103
  # @return Array for valid properties with the reasons
53
104
  def list_invalid_properties
54
105
  invalid_properties = Array.new
106
+ if @action.nil?
107
+ invalid_properties.push('invalid value for "action", action cannot be nil.')
108
+ end
109
+
110
+ if @fields.nil?
111
+ invalid_properties.push('invalid value for "fields", fields cannot be nil.')
112
+ end
113
+
114
+ if @method.nil?
115
+ invalid_properties.push('invalid value for "method", method cannot be nil.')
116
+ end
117
+
55
118
  invalid_properties
56
119
  end
57
120
 
58
121
  # Check to see if the all the properties in the model are valid
59
122
  # @return true if the model is valid
60
123
  def valid?
124
+ return false if @action.nil?
125
+ return false if @fields.nil?
126
+ return false if @method.nil?
61
127
  true
62
128
  end
63
129
 
@@ -65,7 +131,12 @@ module OryHydraClient
65
131
  # @param [Object] Object to be compared
66
132
  def ==(o)
67
133
  return true if self.equal?(o)
68
- self.class == o.class
134
+ self.class == o.class &&
135
+ action == o.action &&
136
+ errors == o.errors &&
137
+ fields == o.fields &&
138
+ method == o.method &&
139
+ providers == o.providers
69
140
  end
70
141
 
71
142
  # @see the `==` method
@@ -77,7 +148,7 @@ module OryHydraClient
77
148
  # Calculates hash code according to all attributes.
78
149
  # @return [Integer] Hash code
79
150
  def hash
80
- [].hash
151
+ [action, errors, fields, method, providers].hash
81
152
  end
82
153
 
83
154
  # Builds the object from hash
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: latest
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.2
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
@@ -92,12 +92,37 @@ module OryHydraClient
92
92
  # @return Array for valid properties with the reasons
93
93
  def list_invalid_properties
94
94
  invalid_properties = Array.new
95
+ if @authenticated_at.nil?
96
+ invalid_properties.push('invalid value for "authenticated_at", authenticated_at cannot be nil.')
97
+ end
98
+
99
+ if @expires_at.nil?
100
+ invalid_properties.push('invalid value for "expires_at", expires_at cannot be nil.')
101
+ end
102
+
103
+ if @identity.nil?
104
+ invalid_properties.push('invalid value for "identity", identity cannot be nil.')
105
+ end
106
+
107
+ if @issued_at.nil?
108
+ invalid_properties.push('invalid value for "issued_at", issued_at cannot be nil.')
109
+ end
110
+
111
+ if @sid.nil?
112
+ invalid_properties.push('invalid value for "sid", sid cannot be nil.')
113
+ end
114
+
95
115
  invalid_properties
96
116
  end
97
117
 
98
118
  # Check to see if the all the properties in the model are valid
99
119
  # @return true if the model is valid
100
120
  def valid?
121
+ return false if @authenticated_at.nil?
122
+ return false if @expires_at.nil?
123
+ return false if @identity.nil?
124
+ return false if @issued_at.nil?
125
+ return false if @sid.nil?
101
126
  true
102
127
  end
103
128
 
@@ -0,0 +1,281 @@
1
+ =begin
2
+ #Ory Kratos
3
+
4
+ #Welcome to the ORY Kratos HTTP API documentation!
5
+
6
+ The version of the OpenAPI document: latest
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module OryHydraClient
16
+ class VerifiableAddress
17
+ attr_accessor :expires_at
18
+
19
+ attr_accessor :id
20
+
21
+ attr_accessor :value
22
+
23
+ attr_accessor :verified
24
+
25
+ attr_accessor :verified_at
26
+
27
+ attr_accessor :via
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'expires_at' => :'expires_at',
33
+ :'id' => :'id',
34
+ :'value' => :'value',
35
+ :'verified' => :'verified',
36
+ :'verified_at' => :'verified_at',
37
+ :'via' => :'via'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'expires_at' => :'DateTime',
45
+ :'id' => :'String',
46
+ :'value' => :'String',
47
+ :'verified' => :'Boolean',
48
+ :'verified_at' => :'DateTime',
49
+ :'via' => :'String'
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new([
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::VerifiableAddress` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!self.class.attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::VerifiableAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'expires_at')
75
+ self.expires_at = attributes[:'expires_at']
76
+ end
77
+
78
+ if attributes.key?(:'id')
79
+ self.id = attributes[:'id']
80
+ end
81
+
82
+ if attributes.key?(:'value')
83
+ self.value = attributes[:'value']
84
+ end
85
+
86
+ if attributes.key?(:'verified')
87
+ self.verified = attributes[:'verified']
88
+ end
89
+
90
+ if attributes.key?(:'verified_at')
91
+ self.verified_at = attributes[:'verified_at']
92
+ end
93
+
94
+ if attributes.key?(:'via')
95
+ self.via = attributes[:'via']
96
+ end
97
+ end
98
+
99
+ # Show invalid properties with the reasons. Usually used together with valid?
100
+ # @return Array for valid properties with the reasons
101
+ def list_invalid_properties
102
+ invalid_properties = Array.new
103
+ if @expires_at.nil?
104
+ invalid_properties.push('invalid value for "expires_at", expires_at cannot be nil.')
105
+ end
106
+
107
+ if @id.nil?
108
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
109
+ end
110
+
111
+ if @value.nil?
112
+ invalid_properties.push('invalid value for "value", value cannot be nil.')
113
+ end
114
+
115
+ if @verified.nil?
116
+ invalid_properties.push('invalid value for "verified", verified cannot be nil.')
117
+ end
118
+
119
+ if @verified_at.nil?
120
+ invalid_properties.push('invalid value for "verified_at", verified_at cannot be nil.')
121
+ end
122
+
123
+ if @via.nil?
124
+ invalid_properties.push('invalid value for "via", via cannot be nil.')
125
+ end
126
+
127
+ invalid_properties
128
+ end
129
+
130
+ # Check to see if the all the properties in the model are valid
131
+ # @return true if the model is valid
132
+ def valid?
133
+ return false if @expires_at.nil?
134
+ return false if @id.nil?
135
+ return false if @value.nil?
136
+ return false if @verified.nil?
137
+ return false if @verified_at.nil?
138
+ return false if @via.nil?
139
+ true
140
+ end
141
+
142
+ # Checks equality by comparing each attribute.
143
+ # @param [Object] Object to be compared
144
+ def ==(o)
145
+ return true if self.equal?(o)
146
+ self.class == o.class &&
147
+ expires_at == o.expires_at &&
148
+ id == o.id &&
149
+ value == o.value &&
150
+ verified == o.verified &&
151
+ verified_at == o.verified_at &&
152
+ via == o.via
153
+ end
154
+
155
+ # @see the `==` method
156
+ # @param [Object] Object to be compared
157
+ def eql?(o)
158
+ self == o
159
+ end
160
+
161
+ # Calculates hash code according to all attributes.
162
+ # @return [Integer] Hash code
163
+ def hash
164
+ [expires_at, id, value, verified, verified_at, via].hash
165
+ end
166
+
167
+ # Builds the object from hash
168
+ # @param [Hash] attributes Model attributes in the form of hash
169
+ # @return [Object] Returns the model itself
170
+ def self.build_from_hash(attributes)
171
+ new.build_from_hash(attributes)
172
+ end
173
+
174
+ # Builds the object from hash
175
+ # @param [Hash] attributes Model attributes in the form of hash
176
+ # @return [Object] Returns the model itself
177
+ def build_from_hash(attributes)
178
+ return nil unless attributes.is_a?(Hash)
179
+ self.class.openapi_types.each_pair do |key, type|
180
+ if type =~ /\AArray<(.*)>/i
181
+ # check to ensure the input is an array given that the attribute
182
+ # is documented as an array but the input is not
183
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
184
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
185
+ end
186
+ elsif !attributes[self.class.attribute_map[key]].nil?
187
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
188
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
189
+ end
190
+
191
+ self
192
+ end
193
+
194
+ # Deserializes the data based on type
195
+ # @param string type Data type
196
+ # @param string value Value to be deserialized
197
+ # @return [Object] Deserialized data
198
+ def _deserialize(type, value)
199
+ case type.to_sym
200
+ when :DateTime
201
+ DateTime.parse(value)
202
+ when :Date
203
+ Date.parse(value)
204
+ when :String
205
+ value.to_s
206
+ when :Integer
207
+ value.to_i
208
+ when :Float
209
+ value.to_f
210
+ when :Boolean
211
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
212
+ true
213
+ else
214
+ false
215
+ end
216
+ when :Object
217
+ # generic object (usually a Hash), return directly
218
+ value
219
+ when /\AArray<(?<inner_type>.+)>\z/
220
+ inner_type = Regexp.last_match[:inner_type]
221
+ value.map { |v| _deserialize(inner_type, v) }
222
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
223
+ k_type = Regexp.last_match[:k_type]
224
+ v_type = Regexp.last_match[:v_type]
225
+ {}.tap do |hash|
226
+ value.each do |k, v|
227
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
228
+ end
229
+ end
230
+ else # model
231
+ OryHydraClient.const_get(type).build_from_hash(value)
232
+ end
233
+ end
234
+
235
+ # Returns the string representation of the object
236
+ # @return [String] String presentation of the object
237
+ def to_s
238
+ to_hash.to_s
239
+ end
240
+
241
+ # to_body is an alias to to_hash (backward compatibility)
242
+ # @return [Hash] Returns the object in the form of hash
243
+ def to_body
244
+ to_hash
245
+ end
246
+
247
+ # Returns the object in the form of hash
248
+ # @return [Hash] Returns the object in the form of hash
249
+ def to_hash
250
+ hash = {}
251
+ self.class.attribute_map.each_pair do |attr, param|
252
+ value = self.send(attr)
253
+ if value.nil?
254
+ is_nullable = self.class.openapi_nullable.include?(attr)
255
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
256
+ end
257
+
258
+ hash[param] = _to_hash(value)
259
+ end
260
+ hash
261
+ end
262
+
263
+ # Outputs non-array value in the form of hash
264
+ # For object, use to_hash. Otherwise, just return the value
265
+ # @param [Object] value Any valid value
266
+ # @return [Hash] Returns the value in the form of hash
267
+ def _to_hash(value)
268
+ if value.is_a?(Array)
269
+ value.compact.map { |v| _to_hash(v) }
270
+ elsif value.is_a?(Hash)
271
+ {}.tap do |hash|
272
+ value.each { |k, v| hash[k] = _to_hash(v) }
273
+ end
274
+ elsif value.respond_to? :to_hash
275
+ value.to_hash
276
+ else
277
+ value
278
+ end
279
+ end
280
+ end
281
+ end