authress-sdk 2.0.33.0 → 2.0.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -5
  3. data/lib/{authress_sdk → authress-sdk}/api/access_records_api.rb +46 -46
  4. data/lib/{authress_sdk → authress-sdk}/api/accounts_api.rb +18 -18
  5. data/lib/authress-sdk/api/login_api.rb +46 -0
  6. data/lib/{authress_sdk → authress-sdk}/api/metadata_api.rb +13 -13
  7. data/lib/{authress_sdk → authress-sdk}/api/resource_permissions_api.rb +20 -20
  8. data/lib/{authress_sdk → authress-sdk}/api/roles_api.rb +21 -21
  9. data/lib/{authress_sdk → authress-sdk}/api/service_clients_api.rb +36 -36
  10. data/lib/{authress_sdk → authress-sdk}/api/user_permissions_api.rb +30 -30
  11. data/lib/{authress_sdk → authress-sdk}/authress_client.rb +2 -1
  12. data/lib/{authress_sdk.rb → authress-sdk.rb} +2 -3
  13. metadata +76 -75
  14. /data/lib/{authress_sdk → authress-sdk}/api_error.rb +0 -0
  15. /data/lib/{authress_sdk → authress-sdk}/constant_token_provider.rb +0 -0
  16. /data/lib/{authress_sdk → authress-sdk}/models/access_record.rb +0 -0
  17. /data/lib/{authress_sdk → authress-sdk}/models/access_record_collection.rb +0 -0
  18. /data/lib/{authress_sdk → authress-sdk}/models/account.rb +0 -0
  19. /data/lib/{authress_sdk → authress-sdk}/models/account_collection.rb +0 -0
  20. /data/lib/{authress_sdk → authress-sdk}/models/account_collection_accounts.rb +0 -0
  21. /data/lib/{authress_sdk → authress-sdk}/models/claim_request.rb +0 -0
  22. /data/lib/{authress_sdk → authress-sdk}/models/claim_response.rb +0 -0
  23. /data/lib/{authress_sdk → authress-sdk}/models/client.rb +0 -0
  24. /data/lib/{authress_sdk → authress-sdk}/models/client_access_key.rb +0 -0
  25. /data/lib/{authress_sdk → authress-sdk}/models/client_collection.rb +0 -0
  26. /data/lib/{authress_sdk → authress-sdk}/models/client_collection_clients.rb +0 -0
  27. /data/lib/{authress_sdk → authress-sdk}/models/identity.rb +0 -0
  28. /data/lib/{authress_sdk → authress-sdk}/models/identity_collection.rb +0 -0
  29. /data/lib/{authress_sdk → authress-sdk}/models/identity_collection_identities.rb +0 -0
  30. /data/lib/{authress_sdk → authress-sdk}/models/identity_request.rb +0 -0
  31. /data/lib/{authress_sdk → authress-sdk}/models/inline_response_200.rb +0 -0
  32. /data/lib/{authress_sdk → authress-sdk}/models/inline_response_200_1.rb +0 -0
  33. /data/lib/{authress_sdk → authress-sdk}/models/inline_response_200_10.rb +0 -0
  34. /data/lib/{authress_sdk → authress-sdk}/models/inline_response_200_11.rb +0 -0
  35. /data/lib/{authress_sdk → authress-sdk}/models/inline_response_200_12.rb +0 -0
  36. /data/lib/{authress_sdk → authress-sdk}/models/inline_response_200_13.rb +0 -0
  37. /data/lib/{authress_sdk → authress-sdk}/models/inline_response_200_14.rb +0 -0
  38. /data/lib/{authress_sdk → authress-sdk}/models/inline_response_200_15.rb +0 -0
  39. /data/lib/{authress_sdk → authress-sdk}/models/inline_response_200_2.rb +0 -0
  40. /data/lib/{authress_sdk → authress-sdk}/models/inline_response_200_3.rb +0 -0
  41. /data/lib/{authress_sdk → authress-sdk}/models/inline_response_200_4.rb +0 -0
  42. /data/lib/{authress_sdk → authress-sdk}/models/inline_response_200_5.rb +0 -0
  43. /data/lib/{authress_sdk → authress-sdk}/models/inline_response_200_6.rb +0 -0
  44. /data/lib/{authress_sdk → authress-sdk}/models/inline_response_200_7.rb +0 -0
  45. /data/lib/{authress_sdk → authress-sdk}/models/inline_response_200_9.rb +0 -0
  46. /data/lib/{authress_sdk → authress-sdk}/models/invite.rb +0 -0
  47. /data/lib/{authress_sdk → authress-sdk}/models/link.rb +0 -0
  48. /data/lib/{authress_sdk → authress-sdk}/models/metadata_object.rb +0 -0
  49. /data/lib/{authress_sdk → authress-sdk}/models/permission_object.rb +0 -0
  50. /data/lib/{authress_sdk → authress-sdk}/models/permission_response.rb +0 -0
  51. /data/lib/{authress_sdk → authress-sdk}/models/resource_permission.rb +0 -0
  52. /data/lib/{authress_sdk → authress-sdk}/models/resource_permission_collection.rb +0 -0
  53. /data/lib/{authress_sdk → authress-sdk}/models/resource_permission_collection_links.rb +0 -0
  54. /data/lib/{authress_sdk → authress-sdk}/models/resource_permission_collection_links_next.rb +0 -0
  55. /data/lib/{authress_sdk → authress-sdk}/models/resource_permission_collection_resources.rb +0 -0
  56. /data/lib/{authress_sdk → authress-sdk}/models/resource_users_collection.rb +0 -0
  57. /data/lib/{authress_sdk → authress-sdk}/models/role.rb +0 -0
  58. /data/lib/{authress_sdk → authress-sdk}/models/statement.rb +0 -0
  59. /data/lib/{authress_sdk → authress-sdk}/models/token_request.rb +0 -0
  60. /data/lib/{authress_sdk → authress-sdk}/models/user.rb +0 -0
  61. /data/lib/{authress_sdk → authress-sdk}/models/user_resources.rb +0 -0
  62. /data/lib/{authress_sdk → authress-sdk}/models/user_resources_resources.rb +0 -0
  63. /data/lib/{authress_sdk → authress-sdk}/models/user_token.rb +0 -0
  64. /data/lib/{authress_sdk → authress-sdk}/models/user_token_links.rb +0 -0
  65. /data/lib/{authress_sdk → authress-sdk}/models/user_token_links_self.rb +0 -0
  66. /data/lib/{authress_sdk → authress-sdk}/models/v1clients_options.rb +0 -0
  67. /data/lib/{authress_sdk → authress-sdk}/models/v1records_account.rb +0 -0
  68. /data/lib/{authress_sdk → authress-sdk}/models/v1records_links.rb +0 -0
  69. /data/lib/{authress_sdk → authress-sdk}/models/v1records_links_self.rb +0 -0
  70. /data/lib/{authress_sdk → authress-sdk}/models/v1records_users.rb +0 -0
  71. /data/lib/{authress_sdk → authress-sdk}/models/v1resourcesresource_uri_permissions.rb +0 -0
  72. /data/lib/{authress_sdk → authress-sdk}/models/v1roles_permissions.rb +0 -0
  73. /data/lib/{authress_sdk → authress-sdk}/models/v1usersuser_idresourcesresource_urimetadata_account.rb +0 -0
  74. /data/lib/{authress_sdk → authress-sdk}/models/v1usersuser_idtokens_resources.rb +0 -0
  75. /data/lib/{authress_sdk → authress-sdk}/models/v1usersuser_idtokens_statements.rb +0 -0
  76. /data/lib/{authress_sdk → authress-sdk}/service_client_token_provider.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54a7c5b1c862527c4f575eebbbd6f206505e8bb9613f559a9579b2b675a55648
