ory-kratos-client 0.1.0.alpha5 → 0.3.0.alpha1

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