ory-kratos-client 0.1.1.alpha1 → 0.2.0.alpha2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -12
  3. data/docs/AdminApi.md +68 -21
  4. data/docs/CommonApi.md +68 -21
  5. data/docs/CompleteSelfServiceBrowserSettingsStrategyProfileFlowPayload.md +19 -0
  6. data/docs/Form.md +1 -1
  7. data/docs/FormField.md +6 -6
  8. data/docs/GenericErrorPayload.md +1 -1
  9. data/docs/LoginRequest.md +2 -0
  10. data/docs/LoginRequestMethodConfig.md +1 -1
  11. data/docs/PublicApi.md +134 -44
  12. data/docs/RegistrationRequestMethodConfig.md +1 -1
  13. data/docs/RequestMethodConfig.md +23 -0
  14. data/docs/SettingsRequest.md +31 -0
  15. data/docs/SettingsRequestMethod.md +19 -0
  16. data/docs/VerifiableAddress.md +1 -1
  17. data/docs/VerificationRequest.md +1 -1
  18. data/lib/ory-kratos-client.rb +4 -2
  19. data/lib/ory-kratos-client/api/admin_api.rb +95 -35
  20. data/lib/ory-kratos-client/api/common_api.rb +95 -35
  21. data/lib/ory-kratos-client/api/public_api.rb +181 -65
  22. data/lib/ory-kratos-client/models/complete_self_service_browser_settings_strategy_profile_flow_payload.rb +222 -0
  23. data/lib/ory-kratos-client/models/form.rb +1 -1
  24. data/lib/ory-kratos-client/models/form_field.rb +6 -6
  25. data/lib/ory-kratos-client/models/generic_error_payload.rb +2 -3
  26. data/lib/ory-kratos-client/models/login_request.rb +11 -1
  27. data/lib/ory-kratos-client/models/login_request_method_config.rb +1 -1
  28. data/lib/ory-kratos-client/models/registration_request_method_config.rb +1 -1
  29. data/lib/ory-kratos-client/models/request_method_config.rb +256 -0
  30. data/lib/ory-kratos-client/models/settings_request.rb +313 -0
  31. data/lib/ory-kratos-client/models/settings_request_method.rb +216 -0
  32. data/lib/ory-kratos-client/models/verifiable_address.rb +0 -5
  33. data/lib/ory-kratos-client/models/verification_request.rb +1 -1
  34. data/lib/ory-kratos-client/version.rb +1 -1
  35. data/spec/models/complete_self_service_browser_settings_strategy_profile_flow_payload_spec.rb +47 -0
  36. data/spec/models/request_method_config_spec.rb +59 -0
  37. data/spec/models/settings_request_method_spec.rb +47 -0
  38. data/spec/models/settings_request_spec.rb +83 -0
  39. metadata +36 -20