4
- data.tar.gz: 2f254791e61df0a4fc5699162482a41c5782b0b5ba051ea21da68b3ae03886e0
3
+ metadata.gz: 4ecbbf5559452b95fdcacf5f3c731c3ac910706d68563784c8dbdf9031655cd2
4
+ data.tar.gz: ff8fdd1c2864931948ea39a2216993bac75fbf2bdd10864c0a684d2f3c7a9640
5
5
  SHA512:
6
- metadata.gz: e52c38dee2420efb4b24c3f4cf0db10aded33a74d03ca5f389f77841806ae6c647381837c4b015dc79c9d8531218311396188c8a2febbe384c163f46a31a2bb0
7
- data.tar.gz: 3482c439bbdefb9ba74a73cdf3ce8768391ad801911adab08d112b1b429dce87b80c05a7378ece7fcfeeb2ea9101232f13c7e32e9e67866fcf0014e0c870583f
6
+ metadata.gz: ace0997dc03b122f06b10abfc79c4d0aa34004153c33eca34a403c5b8efa582d5528724416dd51715839b95ffa233c408ce710f24db80788323956b70eb26e0b
7
+ data.tar.gz: f3dcf7bd72fbab2f88540e54c8b67636009fc5261c831848c5e20f262a15fd7d6877bb0745443de9874fc57358a1d77e4bdc312a72752fd5bb9a47f03481c005
data/README.md CHANGED
@@ -34,11 +34,10 @@ end
34
34
  [route('/resources/<resourceId>')]
35
35
  def getResource(resourceId)
36
36
  # Get the user token and pass it to authress
37
- authorizationToken = request.headers.get('authorization')
38
- AuthressSdk::AuthressClient.set_token(authorizationToken)
37
+ user_identity = AuthressSdk::AuthressClient.verify_token(request.headers.get('authorization'))
39
38
 
40
39
  # Check Authress to authorize the user
41
- user_id = 'user_id_example' # String | The user to check permissions on
40
+ user_id = user_identity.sub
42
41
  resource_uri = "resources/#{resourceId}" # String | The uri path of a resource to validate, must be URL encoded, uri segments are allowed, the resource must be a full path, and permissions are not inherited by sub-resources.
43
42
  permission = 'READ' # String | Permission to check, '*' and scoped permissions can also be checked here.
44
43
  begin
@@ -77,7 +76,10 @@ end
77
76
  [route('/resources/<resourceId>')]
