ory-kratos-client 0.1.0.alpha6 → 0.4.6.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +31 -15
  4. data/docs/AdminApi.md +111 -16
  5. data/docs/CommonApi.md +111 -16
  6. data/docs/CompleteSelfServiceBrowserSettingsStrategyProfileFlowPayload.md +19 -0
  7. data/docs/Form.md +3 -3
  8. data/docs/FormField.md +8 -8
  9. data/docs/GenericErrorPayload.md +1 -1
  10. data/docs/Identity.md +9 -7
  11. data/docs/LoginRequest.md +4 -0
  12. data/docs/LoginRequestMethodConfig.md +3 -3
  13. data/docs/Message.md +23 -0
  14. data/docs/ProviderCredentialsConfig.md +19 -0
  15. data/docs/PublicApi.md +327 -50
  16. data/docs/RecoveryAddress.md +21 -0
  17. data/docs/RecoveryRequest.md +31 -0
  18. data/docs/RecoveryRequestMethod.md +19 -0
  19. data/docs/RegistrationRequest.md +3 -1
  20. data/docs/RegistrationRequestMethodConfig.md +3 -3
  21. data/docs/RequestMethodConfig.md +23 -0
  22. data/docs/SettingsRequest.md +33 -0
  23. data/docs/SettingsRequestMethod.md +19 -0
  24. data/docs/VerifiableAddress.md +1 -1
  25. data/docs/VerificationRequest.md +3 -1
  26. data/lib/ory-kratos-client.rb +11 -5
  27. data/lib/ory-kratos-client/api/admin_api.rb +150 -27
  28. data/lib/ory-kratos-client/api/common_api.rb +150 -27
  29. data/lib/ory-kratos-client/api/health_api.rb +2 -2
  30. data/lib/ory-kratos-client/api/public_api.rb +433 -71
  31. data/lib/ory-kratos-client/api/version_api.rb +2 -2
  32. data/lib/ory-kratos-client/api_client.rb +9 -7
  33. data/lib/ory-kratos-client/api_error.rb +2 -2
  34. data/lib/ory-kratos-client/configuration.rb +2 -2
  35. data/lib/ory-kratos-client/models/complete_self_service_browser_settings_strategy_profile_flow_payload.rb +222 -0
  36. data/lib/ory-kratos-client/models/error_container.rb +2 -2
  37. data/lib/ory-kratos-client/models/form.rb +15 -16
  38. data/lib/ory-kratos-client/models/form_field.rb +16 -22
  39. data/lib/ory-kratos-client/models/generic_error.rb +2 -2
  40. data/lib/ory-kratos-client/models/generic_error_payload.rb +4 -7
  41. data/lib/ory-kratos-client/models/health_not_ready_status.rb +2 -2
  42. data/lib/ory-kratos-client/models/health_status.rb +2 -2
  43. data/lib/ory-kratos-client/models/identity.rb +48 -35
  44. data/lib/ory-kratos-client/models/login_request.rb +24 -3
  45. data/lib/ory-kratos-client/models/login_request_method.rb +2 -2
  46. data/lib/ory-kratos-client/models/login_request_method_config.rb +15 -16
  47. data/lib/ory-kratos-client/models/message.rb +233 -0
  48. data/lib/ory-kratos-client/models/provider_credentials_config.rb +215 -0
  49. data/lib/ory-kratos-client/models/recovery_address.rb +239 -0
  50. data/lib/ory-kratos-client/models/recovery_request.rb +309 -0
  51. data/lib/ory-kratos-client/models/recovery_request_method.rb +216 -0
  52. data/lib/ory-kratos-client/models/registration_request.rb +14 -8
  53. data/lib/ory-kratos-client/models/registration_request_method.rb +2 -2
  54. data/lib/ory-kratos-client/models/registration_request_method_config.rb +15 -16
  55. data/lib/ory-kratos-client/models/request_method_config.rb +255 -0
  56. data/lib/ory-kratos-client/models/session.rb +2 -2
  57. data/lib/ory-kratos-client/models/settings_request.rb +323 -0
  58. data/lib/ory-kratos-client/models/settings_request_method.rb +216 -0
  59. data/lib/ory-kratos-client/models/verifiable_address.rb +2 -7
  60. data/lib/ory-kratos-client/models/verification_request.rb +15 -4
  61. data/lib/ory-kratos-client/models/version.rb +2 -2
  62. data/lib/ory-kratos-client/version.rb +3 -3
  63. data/ory-kratos-client.gemspec +2 -2
  64. data/spec/models/complete_self_service_browser_settings_strategy_profile_flow_payload_spec.rb +47 -0
  65. data/spec/models/message_spec.rb +59 -0
  66. data/spec/models/provider_credentials_config_spec.rb +47 -0
  67. data/spec/models/recovery_address_spec.rb +53 -0
  68. data/spec/models/recovery_request_method_spec.rb +47 -0
  69. data/spec/models/recovery_request_spec.rb +83 -0
  70. data/spec/models/request_method_config_spec.rb +59 -0
  71. data/spec/models/settings_request_method_spec.rb +47 -0
  72. data/spec/models/settings_request_spec.rb +83 -0
  73. metadata +55 -19
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Welcome to the ORY Kratos HTTP API documentation!
5
5
 