@@ -19,37 +19,93 @@ module OryHydraClient
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
- # Complete the browser-based profile management flows
23
- # This endpoint completes a browser-based profile management flow. This is usually achieved by POSTing data to this endpoint. If the provided profile data is valid against the Identity's Traits JSON Schema, the data will be updated and the browser redirected to `url.profile_ui` for further steps. > This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...) and HTML Forms. More information can be found at [ORY Kratos Profile Management Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-profile-management).
22
+ # Complete the browser-based settings flow for the password strategy
23
+ # This endpoint completes a browser-based settings flow. This is usually achieved by POSTing data to this endpoint. > This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...) and HTML Forms. More information can be found at [ORY Kratos User Settings & Profile Management Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-settings-profile-management).
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [nil]
26
+ def complete_self_service_browser_settings_password_strategy_flow(opts = {})
27
+ complete_self_service_browser_settings_password_strategy_flow_with_http_info(opts)
28
+ nil
29
+ end
30
+
31
+ # Complete the browser-based settings flow for the password strategy
32
+ # This endpoint completes a browser-based settings flow. This is usually achieved by POSTing data to this endpoint. > This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...) and HTML Forms. More information can be found at [ORY Kratos User Settings & Profile Management Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-settings-profile-management).
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
35
+ def complete_self_service_browser_settings_password_strategy_flow_with_http_info(opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: PublicApi.complete_self_service_browser_settings_password_strategy_flow ...'
38
+ end
39
+ # resource path
40
+ local_var_path = '/self-service/browser/flows/settings/strategies/password'
41
+
42
+ # query parameters
43
+ query_params = opts[:query_params] || {}
44
+
45
+ # header parameters
46
+ header_params = opts[:header_params] || {}
47
+ # HTTP header 'Accept' (if needed)
48
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
49
+
50
+ # form parameters
51
+ form_params = opts[:form_params] || {}
52
+
53
+ # http body (model)
54
+ post_body = opts[:body]
55
+
56
+ # return_type
57
+ return_type = opts[:return_type]
58
+
59
+ # auth_names
60
+ auth_names = opts[:auth_names] || []
61
+
62
+ new_options = opts.merge(
63
+ :header_params => header_params,
64
+ :query_params => query_params,
65
+ :form_params => form_params,
66
+ :body => post_body,
67
+ :auth_names => auth_names,
68
+ :return_type => return_type
69
+ )
70
+
71
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
72
+ if @api_client.config.debugging
73
+ @api_client.config.logger.debug "API called: PublicApi#complete_self_service_browser_settings_password_strategy_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
74
+ end
75
+ return data, status_code, headers
76
+ end
77
+
78
+ # Complete the browser-based settings flow for profile data
79
+ # This endpoint completes a browser-based settings flow. This is usually achieved by POSTing data to this endpoint. If the provided profile data is valid against the Identity's Traits JSON Schema, the data will be updated and the browser redirected to `url.settings_ui` for further steps. > This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...) and HTML Forms. More information can be found at [ORY Kratos User Settings & Profile Management Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-settings-profile-management).
24
80
  # @param request [String] Request is the request ID.
25
- # @param body [CompleteSelfServiceBrowserProfileManagementFlowPayload]
81
+ # @param body [CompleteSelfServiceBrowserSettingsStrategyProfileFlowPayload]
26
82
  # @param [Hash] opts the optional parameters
27
83
  # @return [nil]
28
- def complete_self_service_browser_profile_management_flow(request, body, opts = {})
29
- complete_self_service_browser_profile_management_flow_with_http_info(request, body, opts)
84
+ def complete_self_service_browser_settings_profile_strategy_flow(request, body, opts = {})
85
+ complete_self_service_browser_settings_profile_strategy_flow_with_http_info(request, body, opts)
30
86
  nil
31
87
  end
32
88
 
33
- # Complete the browser-based profile management flows
34
- # This endpoint completes a browser-based profile management flow. This is usually achieved by POSTing data to this endpoint. If the provided profile data is valid against the Identity&#39;s Traits JSON Schema, the data will be updated and the browser redirected to &#x60;url.profile_ui&#x60; for further steps. &gt; This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...) and HTML Forms. More information can be found at [ORY Kratos Profile Management Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-profile-management).
89
+ # Complete the browser-based settings flow for profile data
90
+ # This endpoint completes a browser-based settings flow. This is usually achieved by POSTing data to this endpoint. If the provided profile data is valid against the Identity&#39;s Traits JSON Schema, the data will be updated and the browser redirected to &#x60;url.settings_ui&#x60; for further steps. &gt; This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...) and HTML Forms. More information can be found at [ORY Kratos User Settings &amp; Profile Management Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-settings-profile-management).
35
91
  # @param request [String] Request is the request ID.
36
- # @param body [CompleteSelfServiceBrowserProfileManagementFlowPayload]
92
+ # @param body [CompleteSelfServiceBrowserSettingsStrategyProfileFlowPayload]
37
93
  # @param [Hash] opts the optional parameters
38
94
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
39
- def complete_self_service_browser_profile_management_flow_with_http_info(request, body, opts = {})
95
+ def complete_self_service_browser_settings_profile_strategy_flow_with_http_info(request, body, opts = {})
40
96
  if @api_client.config.debugging
41
- @api_client.config.logger.debug 'Calling API: PublicApi.complete_self_service_browser_profile_management_flow ...'
97
+ @api_client.config.logger.debug 'Calling API: PublicApi.complete_self_service_browser_settings_profile_strategy_flow ...'
42
98
  end
43
99
  # verify the required parameter 'request' is set
44
100
  if @api_client.config.client_side_validation && request.nil?
45
- fail ArgumentError, "Missing the required parameter 'request' when calling PublicApi.complete_self_service_browser_profile_management_flow"
101
+ fail ArgumentError, "Missing the required parameter 'request' when calling PublicApi.complete_self_service_browser_settings_profile_strategy_flow"
46
102
  end
47
103
  # verify the required parameter 'body' is set
48
104
  if @api_client.config.client_side_validation && body.nil?
49
- fail ArgumentError, "Missing the required parameter 'body' when calling PublicApi.complete_self_service_browser_profile_management_flow"
105
+ fail ArgumentError, "Missing the required parameter 'body' when calling PublicApi.complete_self_service_browser_settings_profile_strategy_flow"
50
106
  end
51
107
  # resource path
52
- local_var_path = '/self-service/browser/flows/profile/update'
108
+ local_var_path = '/self-service/browser/flows/settings/strategies/profile'
53
109
 
54
110
  # query parameters
55
111
  query_params = opts[:query_params] || {}
@@ -85,13 +141,13 @@ module OryHydraClient
85
141
 
86
142
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
87
143
  if @api_client.config.debugging
88
- @api_client.config.logger.debug "API called: PublicApi#complete_self_service_browser_profile_management_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
144
+ @api_client.config.logger.debug "API called: PublicApi#complete_self_service_browser_settings_profile_strategy_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
89
145
  end
90
146
  return data, status_code, headers
91
147
  end
92
148
 
93
- # Complete the browser-based profile management flows
94
- # This endpoint completes a browser-based profile management flow. This is usually achieved by POSTing data to this endpoint. If the provided profile data is valid against the Identity's Traits JSON Schema, the data will be updated and the browser redirected to `url.profile_ui` for further steps. > This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...) and HTML Forms. More information can be found at [ORY Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).
149
+ # Complete the browser-based verification flows
150
+ # This endpoint completes a browser-based verification flow. This is usually achieved by POSTing data to this endpoint. If the provided data is valid against the Identity's Traits JSON Schema, the data will be updated and the browser redirected to `url.settings_ui` for further steps. > This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...) and HTML Forms. More information can be found at [ORY Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).
95
151
  # @param request [String] Request is the Request ID The value for this parameter comes from &#x60;request&#x60; URL Query parameter sent to your application (e.g. &#x60;/verify?request&#x3D;abcde&#x60;).
96
152
  # @param via [String] What to verify Currently only \&quot;email\&quot; is supported.
97
153
  # @param [Hash] opts the optional parameters
@@ -101,8 +157,8 @@ module OryHydraClient
101
157
  nil
102
158
  end
103
159
 
104
- # Complete the browser-based profile management flows
105
- # This endpoint completes a browser-based profile management flow. This is usually achieved by POSTing data to this endpoint. If the provided profile data is valid against the Identity&#39;s Traits JSON Schema, the data will be updated and the browser redirected to &#x60;url.profile_ui&#x60; for further steps. &gt; This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...) and HTML Forms. More information can be found at [ORY Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).
160
+ # Complete the browser-based verification flows
161
+ # This endpoint completes a browser-based verification flow. This is usually achieved by POSTing data to this endpoint. If the provided data is valid against the Identity&#39;s Traits JSON Schema, the data will be updated and the browser redirected to &#x60;url.settings_ui&#x60; for further steps. &gt; This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...) and HTML Forms. More information can be found at [ORY Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).
106
162
  # @param request [String] Request is the Request ID The value for this parameter comes from &#x60;request&#x60; URL Query parameter sent to your application (e.g. &#x60;/verify?request&#x3D;abcde&#x60;).
107
163
  # @param via [String] What to verify Currently only \&quot;email\&quot; is supported.
108
164
  # @param [Hash] opts the optional parameters
@@ -159,6 +215,66 @@ module OryHydraClient
159
215
  return data, status_code, headers
160
216
  end
161
217
 
218
+ # Get a traits schema definition
219
+ # @param id [String] ID must be set to the ID of schema you want to get
220
+ # @param [Hash] opts the optional parameters
221
+ # @return [Object]
222
+ def get_schema(id, opts = {})
223
+ data, _status_code, _headers = get_schema_with_http_info(id, opts)
224
+ data
225
+ end
226
+
227
+ # Get a traits schema definition
228
+ # @param id [String] ID must be set to the ID of schema you want to get
229
+ # @param [Hash] opts the optional parameters
230
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
231
+ def get_schema_with_http_info(id, opts = {})
232
+ if @api_client.config.debugging
233
+ @api_client.config.logger.debug 'Calling API: PublicApi.get_schema ...'
234
+ end
235
+ # verify the required parameter 'id' is set
236
+ if @api_client.config.client_side_validation && id.nil?
237
+ fail ArgumentError, "Missing the required parameter 'id' when calling PublicApi.get_schema"
238
+ end
239
+ # resource path
240
+ local_var_path = '/schemas/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
241
+
242
+ # query parameters
243
+ query_params = opts[:query_params] || {}
244
+
245
+ # header parameters
246
+ header_params = opts[:header_params] || {}
247
+ # HTTP header 'Accept' (if needed)
248
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
249
+
250
+ # form parameters
251
+ form_params = opts[:form_params] || {}
252
+
253
+ # http body (model)
254
+ post_body = opts[:body]
255
+
256
+ # return_type
257
+ return_type = opts[:return_type] || 'Object'
258
+
259
+ # auth_names
260
+ auth_names = opts[:auth_names] || []
261
+
262
+ new_options = opts.merge(
263
+ :header_params => header_params,
264
+ :query_params => query_params,
265
+ :form_params => form_params,
266
+ :body => post_body,
267
+ :auth_names => auth_names,
268
+ :return_type => return_type
269
+ )
270
+
271
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
272
+ if @api_client.config.debugging
273
+ @api_client.config.logger.debug "API called: PublicApi#get_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
274
+ end
275
+ return data, status_code, headers
276
+ end
277
+
162
278
  # Get the request context of browser-based login user flows
163
279
  # This endpoint returns a login request's context with, for example, error details and other information. When accessing this endpoint through ORY Kratos' Public API, ensure that cookies are set as they are required for CSRF to work. To prevent token scanning attacks, the public endpoint does not return 404 status codes to prevent scanning attacks. More information can be found at [ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
164
280
  # @param request [String] Request is the Login Request ID The value for this parameter comes from &#x60;request&#x60; URL Query parameter sent to your application (e.g. &#x60;/login?request&#x3D;abcde&#x60;).
@@ -222,31 +338,31 @@ module OryHydraClient
222
338
  return data, status_code, headers
223
339
  end
224
340
 
225
- # Get the request context of browser-based profile management flows
226
- # When accessing this endpoint through ORY Kratos' Public API, ensure that cookies are set as they are required for checking the auth session. To prevent scanning attacks, the public endpoint does not return 404 status codes but instead 403 or 500. More information can be found at [ORY Kratos Profile Management Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-profile-management).
227
- # @param request [String] Request is the Login Request ID The value for this parameter comes from &#x60;request&#x60; URL Query parameter sent to your application (e.g. &#x60;/login?request&#x3D;abcde&#x60;).
341
+ # Get the request context of browser-based registration user flows
342
+ # This endpoint returns a registration request's context with, for example, error details and other information. When accessing this endpoint through ORY Kratos' Public API, ensure that cookies are set as they are required for CSRF to work. To prevent token scanning attacks, the public endpoint does not return 404 status codes to prevent scanning attacks. More information can be found at [ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
343
+ # @param request [String] Request is the Registration Request ID The value for this parameter comes from &#x60;request&#x60; URL Query parameter sent to your application (e.g. &#x60;/registration?request&#x3D;abcde&#x60;).
228
344
  # @param [Hash] opts the optional parameters
229
- # @return [ProfileManagementRequest]
230
- def get_self_service_browser_profile_management_request(request, opts = {})
231
- data, _status_code, _headers = get_self_service_browser_profile_management_request_with_http_info(request, opts)
345
+ # @return [RegistrationRequest]
346
+ def get_self_service_browser_registration_request(request, opts = {})
347
+ data, _status_code, _headers = get_self_service_browser_registration_request_with_http_info(request, opts)
232
348
  data
233
349
  end
234
350
 
235
- # Get the request context of browser-based profile management flows
236
- # When accessing this endpoint through ORY Kratos&#39; Public API, ensure that cookies are set as they are required for checking the auth session. To prevent scanning attacks, the public endpoint does not return 404 status codes but instead 403 or 500. More information can be found at [ORY Kratos Profile Management Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-profile-management).
237
- # @param request [String] Request is the Login Request ID The value for this parameter comes from &#x60;request&#x60; URL Query parameter sent to your application (e.g. &#x60;/login?request&#x3D;abcde&#x60;).
351
+ # Get the request context of browser-based registration user flows
352
+ # This endpoint returns a registration request&#39;s context with, for example, error details and other information. When accessing this endpoint through ORY Kratos&#39; Public API, ensure that cookies are set as they are required for CSRF to work. To prevent token scanning attacks, the public endpoint does not return 404 status codes to prevent scanning attacks. More information can be found at [ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
353
+ # @param request [String] Request is the Registration Request ID The value for this parameter comes from &#x60;request&#x60; URL Query parameter sent to your application (e.g. &#x60;/registration?request&#x3D;abcde&#x60;).
238
354
  # @param [Hash] opts the optional parameters
239
- # @return [Array<(ProfileManagementRequest, Integer, Hash)>] ProfileManagementRequest data, response status code and response headers
240
- def get_self_service_browser_profile_management_request_with_http_info(request, opts = {})
355
+ # @return [Array<(RegistrationRequest, Integer, Hash)>] RegistrationRequest data, response status code and response headers
356
+ def get_self_service_browser_registration_request_with_http_info(request, opts = {})
241
357
  if @api_client.config.debugging
242
- @api_client.config.logger.debug 'Calling API: PublicApi.get_self_service_browser_profile_management_request ...'
358
+ @api_client.config.logger.debug 'Calling API: PublicApi.get_self_service_browser_registration_request ...'
243
359
  end
244
360
  # verify the required parameter 'request' is set
245
361
  if @api_client.config.client_side_validation && request.nil?
246
- fail ArgumentError, "Missing the required parameter 'request' when calling PublicApi.get_self_service_browser_profile_management_request"
362
+ fail ArgumentError, "Missing the required parameter 'request' when calling PublicApi.get_self_service_browser_registration_request"
247
363
  end
248
364
  # resource path
249
- local_var_path = '/self-service/browser/flows/requests/profile'
365
+ local_var_path = '/self-service/browser/flows/requests/registration'
250
366
 
251
367
  # query parameters
252
368
  query_params = opts[:query_params] || {}
@@ -264,7 +380,7 @@ module OryHydraClient
264
380
  post_body = opts[:body]
265
381
 
266
382
  # return_type
267
- return_type = opts[:return_type] || 'ProfileManagementRequest'
383
+ return_type = opts[:return_type] || 'RegistrationRequest'
268
384
 
269
385
  # auth_names
270
386
  auth_names = opts[:auth_names] || []
@@ -280,36 +396,36 @@ module OryHydraClient
280
396
 
281
397
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
282
398
  if @api_client.config.debugging
283
- @api_client.config.logger.debug "API called: PublicApi#get_self_service_browser_profile_management_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
399
+ @api_client.config.logger.debug "API called: PublicApi#get_self_service_browser_registration_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
284
400
  end
285
401
  return data, status_code, headers
286
402
  end
287
403
 
288
- # Get the request context of browser-based registration user flows
289
- # This endpoint returns a registration request's context with, for example, error details and other information. When accessing this endpoint through ORY Kratos' Public API, ensure that cookies are set as they are required for CSRF to work. To prevent token scanning attacks, the public endpoint does not return 404 status codes to prevent scanning attacks. More information can be found at [ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
290
- # @param request [String] Request is the Registration Request ID The value for this parameter comes from &#x60;request&#x60; URL Query parameter sent to your application (e.g. &#x60;/registration?request&#x3D;abcde&#x60;).
404
+ # Get the request context of browser-based settings flows
405
+ # When accessing this endpoint through ORY Kratos' Public API, ensure that cookies are set as they are required for checking the auth session. To prevent scanning attacks, the public endpoint does not return 404 status codes but instead 403 or 500. More information can be found at [ORY Kratos User Settings & Profile Management Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-settings-profile-management).
406
+ # @param request [String] Request is the Login Request ID The value for this parameter comes from &#x60;request&#x60; URL Query parameter sent to your application (e.g. &#x60;/login?request&#x3D;abcde&#x60;).
291
407
  # @param [Hash] opts the optional parameters
292
- # @return [RegistrationRequest]
293
- def get_self_service_browser_registration_request(request, opts = {})
294
- data, _status_code, _headers = get_self_service_browser_registration_request_with_http_info(request, opts)
408
+ # @return [SettingsRequest]
409
+ def get_self_service_browser_settings_request(request, opts = {})
410
+ data, _status_code, _headers = get_self_service_browser_settings_request_with_http_info(request, opts)
295
411
  data
296
412
  end
297
413
 
298
- # Get the request context of browser-based registration user flows
299
- # This endpoint returns a registration request&#39;s context with, for example, error details and other information. When accessing this endpoint through ORY Kratos&#39; Public API, ensure that cookies are set as they are required for CSRF to work. To prevent token scanning attacks, the public endpoint does not return 404 status codes to prevent scanning attacks. More information can be found at [ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
300
- # @param request [String] Request is the Registration Request ID The value for this parameter comes from &#x60;request&#x60; URL Query parameter sent to your application (e.g. &#x60;/registration?request&#x3D;abcde&#x60;).
414
+ # Get the request context of browser-based settings flows
415
+ # When accessing this endpoint through ORY Kratos&#39; Public API, ensure that cookies are set as they are required for checking the auth session. To prevent scanning attacks, the public endpoint does not return 404 status codes but instead 403 or 500. More information can be found at [ORY Kratos User Settings &amp; Profile Management Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-settings-profile-management).
416
+ # @param request [String] Request is the Login Request ID The value for this parameter comes from &#x60;request&#x60; URL Query parameter sent to your application (e.g. &#x60;/login?request&#x3D;abcde&#x60;).
301
417
  # @param [Hash] opts the optional parameters
302
- # @return [Array<(RegistrationRequest, Integer, Hash)>] RegistrationRequest data, response status code and response headers
303
- def get_self_service_browser_registration_request_with_http_info(request, opts = {})
418
+ # @return [Array<(SettingsRequest, Integer, Hash)>] SettingsRequest data, response status code and response headers
419
+ def get_self_service_browser_settings_request_with_http_info(request, opts = {})
304
420
  if @api_client.config.debugging
305
- @api_client.config.logger.debug 'Calling API: PublicApi.get_self_service_browser_registration_request ...'
421
+ @api_client.config.logger.debug 'Calling API: PublicApi.get_self_service_browser_settings_request ...'
306
422
  end
307
423
  # verify the required parameter 'request' is set
308
424
  if @api_client.config.client_side_validation && request.nil?
309
- fail ArgumentError, "Missing the required parameter 'request' when calling PublicApi.get_self_service_browser_registration_request"
425
+ fail ArgumentError, "Missing the required parameter 'request' when calling PublicApi.get_self_service_browser_settings_request"
310
426
  end
311
427
  # resource path
312
- local_var_path = '/self-service/browser/flows/requests/registration'
428
+ local_var_path = '/self-service/browser/flows/requests/settings'
313
429
 
314
430
  # query parameters
315
431
  query_params = opts[:query_params] || {}
@@ -327,7 +443,7 @@ module OryHydraClient
327
443
  post_body = opts[:body]
328
444
 
329
445
  # return_type
330
- return_type = opts[:return_type] || 'RegistrationRequest'
446
+ return_type = opts[:return_type] || 'SettingsRequest'
331
447
 
332
448
  # auth_names
333
449
  auth_names = opts[:auth_names] || []
@@ -343,7 +459,7 @@ module OryHydraClient
343
459
 
344
460
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
345
461
  if @api_client.config.debugging
346
- @api_client.config.logger.debug "API called: PublicApi#get_self_service_browser_registration_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
462
+ @api_client.config.logger.debug "API called: PublicApi#get_self_service_browser_settings_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
347
463
  end
348
464
  return data, status_code, headers
349
465
  end
@@ -351,7 +467,7 @@ module OryHydraClient
351
467
  # Get user-facing self-service errors
352
468
  # This endpoint returns the error associated with a user-facing self service errors. When accessing this endpoint through ORY Kratos' Public API, ensure that cookies are set as they are required for CSRF to work. To prevent token scanning attacks, the public endpoint does not return 404 status codes to prevent scanning attacks. More information can be found at [ORY Kratos User User Facing Error Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-facing-errors).
353
469
  # @param [Hash] opts the optional parameters
354
- # @option opts [String] :id
470
+ # @option opts [String] :error
355
471
  # @return [ErrorContainer]
356
472
  def get_self_service_error(opts = {})
357
473
  data, _status_code, _headers = get_self_service_error_with_http_info(opts)
@@ -361,7 +477,7 @@ module OryHydraClient
361
477
  # Get user-facing self-service errors
362
478
  # This endpoint returns the error associated with a user-facing self service errors. When accessing this endpoint through ORY Kratos&#39; Public API, ensure that cookies are set as they are required for CSRF to work. To prevent token scanning attacks, the public endpoint does not return 404 status codes to prevent scanning attacks. More information can be found at [ORY Kratos User User Facing Error Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-facing-errors).
363
479
  # @param [Hash] opts the optional parameters
364
- # @option opts [String] :id
480
+ # @option opts [String] :error
365
481
  # @return [Array<(ErrorContainer, Integer, Hash)>] ErrorContainer data, response status code and response headers
366
482
  def get_self_service_error_with_http_info(opts = {})
367
483
  if @api_client.config.debugging
@@ -372,7 +488,7 @@ module OryHydraClient
372
488
 
373
489
  # query parameters
374
490
  query_params = opts[:query_params] || {}
375
- query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
491
+ query_params[:'error'] = opts[:'error'] if !opts[:'error'].nil?
376
492
 
377
493
  # header parameters
378
494
  header_params = opts[:header_params] || {}
@@ -639,7 +755,7 @@ module OryHydraClient
639
755
  end
640
756
 
641
757
  # Initialize browser-based verification flow
642
- # This endpoint initializes a browser-based profile management flow. Once initialized, the browser will be redirected to `urls.profile_ui` with the request ID set as a query parameter. If no valid user session exists, a login flow will be initialized. > This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). More information can be found at [ORY Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).
758
+ # This endpoint initializes a browser-based verification flow. Once initialized, the browser will be redirected to `urls.settings_ui` with the request ID set as a query parameter. If no valid user session exists, a login flow will be initialized. > This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). More information can be found at [ORY Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).
643
759
  # @param via [String] What to verify Currently only \&quot;email\&quot; is supported.
644
760
  # @param [Hash] opts the optional parameters
645
761
  # @return [nil]
@@ -649,7 +765,7 @@ module OryHydraClient
649
765
  end
650
766
 
651
767
  # Initialize browser-based verification flow
652
- # This endpoint initializes a browser-based profile management flow. Once initialized, the browser will be redirected to &#x60;urls.profile_ui&#x60; with the request ID set as a query parameter. If no valid user session exists, a login flow will be initialized. &gt; This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). More information can be found at [ORY Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).
768
+ # This endpoint initializes a browser-based verification flow. Once initialized, the browser will be redirected to &#x60;urls.settings_ui&#x60; with the request ID set as a query parameter. If no valid user session exists, a login flow will be initialized. &gt; This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). More information can be found at [ORY Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).
653
769
  # @param via [String] What to verify Currently only \&quot;email\&quot; is supported.
654
770
  # @param [Hash] opts the optional parameters
655
771
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
@@ -700,25 +816,25 @@ module OryHydraClient
700
816
  return data, status_code, headers
701
817
  end
702
818
 
703
- # Initialize browser-based profile management flow
704
- # This endpoint initializes a browser-based profile management flow. Once initialized, the browser will be redirected to `urls.profile_ui` with the request ID set as a query parameter. If no valid user session exists, a login flow will be initialized. > This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). More information can be found at [ORY Kratos Profile Management Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-profile-management).
819
+ # Initialize browser-based settings flow
820
+ # This endpoint initializes a browser-based settings flow. Once initialized, the browser will be redirected to `urls.settings_ui` with the request ID set as a query parameter. If no valid user session exists, a login flow will be initialized. > This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). More information can be found at [ORY Kratos User Settings & Profile Management Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-settings-profile-management).
705
821
  # @param [Hash] opts the optional parameters
706
822
  # @return [nil]
707
- def initialize_self_service_profile_management_flow(opts = {})
708
- initialize_self_service_profile_management_flow_with_http_info(opts)
823
+ def initialize_self_service_settings_flow(opts = {})
824
+ initialize_self_service_settings_flow_with_http_info(opts)
709
825
  nil
710
826
  end
711
827
 
712
- # Initialize browser-based profile management flow
713
- # This endpoint initializes a browser-based profile management flow. Once initialized, the browser will be redirected to &#x60;urls.profile_ui&#x60; with the request ID set as a query parameter. If no valid user session exists, a login flow will be initialized. &gt; This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). More information can be found at [ORY Kratos Profile Management Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-profile-management).
828
+ # Initialize browser-based settings flow
829
+ # This endpoint initializes a browser-based settings flow. Once initialized, the browser will be redirected to &#x60;urls.settings_ui&#x60; with the request ID set as a query parameter. If no valid user session exists, a login flow will be initialized. &gt; This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). More information can be found at [ORY Kratos User Settings &amp; Profile Management Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-settings-profile-management).
714
830
  # @param [Hash] opts the optional parameters
715
831
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
716
- def initialize_self_service_profile_management_flow_with_http_info(opts = {})
832
+ def initialize_self_service_settings_flow_with_http_info(opts = {})
717
833
  if @api_client.config.debugging
718
- @api_client.config.logger.debug 'Calling API: PublicApi.initialize_self_service_profile_management_flow ...'
834
+ @api_client.config.logger.debug 'Calling API: PublicApi.initialize_self_service_settings_flow ...'
719
835
  end
720
836
  # resource path
721
- local_var_path = '/self-service/browser/flows/profile'
837
+ local_var_path = '/self-service/browser/flows/settings'
722
838
 
723
839
  # query parameters
724
840
  query_params = opts[:query_params] || {}
@@ -751,7 +867,7 @@ module OryHydraClient
751
867
 
752
868
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
753
869
  if @api_client.config.debugging
754
- @api_client.config.logger.debug "API called: PublicApi#initialize_self_service_profile_management_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
870
+ @api_client.config.logger.debug "API called: PublicApi#initialize_self_service_settings_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
755
871
  end
756
872
  return data, status_code, headers
757
873
  end
@@ -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: 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 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