78
77
  def getResource(resourceId) {
79
78
  # Check Authress to authorize the user
80
- user_id = 'user_id_example' # String | The user to check permissions on
79
+ user_identity = AuthressSdk::AuthressClient.verify_token(request.headers.get('authorization'))
80
+
81
+ # Check Authress to authorize the user
82
+ user_id = user_identity.sub
81
83
  resource_uri = "resources/#{resourceId}" # String | The uri path of a resource to validate, must be URL encoded, uri segments are allowed, the resource must be a full path, and permissions are not inherited by sub-resources.
82
84
  permission = 'READ' # String | Permission to check, '*' and scoped permissions can also be checked here.
83
85
  begin
@@ -107,9 +109,10 @@ require 'authress-sdk'
107
109
 
108
110
  begin
109
111
  # Create a new access record.
112
+ user_identity = AuthressSdk::AuthressClient.verify_token(request.headers.get('authorization'))
110
113
  new_record = AuthressSdk::AccessRecord.new {
111
114
  name: "Access To New Resource #{NewResourceId}",
112
- users: [{ userId: requestUserId }],
115
+ users: [{ userId: user_identity.sub }],
113
116
  statements: [{
114
117
  resources: [{ resourceUri: "Resources/#{NewResourceId}" }],
115
118
  # Owner by default gives full control over this new resource, including the ability to grant others access as well.
@@ -25,11 +25,11 @@ module AuthressSdk
25
25
  # @param [Hash] opts the optional parameters
26
26
  # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
27
27
  def create_claim_with_http_info(body, opts = {})
28
- if @authress_client.config.debugging
29
- @authress_client.config.logger.debug 'Calling API: AccessRecordsApi.create_claim ...'
28
+ if @authress_client.config[:debugging]
29
+ @authress_client.config[:logger].debug 'Calling API: AccessRecordsApi.create_claim ...'
30
30
  end
31
31
  # verify the required parameter 'body' is set
32
- if @authress_client.config.client_side_validation && body.nil?
32
+ if @authress_client.config[:client_side_validation] && body.nil?
33
33
  fail ArgumentError, "Missing the required parameter 'body' when calling AccessRecordsApi.create_claim"
34
34
  end
35
35
  # resource path
@@ -62,8 +62,8 @@ module AuthressSdk
62
62
  :auth_names => auth_names,
63
63
  :return_type => return_type)
64
64
 
65
- if @authress_client.config.debugging
66
- @authress_client.config.logger.debug "API called: AccessRecordsApi#create_claim\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
65
+ if @authress_client.config[:debugging]
66
+ @authress_client.config[:logger].debug "API called: AccessRecordsApi#create_claim\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
67
67
  end
68
68
  return data, status_code, headers
69
69
  end
@@ -83,11 +83,11 @@ module AuthressSdk
83
83
  # @param [Hash] opts the optional parameters
84
84
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
85
85
  def create_invite_with_http_info(body, opts = {})
86
- if @authress_client.config.debugging
87
- @authress_client.config.logger.debug 'Calling API: AccessRecordsApi.create_invite ...'
86
+ if @authress_client.config[:debugging]
87
+ @authress_client.config[:logger].debug 'Calling API: AccessRecordsApi.create_invite ...'
88
88
  end
89
89
  # verify the required parameter 'body' is set
90
- if @authress_client.config.client_side_validation && body.nil?
90
+ if @authress_client.config[:client_side_validation] && body.nil?
91
91
  fail ArgumentError, "Missing the required parameter 'body' when calling AccessRecordsApi.create_invite"
92
92
  end
93
93
  # resource path
@@ -118,8 +118,8 @@ module AuthressSdk
118
118
  :auth_names => auth_names,
119
119
  :return_type => return_type)
120
120
 
121
- if @authress_client.config.debugging
122
- @authress_client.config.logger.debug "API called: AccessRecordsApi#create_invite\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
121
+ if @authress_client.config[:debugging]
122
+ @authress_client.config[:logger].debug "API called: AccessRecordsApi#create_invite\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
123
123
  end
124
124
  return data, status_code, headers
125
125
  end
@@ -139,11 +139,11 @@ module AuthressSdk
139
139
  # @param [Hash] opts the optional parameters
140
140
  # @return [Array<(AccessRecord, Integer, Hash)>] AccessRecord data, response status code and response headers
141
141
  def create_record_with_http_info(body, opts = {})
142
- if @authress_client.config.debugging
143
- @authress_client.config.logger.debug 'Calling API: AccessRecordsApi.create_record ...'
142
+ if @authress_client.config[:debugging]
143
+ @authress_client.config[:logger].debug 'Calling API: AccessRecordsApi.create_record ...'
144
144
  end
145
145
  # verify the required parameter 'body' is set
146
- if @authress_client.config.client_side_validation && body.nil?
146
+ if @authress_client.config[:client_side_validation] && body.nil?
147
147
  fail ArgumentError, "Missing the required parameter 'body' when calling AccessRecordsApi.create_record"
148
148
  end
149
149
  # resource path
@@ -176,8 +176,8 @@ module AuthressSdk
176
176
  :auth_names => auth_names,
177
177
  :return_type => return_type)
178
178
 
179
- if @authress_client.config.debugging
180
- @authress_client.config.logger.debug "API called: AccessRecordsApi#create_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
179
+ if @authress_client.config[:debugging]
180
+ @authress_client.config[:logger].debug "API called: AccessRecordsApi#create_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
181
181
  end
182
182
  return data, status_code, headers
183
183
  end
@@ -197,11 +197,11 @@ module AuthressSdk
197
197
  # @param [Hash] opts the optional parameters
198
198
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
199
199
  def delete_invite_with_http_info(invite_id, opts = {})
200
- if @authress_client.config.debugging
201
- @authress_client.config.logger.debug 'Calling API: AccessRecordsApi.delete_invite ...'
200
+ if @authress_client.config[:debugging]
201
+ @authress_client.config[:logger].debug 'Calling API: AccessRecordsApi.delete_invite ...'
202
202
  end
203
203
  # verify the required parameter 'invite_id' is set
204
- if @authress_client.config.client_side_validation && invite_id.nil?
204
+ if @authress_client.config[:client_side_validation] && invite_id.nil?
205
205
  fail ArgumentError, "Missing the required parameter 'invite_id' when calling AccessRecordsApi.delete_invite"
206
206
  end
207
207
  # resource path
@@ -230,8 +230,8 @@ module AuthressSdk
230
230
  :auth_names => auth_names,
231
231
  :return_type => return_type)