6
- The version of the OpenAPI document: latest
6
+ The version of the OpenAPI document: v0.4.6-alpha.1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Welcome to the ORY Kratos HTTP API documentation!
5
5
 
6
- The version of the OpenAPI document: latest
6
+ The version of the OpenAPI document: v0.4.6-alpha.1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -268,11 +268,13 @@ module OryHydraClient
268
268
  tempfile.write(chunk)
269
269
  end
270
270
  request.on_complete do |response|
271
- tempfile.close if tempfile
272
- @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
273
- "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
274
- "will be deleted automatically with GC. It's also recommended to delete the temp file "\
275
- "explicitly with `tempfile.delete`"
271
+ if tempfile
272
+ tempfile.close
273
+ @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
274
+ "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
275
+ "will be deleted automatically with GC. It's also recommended to delete the temp file "\
276
+ "explicitly with `tempfile.delete`"
277
+ end
276
278
  end
277
279
  end
278
280
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Welcome to the ORY Kratos HTTP API documentation!
5
5
 
6
- The version of the OpenAPI document: latest
6
+ The version of the OpenAPI document: v0.4.6-alpha.1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Welcome to the ORY Kratos HTTP API documentation!
5
5
 
6
- The version of the OpenAPI document: latest
6
+ The version of the OpenAPI document: v0.4.6-alpha.1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -0,0 +1,222 @@
1
+ =begin
2
+ #Ory Kratos
3
+
4
+ #Welcome to the ORY Kratos HTTP API documentation!
5
+
6
+ The version of the OpenAPI document: v0.4.6-alpha.1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module OryHydraClient
16
+ class CompleteSelfServiceBrowserSettingsStrategyProfileFlowPayload
17
+ # RequestID is request ID. in: query
18
+ attr_accessor :request_id
19
+
20
+ # Traits contains all of the identity's traits. type: string format: binary
21
+ attr_accessor :traits
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'request_id' => :'request_id',
27
+ :'traits' => :'traits'
28
+ }
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.openapi_types
33
+ {
34
+ :'request_id' => :'String',
35
+ :'traits' => :'Object'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::CompleteSelfServiceBrowserSettingsStrategyProfileFlowPayload` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::CompleteSelfServiceBrowserSettingsStrategyProfileFlowPayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'request_id')
61
+ self.request_id = attributes[:'request_id']
62
+ end
63
+
64
+ if attributes.key?(:'traits')
65
+ self.traits = attributes[:'traits']
66
+ end
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properties with the reasons
71
+ def list_invalid_properties
72
+ invalid_properties = Array.new
73
+ if @traits.nil?
74
+ invalid_properties.push('invalid value for "traits", traits cannot be nil.')
75
+ end
76
+
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ return false if @traits.nil?
84
+ true
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ request_id == o.request_id &&
93
+ traits == o.traits
94
+ end
95
+
96
+ # @see the `==` method
97
+ # @param [Object] Object to be compared
98
+ def eql?(o)
99
+ self == o
100
+ end
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Integer] Hash code
104
+ def hash
105
+ [request_id, traits].hash
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def self.build_from_hash(attributes)
112
+ new.build_from_hash(attributes)
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ self.class.openapi_types.each_pair do |key, type|
121
+ if type =~ /\AArray<(.*)>/i
122
+ # check to ensure the input is an array given that the attribute
123
+ # is documented as an array but the input is not
124
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
125
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
126
+ end
127
+ elsif !attributes[self.class.attribute_map[key]].nil?
128
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
129
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
130
+ end
131
+
132
+ self
133
+ end
134
+
135
+ # Deserializes the data based on type
136
+ # @param string type Data type
137
+ # @param string value Value to be deserialized
138
+ # @return [Object] Deserialized data
139
+ def _deserialize(type, value)
140
+ case type.to_sym
141
+ when :DateTime
142
+ DateTime.parse(value)
143
+ when :Date
144
+ Date.parse(value)
145
+ when :String
146
+ value.to_s
147
+ when :Integer
148
+ value.to_i
149
+ when :Float
150
+ value.to_f
151
+ when :Boolean
152
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
153
+ true
154
+ else
155
+ false
156
+ end
157
+ when :Object
158
+ # generic object (usually a Hash), return directly
159
+ value
160
+ when /\AArray<(?<inner_type>.+)>\z/
161
+ inner_type = Regexp.last_match[:inner_type]
162
+ value.map { |v| _deserialize(inner_type, v) }
163
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
164
+ k_type = Regexp.last_match[:k_type]
165
+ v_type = Regexp.last_match[:v_type]
166
+ {}.tap do |hash|
167
+ value.each do |k, v|
168
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
169
+ end
170
+ end
171
+ else # model
172
+ OryHydraClient.const_get(type).build_from_hash(value)
173
+ end
174
+ end
175
+
176
+ # Returns the string representation of the object
177
+ # @return [String] String presentation of the object
178
+ def to_s
179
+ to_hash.to_s
180
+ end
181
+
182
+ # to_body is an alias to to_hash (backward compatibility)
183
+ # @return [Hash] Returns the object in the form of hash
184
+ def to_body
185
+ to_hash
186
+ end
187
+
188
+ # Returns the object in the form of hash
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_hash
191
+ hash = {}
192
+ self.class.attribute_map.each_pair do |attr, param|
193
+ value = self.send(attr)
194
+ if value.nil?
195
+ is_nullable = self.class.openapi_nullable.include?(attr)
196
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
197
+ end
198
+
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ # Outputs non-array value in the form of hash
205
+ # For object, use to_hash. Otherwise, just return the value
206
+ # @param [Object] value Any valid value
207
+ # @return [Hash] Returns the value in the form of hash
208
+ def _to_hash(value)
209
+ if value.is_a?(Array)
210
+ value.compact.map { |v| _to_hash(v) }
211
+ elsif value.is_a?(Hash)
212
+ {}.tap do |hash|
213
+ value.each { |k, v| hash[k] = _to_hash(v) }
214
+ end
215
+ elsif value.respond_to? :to_hash
216
+ value.to_hash
217
+ else
218
+ value
219
+ end
220
+ end
221
+ end
222
+ end
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Welcome to the ORY Kratos HTTP API documentation!
5
5
 
6
- The version of the OpenAPI document: latest
6
+ The version of the OpenAPI document: v0.4.6-alpha.1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Welcome to the ORY Kratos HTTP API documentation!
5
5
 
6
- The version of the OpenAPI document: latest
6
+ The version of the OpenAPI document: v0.4.6-alpha.1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -15,15 +15,14 @@ require 'date'
15
15
  module OryHydraClient
16
16
  # HTMLForm represents a HTML Form. The container can work with both HTTP Form and JSON requests
17
17
  class Form
18
- # Action should be used as the form action URL (<form action=\"{{ .Action }}\" method=\"post\">).
18
+ # Action should be used as the form action URL `<form action=\"{{ .Action }}\" method=\"post\">`.
19
19
  attr_accessor :action
20
20
 
21
- # Errors contains all form errors. These will be duplicates of the individual field errors.
22
- attr_accessor :errors
23
-
24
21
  # Fields contains multiple fields
25
22
  attr_accessor :fields
26
23
 
24
+ attr_accessor :messages
25
+
27
26
  # Method is the form method (e.g. POST)
28
27
  attr_accessor :method
29
28
 
@@ -31,8 +30,8 @@ module OryHydraClient
31
30
  def self.attribute_map
32
31
  {
33
32
  :'action' => :'action',
34
- :'errors' => :'errors',
35
33
  :'fields' => :'fields',
34
+ :'messages' => :'messages',
36
35
  :'method' => :'method'
37
36
  }
38
37
  end
@@ -41,8 +40,8 @@ module OryHydraClient
41
40
  def self.openapi_types
42
41
  {
43
42
  :'action' => :'String',
44
- :'errors' => :'Array<Error>',
45
43
  :'fields' => :'Array<FormField>',
44
+ :'messages' => :'Array<Message>',
46
45
  :'method' => :'String'
47
46
  }
48
47
  end
@@ -72,18 +71,18 @@ module OryHydraClient
72
71
  self.action = attributes[:'action']
73
72
  end
74
73
 
75
- if attributes.key?(:'errors')
76
- if (value = attributes[:'errors']).is_a?(Array)
77
- self.errors = value
78
- end
79
- end
80
-
81
74
  if attributes.key?(:'fields')
82
75
  if (value = attributes[:'fields']).is_a?(Array)
83
76
  self.fields = value
84
77
  end
85
78
  end
86
79
 
80
+ if attributes.key?(:'messages')
81
+ if (value = attributes[:'messages']).is_a?(Array)
82
+ self.messages = value
83
+ end
84
+ end
85
+
87
86
  if attributes.key?(:'method')
88
87
  self.method = attributes[:'method']
89
88
  end
@@ -123,8 +122,8 @@ module OryHydraClient
123
122
  return true if self.equal?(o)
124
123
  self.class == o.class &&
125
124
  action == o.action &&
126
- errors == o.errors &&
127
125
  fields == o.fields &&
126
+ messages == o.messages &&
128
127
  method == o.method
129
128
  end
130
129
 
@@ -137,7 +136,7 @@ module OryHydraClient
137
136
  # Calculates hash code according to all attributes.
138
137
  # @return [Integer] Hash code
139
138
  def hash
140
- [action, errors, fields, method].hash
139
+ [action, fields, messages, method].hash
141
140
  end
142
141
 
143
142
  # Builds the object from hash
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Welcome to the ORY Kratos HTTP API documentation!
5
5
 
6
- The version of the OpenAPI document: latest
6
+ The version of the OpenAPI document: v0.4.6-alpha.1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -15,32 +15,31 @@ require 'date'
15
15
  module OryHydraClient
16
16
  # Field represents a HTML Form Field
17
17
  class FormField
18
- # Disabled is the equivalent of <input disabled=\"{{.Disabled}}\">
18
+ # Disabled is the equivalent of `<input {{if .Disabled}}disabled{{end}}\">`
19
19
  attr_accessor :disabled
20
20
 
21
- # Errors contains all validation errors this particular field has caused.
22
- attr_accessor :errors
21
+ attr_accessor :messages
23
22
 
24
- # Name is the equivalent of <input name=\"{{.Name}}\">
23
+ # Name is the equivalent of `<input name=\"{{.Name}}\">`
25
24
  attr_accessor :name
26
25
 
27
- # Pattern is the equivalent of <input pattern=\"{{.Pattern}}\">
26
+ # Pattern is the equivalent of `<input pattern=\"{{.Pattern}}\">`
28
27
  attr_accessor :pattern
29
28
 
30
- # Required is the equivalent of <input required=\"{{.Required}}\">
29
+ # Required is the equivalent of `<input required=\"{{.Required}}\">`
31
30
  attr_accessor :required
32
31
 
33
- # Type is the equivalent of <input type=\"{{.Type}}\">
32
+ # Type is the equivalent of `<input type=\"{{.Type}}\">`
34
33
  attr_accessor :type
35
34
 
36
- # Value is the equivalent of <input value=\"{{.Value}}\">
35
+ # Value is the equivalent of `<input value=\"{{.Value}}\">`
37
36
  attr_accessor :value
38
37
 
39
38
  # Attribute mapping from ruby-style variable name to JSON key.
40
39
  def self.attribute_map
41
40
  {
42
41
  :'disabled' => :'disabled',
43
- :'errors' => :'errors',
42
+ :'messages' => :'messages',
44
43
  :'name' => :'name',
45
44
  :'pattern' => :'pattern',
46
45
  :'required' => :'required',
@@ -53,7 +52,7 @@ module OryHydraClient
53
52
  def self.openapi_types
54
53
  {
55
54
  :'disabled' => :'Boolean',
56
- :'errors' => :'Array<Error>',
55
+ :'messages' => :'Array<Message>',
57
56
  :'name' => :'String',
58
57
  :'pattern' => :'String',
59
58
  :'required' => :'Boolean',
@@ -87,9 +86,9 @@ module OryHydraClient
87
86
  self.disabled = attributes[:'disabled']
88
87
  end
89
88
 
90
- if attributes.key?(:'errors')
91
- if (value = attributes[:'errors']).is_a?(Array)
92
- self.errors = value
89
+ if attributes.key?(:'messages')
90
+ if (value = attributes[:'messages']).is_a?(Array)
91
+ self.messages = value
93
92
  end
94
93
  end
95
94
 
@@ -122,10 +121,6 @@ module OryHydraClient
122
121
  invalid_properties.push('invalid value for "name", name cannot be nil.')
123
122
  end
124
123
 
125
- if @required.nil?
126
- invalid_properties.push('invalid value for "required", required cannot be nil.')
127
- end
128
-
129
124
  if @type.nil?
130
125
  invalid_properties.push('invalid value for "type", type cannot be nil.')
131
126
  end
@@ -137,7 +132,6 @@ module OryHydraClient
137
132
  # @return true if the model is valid
138
133
  def valid?
139
134
  return false if @name.nil?
140
- return false if @required.nil?
141
135
  return false if @type.nil?
142
136
  true
143
137
  end
@@ -148,7 +142,7 @@ module OryHydraClient
148
142
  return true if self.equal?(o)
149
143
  self.class == o.class &&
150
144
  disabled == o.disabled &&
151
- errors == o.errors &&
145
+ messages == o.messages &&
152
146
  name == o.name &&
153
147
  pattern == o.pattern &&
154
148
  required == o.required &&
@@ -165,7 +159,7 @@ module OryHydraClient
165
159
  # Calculates hash code according to all attributes.
166
160
  # @return [Integer] Hash code
167
161
  def hash
168
- [disabled, errors, name, pattern, required, type, value].hash
162
+ [disabled, messages, name, pattern, required, type, value].hash
169
163
  end
170
164
 
171
165
  # Builds the object from hash