232
232
 
233
- if @authress_client.config.debugging
234
- @authress_client.config.logger.debug "API called: AccessRecordsApi#delete_invite\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
233
+ if @authress_client.config[:debugging]
234
+ @authress_client.config[:logger].debug "API called: AccessRecordsApi#delete_invite\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
235
235
  end
236
236
  return data, status_code, headers
237
237
  end
@@ -251,11 +251,11 @@ module AuthressSdk
251
251
  # @param [Hash] opts the optional parameters
252
252
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
253
253
  def delete_record_with_http_info(record_id, opts = {})
254
- if @authress_client.config.debugging
255
- @authress_client.config.logger.debug 'Calling API: AccessRecordsApi.delete_record ...'
254
+ if @authress_client.config[:debugging]
255
+ @authress_client.config[:logger].debug 'Calling API: AccessRecordsApi.delete_record ...'
256
256
  end
257
257
  # verify the required parameter 'record_id' is set
258
- if @authress_client.config.client_side_validation && record_id.nil?
258
+ if @authress_client.config[:client_side_validation] && record_id.nil?
259
259
  fail ArgumentError, "Missing the required parameter 'record_id' when calling AccessRecordsApi.delete_record"
260
260
  end
261
261
  # resource path
@@ -284,8 +284,8 @@ module AuthressSdk
284
284
  :auth_names => auth_names,
285
285
  :return_type => return_type)
286
286
 
287
- if @authress_client.config.debugging
288
- @authress_client.config.logger.debug "API called: AccessRecordsApi#delete_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
287
+ if @authress_client.config[:debugging]
288
+ @authress_client.config[:logger].debug "API called: AccessRecordsApi#delete_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
289
289
  end
290
290
  return data, status_code, headers
291
291
  end
@@ -305,11 +305,11 @@ module AuthressSdk
305
305
  # @param [Hash] opts the optional parameters
306
306
  # @return [Array<(AccessRecord, Integer, Hash)>] AccessRecord data, response status code and response headers
307
307
  def get_record_with_http_info(record_id, opts = {})
308
- if @authress_client.config.debugging
309
- @authress_client.config.logger.debug 'Calling API: AccessRecordsApi.get_record ...'
308
+ if @authress_client.config[:debugging]
309
+ @authress_client.config[:logger].debug 'Calling API: AccessRecordsApi.get_record ...'
310
310
  end
311
311
  # verify the required parameter 'record_id' is set
312
- if @authress_client.config.client_side_validation && record_id.nil?
312
+ if @authress_client.config[:client_side_validation] && record_id.nil?
313
313
  fail ArgumentError, "Missing the required parameter 'record_id' when calling AccessRecordsApi.get_record"
314
314
  end
315
315
  # resource path
@@ -340,8 +340,8 @@ module AuthressSdk
340
340
  :auth_names => auth_names,
341
341
  :return_type => return_type)
342
342
 
343
- if @authress_client.config.debugging
344
- @authress_client.config.logger.debug "API called: AccessRecordsApi#get_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
343
+ if @authress_client.config[:debugging]
344
+ @authress_client.config[:logger].debug "API called: AccessRecordsApi#get_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
345
345
  end
346
346
  return data, status_code, headers
347
347
  end
@@ -367,10 +367,10 @@ module AuthressSdk
367
367
  # @option opts [String] :status Filter records by their current status.
368
368
  # @return [Array<(InlineResponse2007, Integer, Hash)>] InlineResponse2007 data, response status code and response headers
369
369
  def get_records_with_http_info(opts = {})
370
- if @authress_client.config.debugging
371
- @authress_client.config.logger.debug 'Calling API: AccessRecordsApi.get_records ...'
370
+ if @authress_client.config[:debugging]
371
+ @authress_client.config[:logger].debug 'Calling API: AccessRecordsApi.get_records ...'
372
372
  end
373
- if @authress_client.config.client_side_validation && opts[:'status'] && !['ACTIVE', 'DELETED'].include?(opts[:'status'])
373
+ if @authress_client.config[:client_side_validation] && opts[:'status'] && !['ACTIVE', 'DELETED'].include?(opts[:'status'])
374
374
  fail ArgumentError, 'invalid value for "status", must be one of ACTIVE, DELETED'
375
375
  end
376
376
  # resource path
@@ -405,8 +405,8 @@ module AuthressSdk
405
405
  :auth_names => auth_names,
406
406
  :return_type => return_type)
407
407
 
408
- if @authress_client.config.debugging
409
- @authress_client.config.logger.debug "API called: AccessRecordsApi#get_records\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
408
+ if @authress_client.config[:debugging]
409
+ @authress_client.config[:logger].debug "API called: AccessRecordsApi#get_records\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
410
410
  end
411
411
  return data, status_code, headers
412
412
  end
@@ -426,11 +426,11 @@ module AuthressSdk
426
426
  # @param [Hash] opts the optional parameters
427
427
  # @return [Array<(InlineResponse2009, Integer, Hash)>] InlineResponse2009 data, response status code and response headers
428
428
  def respond_to_invite_with_http_info(invite_id, opts = {})
429
- if @authress_client.config.debugging
430
- @authress_client.config.logger.debug 'Calling API: AccessRecordsApi.respond_to_invite ...'
429
+ if @authress_client.config[:debugging]
430
+ @authress_client.config[:logger].debug 'Calling API: AccessRecordsApi.respond_to_invite ...'
431
431
  end
432
432
  # verify the required parameter 'invite_id' is set
433
- if @authress_client.config.client_side_validation && invite_id.nil?
433
+ if @authress_client.config[:client_side_validation] && invite_id.nil?
434
434
  fail ArgumentError, "Missing the required parameter 'invite_id' when calling AccessRecordsApi.respond_to_invite"
435
435
  end
436
436
  # resource path
@@ -461,8 +461,8 @@ module AuthressSdk
461
461
  :auth_names => auth_names,
462
462
  :return_type => return_type)
463
463
 
464
- if @authress_client.config.debugging
465
- @authress_client.config.logger.debug "API called: AccessRecordsApi#respond_to_invite\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
464
+ if @authress_client.config[:debugging]
465
+ @authress_client.config[:logger].debug "API called: AccessRecordsApi#respond_to_invite\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
466
466
  end
467
467
  return data, status_code, headers
468
468
  end
@@ -484,15 +484,15 @@ module AuthressSdk
484
484
  # @param [Hash] opts the optional parameters
485
485
  # @return [Array<(AccessRecord, Integer, Hash)>] AccessRecord data, response status code and response headers
486
486
  def update_record_with_http_info(body, record_id, opts = {})
487
- if @authress_client.config.debugging
488
- @authress_client.config.logger.debug 'Calling API: AccessRecordsApi.update_record ...'
487
+ if @authress_client.config[:debugging]
488
+ @authress_client.config[:logger].debug 'Calling API: AccessRecordsApi.update_record ...'
489
489
  end
490
490
  # verify the required parameter 'body' is set
491
- if @authress_client.config.client_side_validation && body.nil?
491
+ if @authress_client.config[:client_side_validation] && body.nil?
492
492
  fail ArgumentError, "Missing the required parameter 'body' when calling AccessRecordsApi.update_record"
493
493
  end
494
494
  # verify the required parameter 'record_id' is set
495
- if @authress_client.config.client_side_validation && record_id.nil?
495
+ if @authress_client.config[:client_side_validation] && record_id.nil?
496
496
  fail ArgumentError, "Missing the required parameter 'record_id' when calling AccessRecordsApi.update_record"
497
497
  end
498
498
  # resource path
@@ -525,8 +525,8 @@ module AuthressSdk
525
525
  :auth_names => auth_names,
526
526
  :return_type => return_type)
527
527
 
528
- if @authress_client.config.debugging
529
- @authress_client.config.logger.debug "API called: AccessRecordsApi#update_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
528
+ if @authress_client.config[:debugging]
529
+ @authress_client.config[:logger].debug "API called: AccessRecordsApi#update_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
530
530
  end
531
531
  return data, status_code, headers
532
532
  end
@@ -25,11 +25,11 @@ module AuthressSdk
25
25
  # @param [Hash] opts the optional parameters
26
26
  # @return [Array<(InlineResponse2009, Integer, Hash)>] InlineResponse2009 data, response status code and response headers
27
27
  def get_account_with_http_info(account_id, opts = {})
28
- if @authress_client.config.debugging
29
- @authress_client.config.logger.debug 'Calling API: AccountsApi.get_account ...'
28
+ if @authress_client.config[:debugging]
29
+ @authress_client.config[:logger].debug 'Calling API: AccountsApi.get_account ...'
30
30
  end
31
31
  # verify the required parameter 'account_id' is set
32
- if @authress_client.config.client_side_validation && account_id.nil?
32
+ if @authress_client.config[:client_side_validation] && account_id.nil?
33
33
  fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountsApi.get_account"
34
34
  end
35
35
  # resource path
@@ -60,8 +60,8 @@ module AuthressSdk
60
60
  :auth_names => auth_names,
61
61
  :return_type => return_type)
62
62
 
63
- if @authress_client.config.debugging
64
- @authress_client.config.logger.debug "API called: AccountsApi#get_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
63
+ if @authress_client.config[:debugging]
64
+ @authress_client.config[:logger].debug "API called: AccountsApi#get_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
65
65
  end
66
66
  return data, status_code, headers
67
67
  end
@@ -79,8 +79,8 @@ module AuthressSdk
79
79
  # @param [Hash] opts the optional parameters
80
80
  # @return [Array<(InlineResponse20012, Integer, Hash)>] InlineResponse20012 data, response status code and response headers
81
81
  def get_account_identities_with_http_info(opts = {})
82
- if @authress_client.config.debugging
83
- @authress_client.config.logger.debug 'Calling API: AccountsApi.get_account_identities ...'
82
+ if @authress_client.config[:debugging]
83
+ @authress_client.config[:logger].debug 'Calling API: AccountsApi.get_account_identities ...'
84
84
  end
85
85
  # resource path
86
86
  local_var_path = '/v1/identities'
@@ -110,8 +110,8 @@ module AuthressSdk
110
110
  :auth_names => auth_names,
111
111
  :return_type => return_type)
112
112
 
113
- if @authress_client.config.debugging
114
- @authress_client.config.logger.debug "API called: AccountsApi#get_account_identities\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
113
+ if @authress_client.config[:debugging]
114
+ @authress_client.config[:logger].debug "API called: AccountsApi#get_account_identities\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
115
115
  end
116
116
  return data, status_code, headers
117
117
  end
@@ -129,8 +129,8 @@ module AuthressSdk
129
129
  # @param [Hash] opts the optional parameters
130
130
  # @return [Array<(InlineResponse20011, Integer, Hash)>] InlineResponse20011 data, response status code and response headers
131
131
  def get_accounts_with_http_info(opts = {})
132
- if @authress_client.config.debugging
133
- @authress_client.config.logger.debug 'Calling API: AccountsApi.get_accounts ...'
132
+ if @authress_client.config[:debugging]
133
+ @authress_client.config[:logger].debug 'Calling API: AccountsApi.get_accounts ...'
134
134
  end
135
135
  # resource path
136
136
  local_var_path = '/v1/accounts'
@@ -160,8 +160,8 @@ module AuthressSdk
160
160
  :auth_names => auth_names,
161
161
  :return_type => return_type)
162
162
 
163
- if @authress_client.config.debugging
164
- @authress_client.config.logger.debug "API called: AccountsApi#get_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
163
+ if @authress_client.config[:debugging]
164
+ @authress_client.config[:logger].debug "API called: AccountsApi#get_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
165
165
  end
166
166
  return data, status_code, headers
167
167
  end
@@ -181,11 +181,11 @@ module AuthressSdk
181
181
  # @param [Hash] opts the optional parameters
182
182
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
183
183
  def link_identity_with_http_info(body, opts = {})
184
- if @authress_client.config.debugging
185
- @authress_client.config.logger.debug 'Calling API: AccountsApi.link_identity ...'
184
+ if @authress_client.config[:debugging]
185
+ @authress_client.config[:logger].debug 'Calling API: AccountsApi.link_identity ...'
186
186
  end
187
187
  # verify the required parameter 'body' is set
188
- if @authress_client.config.client_side_validation && body.nil?
188
+ if @authress_client.config[:client_side_validation] && body.nil?
189
189
  fail ArgumentError, "Missing the required parameter 'body' when calling AccountsApi.link_identity"
190
190
  end
191
191
  # resource path
@@ -216,8 +216,8 @@ module AuthressSdk
216
216
  :auth_names => auth_names,
217
217
  :return_type => return_type)
218
218
 
219
- if @authress_client.config.debugging
220
- @authress_client.config.logger.debug "API called: AccountsApi#link_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
219
+ if @authress_client.config[:debugging]
220
+ @authress_client.config[:logger].debug "API called: AccountsApi#link_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
221
221
  end
222
222
  return data, status_code, headers
223
223
  end
@@ -0,0 +1,46 @@
1
+ =begin
2
+
3
+ =end
4
+
5
+ module AuthressSdk
6
+ class LoginApi
7
+ attr_accessor :application_id
8
+ attr_accessor :authress_client
9
+
10
+ def initialize(application_id)
11
+ @application_id = application_id
12
+ @authress_client = AuthressClient.default
13
+ end
14
+
15
+ # Authenticate the user
16
+ # @param authenticationRequest
17
+ # @return string, the redirect url to redirect the user to
18
+ def authenticate(authenticationRequest)
19
+ code_verifier = SecureRandom.urlsafe_base64(32)
20
+ code_challenge = Base64.urlsafe_encode64(OpenSSL::Digest::SHA256.digest(code_verifier)).gsub(/=+$/, '')
21
+
22
+ body = {
23
+ 'redirectUrl' => authenticationRequest[:redirect_url],
24
+ 'codeChallengeMethod' => 'S256',
25
+ 'codeChallenge' => code_challenge,
26
+ 'connectionId' => authenticationRequest[:connection_id],
27
+ 'tenantLookupIdentifier': authenticationRequest[:tenant_lookup_identifier],
28
+ 'applicationId' => @application_id,
29
+ # 'responseLocation' => 'cookie',
30
+ # 'flowType' => 'code'
31
+ }
32
+
33
+ header_params = {}
34
+ header_params['Origin'] = @authress_client.base_url
35
+ post_body = @authress_client.object_to_http_body(body)
36
+ data, status_code, headers = @authress_client.call_api(:POST, '/api/authentication',
37
+ :header_params => header_params,
38
+ :body => post_body)
39
+
40
+ if @authress_client.config[:debugging]
41
+ @authress_client.config[:logger].debug "API called: LoginApi#authenticate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
42
+ end
43
+ return headers[:location], code_verifier
44
+ end
45
+ end
46
+ end
@@ -27,15 +27,15 @@ module AuthressSdk
27
27
  # @param [Hash] opts the optional parameters
28
28
  # @return [Array<(InlineResponse2001, Integer, Hash)>] InlineResponse2001 data, response status code and response headers
29
29
  def get_user_metadata_with_http_info(user_id, resource_uri, opts = {})
30
- if @authress_client.config.debugging
31
- @authress_client.config.logger.debug 'Calling API: MetadataApi.get_user_metadata ...'
30
+ if @authress_client.config[:debugging]
31
+ @authress_client.config[:logger].debug 'Calling API: MetadataApi.get_user_metadata ...'
32
32
  end
33
33
  # verify the required parameter 'user_id' is set
34
- if @authress_client.config.client_side_validation && user_id.nil?
34
+ if @authress_client.config[:client_side_validation] && user_id.nil?
35
35
  fail ArgumentError, "Missing the required parameter 'user_id' when calling MetadataApi.get_user_metadata"
36
36
  end
37
37
  # verify the required parameter 'resource_uri' is set
38
- if @authress_client.config.client_side_validation && resource_uri.nil?
38
+ if @authress_client.config[:client_side_validation] && resource_uri.nil?
39
39
  fail ArgumentError, "Missing the required parameter 'resource_uri' when calling MetadataApi.get_user_metadata"
40
40
  end
41
41
  # resource path
@@ -66,8 +66,8 @@ module AuthressSdk
66
66
  :auth_names => auth_names,
67
67
  :return_type => return_type)
68
68
 
69
- if @authress_client.config.debugging
70
- @authress_client.config.logger.debug "API called: MetadataApi#get_user_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
69
+ if @authress_client.config[:debugging]
70
+ @authress_client.config[:logger].debug "API called: MetadataApi#get_user_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
71
71
  end
72
72
  return data, status_code, headers
73
73
  end
@@ -91,19 +91,19 @@ module AuthressSdk
91
91
  # @param [Hash] opts the optional parameters
92
92
  # @return [Array<(InlineResponse2001, Integer, Hash)>] InlineResponse2001 data, response status code and response headers
93
93
  def update_user_metadata_with_http_info(body, user_id, resource_uri, opts = {})
94
- if @authress_client.config.debugging
95
- @authress_client.config.logger.debug 'Calling API: MetadataApi.update_user_metadata ...'
94
+ if @authress_client.config[:debugging]
95
+ @authress_client.config[:logger].debug 'Calling API: MetadataApi.update_user_metadata ...'
96
96
  end
97
97
  # verify the required parameter 'body' is set
98
- if @authress_client.config.client_side_validation && body.nil?
98
+ if @authress_client.config[:client_side_validation] && body.nil?
99
99
  fail ArgumentError, "Missing the required parameter 'body' when calling MetadataApi.update_user_metadata"
100
100
  end
101
101
  # verify the required parameter 'user_id' is set
102
- if @authress_client.config.client_side_validation && user_id.nil?
102
+ if @authress_client.config[:client_side_validation] && user_id.nil?
103
103
  fail ArgumentError, "Missing the required parameter 'user_id' when calling MetadataApi.update_user_metadata"
104
104
  end
105
105
  # verify the required parameter 'resource_uri' is set
106
- if @authress_client.config.client_side_validation && resource_uri.nil?
106
+ if @authress_client.config[:client_side_validation] && resource_uri.nil?
107
107
  fail ArgumentError, "Missing the required parameter 'resource_uri' when calling MetadataApi.update_user_metadata"
108
108
  end
109
109
  # resource path
@@ -136,8 +136,8 @@ module AuthressSdk
136
136
  :auth_names => auth_names,
137
137
  :return_type => return_type)
138
138
 
139
- if @authress_client.config.debugging
140
- @authress_client.config.logger.debug "API called: MetadataApi#update_user_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
139
+ if @authress_client.config[:debugging]
140
+ @authress_client.config[:logger].debug "API called: MetadataApi#update_user_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
141
141
  end
142
142
  return data, status_code, headers
143
143
  end
@@ -25,11 +25,11 @@ module AuthressSdk
25
25
  # @param [Hash] opts the optional parameters
26
26
  # @return [Array<(InlineResponse2005, Integer, Hash)>] InlineResponse2005 data, response status code and response headers
27
27
  def get_resource_permissions_with_http_info(resource_uri, opts = {})
28
- if @authress_client.config.debugging
29
- @authress_client.config.logger.debug 'Calling API: ResourcePermissionsApi.get_resource_permissions ...'
28
+ if @authress_client.config[:debugging]
29
+ @authress_client.config[:logger].debug 'Calling API: ResourcePermissionsApi.get_resource_permissions ...'
30
30
  end
31
31
  # verify the required parameter 'resource_uri' is set
32
- if @authress_client.config.client_side_validation && resource_uri.nil?
32
+ if @authress_client.config[:client_side_validation] && resource_uri.nil?
33
33
  fail ArgumentError, "Missing the required parameter 'resource_uri' when calling ResourcePermissionsApi.get_resource_permissions"
34
34
  end
35
35
  # resource path
@@ -60,8 +60,8 @@ module AuthressSdk
60
60
  :auth_names => auth_names,
61
61
  :return_type => return_type)
62
62
 
63
- if @authress_client.config.debugging
64
- @authress_client.config.logger.debug "API called: ResourcePermissionsApi#get_resource_permissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
63
+ if @authress_client.config[:debugging]
64
+ @authress_client.config[:logger].debug "API called: ResourcePermissionsApi#get_resource_permissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
65
65
  end
66
66
  return data, status_code, headers
67
67
  end
@@ -85,11 +85,11 @@ module AuthressSdk
85
85
  # @option opts [String] :cursor Continuation cursor for paging (will automatically be set)
86
86
  # @return [Array<(InlineResponse2006, Integer, Hash)>] InlineResponse2006 data, response status code and response headers
87
87
  def get_resource_users_with_http_info(resource_uri, opts = {})
88
- if @authress_client.config.debugging
89
- @authress_client.config.logger.debug 'Calling API: ResourcePermissionsApi.get_resource_users ...'
88
+ if @authress_client.config[:debugging]
89
+ @authress_client.config[:logger].debug 'Calling API: ResourcePermissionsApi.get_resource_users ...'
90
90
  end
91
91
  # verify the required parameter 'resource_uri' is set
92
- if @authress_client.config.client_side_validation && resource_uri.nil?
92
+ if @authress_client.config[:client_side_validation] && resource_uri.nil?
93
93
  fail ArgumentError, "Missing the required parameter 'resource_uri' when calling ResourcePermissionsApi.get_resource_users"
94
94
  end
95
95
  # resource path
@@ -122,8 +122,8 @@ module AuthressSdk
122
122
  :auth_names => auth_names,
123
123
  :return_type => return_type)
124
124
 
125
- if @authress_client.config.debugging
126
- @authress_client.config.logger.debug "API called: ResourcePermissionsApi#get_resource_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
125
+ if @authress_client.config[:debugging]
126
+ @authress_client.config[:logger].debug "API called: ResourcePermissionsApi#get_resource_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
127
127
  end
128
128
  return data, status_code, headers
129
129
  end
@@ -141,8 +141,8 @@ module AuthressSdk
141
141
  # @param [Hash] opts the optional parameters
142
142
  # @return [Array<(InlineResponse2004, Integer, Hash)>] InlineResponse2004 data, response status code and response headers
143
143
  def get_resources_with_http_info(opts = {})
144
- if @authress_client.config.debugging
145
- @authress_client.config.logger.debug 'Calling API: ResourcePermissionsApi.get_resources ...'
144
+ if @authress_client.config[:debugging]
145
+ @authress_client.config[:logger].debug 'Calling API: ResourcePermissionsApi.get_resources ...'
146
146
  end
147
147
  # resource path
148
148
  local_var_path = '/v1/resources'
@@ -172,8 +172,8 @@ module AuthressSdk
172
172
  :auth_names => auth_names,
173
173
  :return_type => return_type)
174
174
 
175
- if @authress_client.config.debugging
176
- @authress_client.config.logger.debug "API called: ResourcePermissionsApi#get_resources\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
175
+ if @authress_client.config[:debugging]
176
+ @authress_client.config[:logger].debug "API called: ResourcePermissionsApi#get_resources\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
177
177
  end
178
178
  return data, status_code, headers
179
179
  end
@@ -195,15 +195,15 @@ module AuthressSdk
195
195
  # @param [Hash] opts the optional parameters
196
196
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
197
197
  def update_resource_permissions_with_http_info(body, resource_uri, opts = {})
198
- if @authress_client.config.debugging
199
- @authress_client.config.logger.debug 'Calling API: ResourcePermissionsApi.update_resource_permissions ...'
198
+ if @authress_client.config[:debugging]
199
+ @authress_client.config[:logger].debug 'Calling API: ResourcePermissionsApi.update_resource_permissions ...'
200
200
  end
201
201
  # verify the required parameter 'body' is set
202
- if @authress_client.config.client_side_validation && body.nil?
202
+ if @authress_client.config[:client_side_validation] && body.nil?
203
203
  fail ArgumentError, "Missing the required parameter 'body' when calling ResourcePermissionsApi.update_resource_permissions"
204
204
  end
205
205
  # verify the required parameter 'resource_uri' is set
206
- if @authress_client.config.client_side_validation && resource_uri.nil?
206
+ if @authress_client.config[:client_side_validation] && resource_uri.nil?
207
207
  fail ArgumentError, "Missing the required parameter 'resource_uri' when calling ResourcePermissionsApi.update_resource_permissions"
208
208
  end
209
209
  # resource path
@@ -234,8 +234,8 @@ module AuthressSdk
234
234
  :auth_names => auth_names,
235
235
  :return_type => return_type)
236
236
 
237
- if @authress_client.config.debugging
238
- @authress_client.config.logger.debug "API called: ResourcePermissionsApi#update_resource_permissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
237
+ if @authress_client.config[:debugging]
238
+ @authress_client.config[:logger].debug "API called: ResourcePermissionsApi#update_resource_permissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
239
239
  end
240
240
  return data, status_code, headers
241
241
  end