authress-sdk 0.1.20.0 → 1.0.21.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +36 -32
  3. data/lib/authress_sdk.rb +18 -0
  4. data/lib/{swagger_client → authress_sdk}/api/access_records_api.rb +73 -80
  5. data/lib/{swagger_client → authress_sdk}/api/accounts_api.rb +31 -38
  6. data/lib/{swagger_client → authress_sdk}/api/metadata_api.rb +23 -30
  7. data/lib/{swagger_client → authress_sdk}/api/resource_permissions_api.rb +33 -40
  8. data/lib/{swagger_client → authress_sdk}/api/roles_api.rb +36 -43
  9. data/lib/{swagger_client → authress_sdk}/api/service_clients_api.rb +56 -63
  10. data/lib/{swagger_client → authress_sdk}/api/user_permissions_api.rb +44 -51
  11. data/lib/authress_sdk/api_error.rb +50 -0
  12. data/lib/{swagger_client/api_client.rb → authress_sdk/authress_client.rb} +36 -110
  13. data/lib/authress_sdk/constant_token_provider.rb +19 -0
  14. data/lib/{swagger_client → authress_sdk}/models/access_record.rb +4 -11
  15. data/lib/{swagger_client → authress_sdk}/models/access_record_collection.rb +4 -11
  16. data/lib/{swagger_client → authress_sdk}/models/access_record_collection_records.rb +4 -11
  17. data/lib/{swagger_client → authress_sdk}/models/account.rb +4 -11
  18. data/lib/{swagger_client/models/inline_response_200_11.rb → authress_sdk/models/account_collection.rb} +5 -12
  19. data/lib/{swagger_client → authress_sdk}/models/account_collection_accounts.rb +4 -11
  20. data/lib/{swagger_client → authress_sdk}/models/body.rb +4 -11
  21. data/lib/{swagger_client → authress_sdk}/models/body_1.rb +4 -11
  22. data/lib/{swagger_client → authress_sdk}/models/body_10.rb +4 -11
  23. data/lib/{swagger_client → authress_sdk}/models/body_11.rb +4 -11
  24. data/lib/{swagger_client → authress_sdk}/models/body_2.rb +4 -11
  25. data/lib/{swagger_client → authress_sdk}/models/body_3.rb +4 -11
  26. data/lib/{swagger_client → authress_sdk}/models/body_4.rb +4 -11
  27. data/lib/{swagger_client → authress_sdk}/models/body_5.rb +4 -11
  28. data/lib/{swagger_client → authress_sdk}/models/body_6.rb +4 -11
  29. data/lib/{swagger_client → authress_sdk}/models/body_7.rb +4 -11
  30. data/lib/{swagger_client → authress_sdk}/models/body_8.rb +4 -11
  31. data/lib/{swagger_client → authress_sdk}/models/body_9.rb +4 -11
  32. data/lib/{swagger_client → authress_sdk}/models/claim_request.rb +4 -11
  33. data/lib/{swagger_client → authress_sdk}/models/claim_response.rb +4 -11
  34. data/lib/{swagger_client → authress_sdk}/models/client.rb +4 -11
  35. data/lib/{swagger_client → authress_sdk}/models/client_access_key.rb +4 -11
  36. data/lib/{swagger_client → authress_sdk}/models/client_collection.rb +4 -11
  37. data/lib/{swagger_client → authress_sdk}/models/client_collection_clients.rb +4 -11
  38. data/lib/{swagger_client → authress_sdk}/models/identity.rb +4 -11
  39. data/lib/{swagger_client → authress_sdk}/models/identity_collection.rb +4 -11
  40. data/lib/{swagger_client → authress_sdk}/models/identity_collection_identities.rb +4 -11
  41. data/lib/{swagger_client → authress_sdk}/models/identity_request.rb +4 -11
  42. data/lib/{swagger_client → authress_sdk}/models/inline_response_200.rb +4 -11
  43. data/lib/{swagger_client → authress_sdk}/models/inline_response_200_1.rb +4 -11
  44. data/lib/{swagger_client → authress_sdk}/models/inline_response_200_10.rb +4 -11
  45. data/lib/{swagger_client/models/account_collection.rb → authress_sdk/models/inline_response_200_11.rb} +5 -12
  46. data/lib/{swagger_client → authress_sdk}/models/inline_response_200_12.rb +4 -11
  47. data/lib/{swagger_client → authress_sdk}/models/inline_response_200_13.rb +4 -11
  48. data/lib/{swagger_client → authress_sdk}/models/inline_response_200_14.rb +4 -11
  49. data/lib/{swagger_client → authress_sdk}/models/inline_response_200_15.rb +4 -11
  50. data/lib/{swagger_client → authress_sdk}/models/inline_response_200_2.rb +4 -11
  51. data/lib/{swagger_client → authress_sdk}/models/inline_response_200_3.rb +4 -11
  52. data/lib/{swagger_client → authress_sdk}/models/inline_response_200_4.rb +4 -11
  53. data/lib/{swagger_client → authress_sdk}/models/inline_response_200_5.rb +4 -11
  54. data/lib/{swagger_client → authress_sdk}/models/inline_response_200_6.rb +4 -11
  55. data/lib/{swagger_client → authress_sdk}/models/inline_response_200_7.rb +4 -11
  56. data/lib/{swagger_client → authress_sdk}/models/inline_response_200_8.rb +4 -11
  57. data/lib/{swagger_client → authress_sdk}/models/inline_response_200_9.rb +4 -11
  58. data/lib/{swagger_client → authress_sdk}/models/invite.rb +4 -11
  59. data/lib/{swagger_client → authress_sdk}/models/link.rb +4 -11
  60. data/lib/{swagger_client → authress_sdk}/models/metadata_object.rb +4 -11
  61. data/lib/{swagger_client/models/v1roles_permissions.rb → authress_sdk/models/permission_object.rb} +5 -12
  62. data/lib/{swagger_client → authress_sdk}/models/permission_response.rb +4 -11
  63. data/lib/{swagger_client → authress_sdk}/models/resource_permission.rb +4 -11
  64. data/lib/{swagger_client → authress_sdk}/models/resource_permission_collection.rb +4 -11
  65. data/lib/{swagger_client → authress_sdk}/models/resource_permission_collection_links.rb +4 -11
  66. data/lib/{swagger_client → authress_sdk}/models/resource_permission_collection_links_next.rb +4 -11
  67. data/lib/{swagger_client → authress_sdk}/models/resource_permission_collection_resources.rb +4 -11
  68. data/lib/{swagger_client → authress_sdk}/models/resource_users_collection.rb +4 -11
  69. data/lib/{swagger_client → authress_sdk}/models/role.rb +4 -11
  70. data/lib/{swagger_client → authress_sdk}/models/statement.rb +4 -11
  71. data/lib/{swagger_client → authress_sdk}/models/token_request.rb +4 -11
  72. data/lib/{swagger_client → authress_sdk}/models/user.rb +4 -11
  73. data/lib/{swagger_client → authress_sdk}/models/user_resources.rb +4 -11
  74. data/lib/{swagger_client → authress_sdk}/models/user_resources_resources.rb +4 -11
  75. data/lib/{swagger_client → authress_sdk}/models/user_token.rb +4 -11
  76. data/lib/{swagger_client → authress_sdk}/models/user_token_links.rb +4 -11
  77. data/lib/{swagger_client → authress_sdk}/models/user_token_links_self.rb +4 -11
  78. data/lib/{swagger_client → authress_sdk}/models/v1clients_options.rb +4 -11
  79. data/lib/{swagger_client → authress_sdk}/models/v1records_account.rb +4 -11
  80. data/lib/{swagger_client → authress_sdk}/models/v1records_links.rb +4 -11
  81. data/lib/{swagger_client → authress_sdk}/models/v1records_links_self.rb +4 -11
  82. data/lib/{swagger_client → authress_sdk}/models/v1records_users.rb +4 -11
  83. data/lib/{swagger_client → authress_sdk}/models/v1resourcesresource_uri_permissions.rb +4 -11
  84. data/lib/{swagger_client/models/permission_object.rb → authress_sdk/models/v1roles_permissions.rb} +5 -12
  85. data/lib/{swagger_client → authress_sdk}/models/v1usersuser_idresourcesresource_urimetadata_account.rb +4 -11
  86. data/lib/{swagger_client → authress_sdk}/models/v1usersuser_idtokens_resources.rb +4 -11
  87. data/lib/{swagger_client → authress_sdk}/models/v1usersuser_idtokens_statements.rb +4 -11
  88. data/lib/authress_sdk/service_client_token_provider.rb +18 -0
  89. metadata +87 -87
  90. data/lib/swagger_client.rb +0 -30
  91. data/lib/swagger_client/api_error.rb +0 -57
  92. data/lib/swagger_client/configuration.rb +0 -205
  93. data/lib/swagger_client/version.rb +0 -14
@@ -1,20 +1,13 @@
1
1
  =begin
2
- #Authress
3
2
 
4
- #<p> <h2>Authorization</h2> <p>Authorization for Authress is handled one of two different ways. Both mechanisms use oauth2 <i>Bearer</i> tokens.</p> <br> <h4>Identity Provider JWT</h4> <p>Hook up your preferred identity provider directly to Authress. Authress will verify JWTs sourced from that identify provider and allow direct integration with these APIs. Any OIDC JWT provider works, Google, Auth0, Okta, etc... With this mechanism your web app can make direct calls to the permissions API on behalf of your users. <br> <a href=\"https://authress.io/app/#/manage?focus=identity\">Link identity provider</a> </p> <br> <h4>Authress Clients</h4> <p>Regardless of using direct identity provider integration, with the API you can create Authress clients which can call any of the methods on the API. Your users won't be able to directly make API calls, all web app integrations must go through a service which stores the Authress private key. <br> <a href=\"https://authress.io/app/#/manage?focus=clients\">Create Authress service client</a> </p> <br> <h2>Usage</h2> <h4>Billable APIs</h4> <p>Most of the api available is completely free. Use it to populate your roles and configure your account. You'll only be charged for the ones marked as Billable.</p> <p><ul> <li><i class=\"far fa-fw fa-money-bill-alt text-primary\"></i> <span class=\"text-primary\">Billable</span> - <small>These APIs count as calls for your account and will be charged.</small></li> <li><i class=\"fas fa-fw fa-angle-double-right text-secondary\"></i> <span class=\"text-secondary\">Free</span> - <small>These are totally free.</small></li> <li><i class=\"fas fa-fw fa-balance-scale text-secondary\"></i> <span class=\"text-secondary\">Condition</span> - <small>Are conditionally free, see api methods for details.</small></li> </ul></p> <br> <h4>API Access</h4> <p>Access to the following APIs is based on Authress permissions, not the application permissions assigned in Authress to the application services. Each resource is tagged with the required permission <span class=\"badge badge-outline-secondary\">Action: Resource</span> </p>
5
-
6
- OpenAPI spec version: v1
7
- Contact: support@authress.io
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 3.0.23
10
3
  =end
11
4
 
12
- module SwaggerClient
5
+ module AuthressSdk
13
6
  class AccountsApi
14
- attr_accessor :api_client
7
+ attr_accessor :authress_client
15
8
 
16
- def initialize(api_client = ApiClient.default)
17
- @api_client = api_client
9
+ def initialize(authress_client = AuthressClient.default)
10
+ @authress_client = authress_client
18
11
  end
19
12
  # Get account information.
20
13
  # Includes the original configuration information. <br><span class=\"badge badge-outline-secondary\">READ: Authress:Configuration</span>
@@ -32,11 +25,11 @@ module SwaggerClient
32
25
  # @param [Hash] opts the optional parameters
33
26
  # @return [Array<(InlineResponse2009, Integer, Hash)>] InlineResponse2009 data, response status code and response headers
34
27
  def get_account_with_http_info(account_id, opts = {})
35
- if @api_client.config.debugging
36
- @api_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 ...'
37
30
  end
38
31
  # verify the required parameter 'account_id' is set
39
- if @api_client.config.client_side_validation && account_id.nil?
32
+ if @authress_client.config.client_side_validation && account_id.nil?
40
33
  fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountsApi.get_account"
41
34
  end
42
35
  # resource path
@@ -48,7 +41,7 @@ module SwaggerClient
48
41
  # header parameters
49
42
  header_params = opts[:header_params] || {}
50
43
  # HTTP header 'Accept' (if needed)
51
- header_params['Accept'] = @api_client.select_header_accept(['application/links+json'])
44
+ header_params['Accept'] = @authress_client.select_header_accept(['application/links+json'])
52
45
 
53
46
  # form parameters
54
47
  form_params = opts[:form_params] || {}
@@ -59,7 +52,7 @@ module SwaggerClient
59
52
  return_type = opts[:return_type] || 'InlineResponse2009'
60
53
 
61
54
  auth_names = opts[:auth_names] || ['oauth2']
62
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
55
+ data, status_code, headers = @authress_client.call_api(:GET, local_var_path,
63
56
  :header_params => header_params,
64
57
  :query_params => query_params,
65
58
  :form_params => form_params,
@@ -67,8 +60,8 @@ module SwaggerClient
67
60
  :auth_names => auth_names,
68
61
  :return_type => return_type)
69
62
 
70
- if @api_client.config.debugging
71
- @api_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}"
72
65
  end
73
66
  return data, status_code, headers
74
67
  end
@@ -86,8 +79,8 @@ module SwaggerClient
86
79
  # @param [Hash] opts the optional parameters
87
80
  # @return [Array<(InlineResponse20012, Integer, Hash)>] InlineResponse20012 data, response status code and response headers
88
81
  def get_account_identities_with_http_info(opts = {})
89
- if @api_client.config.debugging
90
- @api_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 ...'
91
84
  end
92
85
  # resource path
93
86
  local_var_path = '/v1/identities'
@@ -98,7 +91,7 @@ module SwaggerClient
98
91
  # header parameters
99
92
  header_params = opts[:header_params] || {}
100
93
  # HTTP header 'Accept' (if needed)
101
- header_params['Accept'] = @api_client.select_header_accept(['application/links+json'])
94
+ header_params['Accept'] = @authress_client.select_header_accept(['application/links+json'])
102
95
 
103
96
  # form parameters
104
97
  form_params = opts[:form_params] || {}
@@ -109,7 +102,7 @@ module SwaggerClient
109
102
  return_type = opts[:return_type] || 'InlineResponse20012'
110
103
 
111
104
  auth_names = opts[:auth_names] || ['oauth2']
112
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
105
+ data, status_code, headers = @authress_client.call_api(:GET, local_var_path,
113
106
  :header_params => header_params,
114
107
  :query_params => query_params,
115
108
  :form_params => form_params,
@@ -117,8 +110,8 @@ module SwaggerClient
117
110
  :auth_names => auth_names,
118
111
  :return_type => return_type)
119
112
 
120
- if @api_client.config.debugging
121
- @api_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}"
122
115
  end
123
116
  return data, status_code, headers
124
117
  end
@@ -136,8 +129,8 @@ module SwaggerClient
136
129
  # @param [Hash] opts the optional parameters
137
130
  # @return [Array<(InlineResponse20011, Integer, Hash)>] InlineResponse20011 data, response status code and response headers
138
131
  def get_accounts_with_http_info(opts = {})
139
- if @api_client.config.debugging
140
- @api_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 ...'
141
134
  end
142
135
  # resource path
143
136
  local_var_path = '/v1/accounts'
@@ -148,7 +141,7 @@ module SwaggerClient
148
141
  # header parameters
149
142
  header_params = opts[:header_params] || {}
150
143
  # HTTP header 'Accept' (if needed)
151
- header_params['Accept'] = @api_client.select_header_accept(['application/links+json'])
144
+ header_params['Accept'] = @authress_client.select_header_accept(['application/links+json'])
152
145
 
153
146
  # form parameters
154
147
  form_params = opts[:form_params] || {}
@@ -159,7 +152,7 @@ module SwaggerClient
159
152
  return_type = opts[:return_type] || 'InlineResponse20011'
160
153
 
161
154
  auth_names = opts[:auth_names] || ['oauth2']
162
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
155
+ data, status_code, headers = @authress_client.call_api(:GET, local_var_path,
163
156
  :header_params => header_params,
164
157
  :query_params => query_params,
165
158
  :form_params => form_params,
@@ -167,8 +160,8 @@ module SwaggerClient
167
160
  :auth_names => auth_names,
168
161
  :return_type => return_type)
169
162
 
170
- if @api_client.config.debugging
171
- @api_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}"
172
165
  end
173
166
  return data, status_code, headers
174
167
  end
@@ -188,11 +181,11 @@ module SwaggerClient
188
181
  # @param [Hash] opts the optional parameters
189
182
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
190
183
  def link_identity_with_http_info(body, opts = {})
191
- if @api_client.config.debugging
192
- @api_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 ...'
193
186
  end
194
187
  # verify the required parameter 'body' is set
195
- if @api_client.config.client_side_validation && body.nil?
188
+ if @authress_client.config.client_side_validation && body.nil?
196
189
  fail ArgumentError, "Missing the required parameter 'body' when calling AccountsApi.link_identity"
197
190
  end
198
191
  # resource path
@@ -204,18 +197,18 @@ module SwaggerClient
204
197
  # header parameters
205
198
  header_params = opts[:header_params] || {}
206
199
  # HTTP header 'Content-Type'
207
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
200
+ header_params['Content-Type'] = @authress_client.select_header_content_type(['application/json'])
208
201
 
209
202
  # form parameters
210
203
  form_params = opts[:form_params] || {}
211
204
 
212
205
  # http body (model)
213
- post_body = opts[:body] || @api_client.object_to_http_body(body)
206
+ post_body = opts[:body] || @authress_client.object_to_http_body(body)
214
207
 
215
208
  return_type = opts[:return_type]
216
209
 
217
210
  auth_names = opts[:auth_names] || ['oauth2']
218
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
211
+ data, status_code, headers = @authress_client.call_api(:POST, local_var_path,
219
212
  :header_params => header_params,
220
213
  :query_params => query_params,
221
214
  :form_params => form_params,
@@ -223,8 +216,8 @@ module SwaggerClient
223
216
  :auth_names => auth_names,
224
217
  :return_type => return_type)
225
218
 
226
- if @api_client.config.debugging
227
- @api_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}"
228
221
  end
229
222
  return data, status_code, headers
230
223
  end
@@ -1,20 +1,13 @@
1
1
  =begin
2
- #Authress
3
2
 
4
- #<p> <h2>Authorization</h2> <p>Authorization for Authress is handled one of two different ways. Both mechanisms use oauth2 <i>Bearer</i> tokens.</p> <br> <h4>Identity Provider JWT</h4> <p>Hook up your preferred identity provider directly to Authress. Authress will verify JWTs sourced from that identify provider and allow direct integration with these APIs. Any OIDC JWT provider works, Google, Auth0, Okta, etc... With this mechanism your web app can make direct calls to the permissions API on behalf of your users. <br> <a href=\"https://authress.io/app/#/manage?focus=identity\">Link identity provider</a> </p> <br> <h4>Authress Clients</h4> <p>Regardless of using direct identity provider integration, with the API you can create Authress clients which can call any of the methods on the API. Your users won't be able to directly make API calls, all web app integrations must go through a service which stores the Authress private key. <br> <a href=\"https://authress.io/app/#/manage?focus=clients\">Create Authress service client</a> </p> <br> <h2>Usage</h2> <h4>Billable APIs</h4> <p>Most of the api available is completely free. Use it to populate your roles and configure your account. You'll only be charged for the ones marked as Billable.</p> <p><ul> <li><i class=\"far fa-fw fa-money-bill-alt text-primary\"></i> <span class=\"text-primary\">Billable</span> - <small>These APIs count as calls for your account and will be charged.</small></li> <li><i class=\"fas fa-fw fa-angle-double-right text-secondary\"></i> <span class=\"text-secondary\">Free</span> - <small>These are totally free.</small></li> <li><i class=\"fas fa-fw fa-balance-scale text-secondary\"></i> <span class=\"text-secondary\">Condition</span> - <small>Are conditionally free, see api methods for details.</small></li> </ul></p> <br> <h4>API Access</h4> <p>Access to the following APIs is based on Authress permissions, not the application permissions assigned in Authress to the application services. Each resource is tagged with the required permission <span class=\"badge badge-outline-secondary\">Action: Resource</span> </p>
5
-
6
- OpenAPI spec version: v1
7
- Contact: support@authress.io
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 3.0.23
10
3
  =end
11
4
 
12
- module SwaggerClient
5
+ module AuthressSdk
13
6
  class MetadataApi
14
- attr_accessor :api_client
7
+ attr_accessor :authress_client
15
8
 
16
- def initialize(api_client = ApiClient.default)
17
- @api_client = api_client
9
+ def initialize(authress_client = AuthressClient.default)
10
+ @authress_client = authress_client
18
11
  end
19
12
  # Get the metadata for a resource.
20
13
  # <i class=\"far fa-money-bill-alt text-primary\"></i> <span class=\"text-primary\">Billable</span> Metadata is partitioned by the resource owner, and each can store independent data for a resource. This data is only accessible by identity provider tokens which specify the <strong>sub</strong> property and by service clients which have the <strong>grantMetadataAccess</strong> property. <br><span class=\"badge badge-outline-secondary\">READ: Authress:MetadataResources/{resourceUri}</span>
@@ -34,15 +27,15 @@ module SwaggerClient
34
27
  # @param [Hash] opts the optional parameters
35
28
  # @return [Array<(InlineResponse2001, Integer, Hash)>] InlineResponse2001 data, response status code and response headers
36
29
  def get_user_metadata_with_http_info(user_id, resource_uri, opts = {})
37
- if @api_client.config.debugging
38
- @api_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 ...'
39
32
  end
40
33
  # verify the required parameter 'user_id' is set
41
- if @api_client.config.client_side_validation && user_id.nil?
34
+ if @authress_client.config.client_side_validation && user_id.nil?
42
35
  fail ArgumentError, "Missing the required parameter 'user_id' when calling MetadataApi.get_user_metadata"
43
36
  end
44
37
  # verify the required parameter 'resource_uri' is set
45
- if @api_client.config.client_side_validation && resource_uri.nil?
38
+ if @authress_client.config.client_side_validation && resource_uri.nil?
46
39
  fail ArgumentError, "Missing the required parameter 'resource_uri' when calling MetadataApi.get_user_metadata"
47
40
  end
48
41
  # resource path
@@ -54,7 +47,7 @@ module SwaggerClient
54
47
  # header parameters
55
48
  header_params = opts[:header_params] || {}
56
49
  # HTTP header 'Accept' (if needed)
57
- header_params['Accept'] = @api_client.select_header_accept(['application/links+json'])
50
+ header_params['Accept'] = @authress_client.select_header_accept(['application/links+json'])
58
51
 
59
52
  # form parameters
60
53
  form_params = opts[:form_params] || {}
@@ -65,7 +58,7 @@ module SwaggerClient
65
58
  return_type = opts[:return_type] || 'InlineResponse2001'
66
59
 
67
60
  auth_names = opts[:auth_names] || ['oauth2']
68
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
61
+ data, status_code, headers = @authress_client.call_api(:GET, local_var_path,
69
62
  :header_params => header_params,
70
63
  :query_params => query_params,
71
64
  :form_params => form_params,
@@ -73,8 +66,8 @@ module SwaggerClient
73
66
  :auth_names => auth_names,
74
67
  :return_type => return_type)
75
68
 
76
- if @api_client.config.debugging
77
- @api_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}"
78
71
  end
79
72
  return data, status_code, headers
80
73
  end
@@ -98,19 +91,19 @@ module SwaggerClient
98
91
  # @param [Hash] opts the optional parameters
99
92
  # @return [Array<(InlineResponse2001, Integer, Hash)>] InlineResponse2001 data, response status code and response headers
100
93
  def update_user_metadata_with_http_info(body, user_id, resource_uri, opts = {})
101
- if @api_client.config.debugging
102
- @api_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 ...'
103
96
  end
104
97
  # verify the required parameter 'body' is set
105
- if @api_client.config.client_side_validation && body.nil?
98
+ if @authress_client.config.client_side_validation && body.nil?
106
99
  fail ArgumentError, "Missing the required parameter 'body' when calling MetadataApi.update_user_metadata"
107
100
  end
108
101
  # verify the required parameter 'user_id' is set
109
- if @api_client.config.client_side_validation && user_id.nil?
102
+ if @authress_client.config.client_side_validation && user_id.nil?
110
103
  fail ArgumentError, "Missing the required parameter 'user_id' when calling MetadataApi.update_user_metadata"
111
104
  end
112
105
  # verify the required parameter 'resource_uri' is set
113
- if @api_client.config.client_side_validation && resource_uri.nil?
106
+ if @authress_client.config.client_side_validation && resource_uri.nil?
114
107
  fail ArgumentError, "Missing the required parameter 'resource_uri' when calling MetadataApi.update_user_metadata"
115
108
  end
116
109
  # resource path
@@ -122,20 +115,20 @@ module SwaggerClient
122
115
  # header parameters
123
116
  header_params = opts[:header_params] || {}
124
117
  # HTTP header 'Accept' (if needed)
125
- header_params['Accept'] = @api_client.select_header_accept(['application/links+json'])
118
+ header_params['Accept'] = @authress_client.select_header_accept(['application/links+json'])
126
119
  # HTTP header 'Content-Type'
127
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
120
+ header_params['Content-Type'] = @authress_client.select_header_content_type(['application/json'])
128
121
 
129
122
  # form parameters
130
123
  form_params = opts[:form_params] || {}
131
124
 
132
125
  # http body (model)
133
- post_body = opts[:body] || @api_client.object_to_http_body(body)
126
+ post_body = opts[:body] || @authress_client.object_to_http_body(body)
134
127
 
135
128
  return_type = opts[:return_type] || 'InlineResponse2001'
136
129
 
137
130
  auth_names = opts[:auth_names] || ['oauth2']
138
- data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
131
+ data, status_code, headers = @authress_client.call_api(:PUT, local_var_path,
139
132
  :header_params => header_params,
140
133
  :query_params => query_params,
141
134
  :form_params => form_params,
@@ -143,8 +136,8 @@ module SwaggerClient
143
136
  :auth_names => auth_names,
144
137
  :return_type => return_type)
145
138
 
146
- if @api_client.config.debugging
147
- @api_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}"
148
141
  end
149
142
  return data, status_code, headers
150
143
  end
@@ -1,20 +1,13 @@
1
1
  =begin
2
- #Authress
3
2
 
4
- #<p> <h2>Authorization</h2> <p>Authorization for Authress is handled one of two different ways. Both mechanisms use oauth2 <i>Bearer</i> tokens.</p> <br> <h4>Identity Provider JWT</h4> <p>Hook up your preferred identity provider directly to Authress. Authress will verify JWTs sourced from that identify provider and allow direct integration with these APIs. Any OIDC JWT provider works, Google, Auth0, Okta, etc... With this mechanism your web app can make direct calls to the permissions API on behalf of your users. <br> <a href=\"https://authress.io/app/#/manage?focus=identity\">Link identity provider</a> </p> <br> <h4>Authress Clients</h4> <p>Regardless of using direct identity provider integration, with the API you can create Authress clients which can call any of the methods on the API. Your users won't be able to directly make API calls, all web app integrations must go through a service which stores the Authress private key. <br> <a href=\"https://authress.io/app/#/manage?focus=clients\">Create Authress service client</a> </p> <br> <h2>Usage</h2> <h4>Billable APIs</h4> <p>Most of the api available is completely free. Use it to populate your roles and configure your account. You'll only be charged for the ones marked as Billable.</p> <p><ul> <li><i class=\"far fa-fw fa-money-bill-alt text-primary\"></i> <span class=\"text-primary\">Billable</span> - <small>These APIs count as calls for your account and will be charged.</small></li> <li><i class=\"fas fa-fw fa-angle-double-right text-secondary\"></i> <span class=\"text-secondary\">Free</span> - <small>These are totally free.</small></li> <li><i class=\"fas fa-fw fa-balance-scale text-secondary\"></i> <span class=\"text-secondary\">Condition</span> - <small>Are conditionally free, see api methods for details.</small></li> </ul></p> <br> <h4>API Access</h4> <p>Access to the following APIs is based on Authress permissions, not the application permissions assigned in Authress to the application services. Each resource is tagged with the required permission <span class=\"badge badge-outline-secondary\">Action: Resource</span> </p>
5
-
6
- OpenAPI spec version: v1
7
- Contact: support@authress.io
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 3.0.23
10
3
  =end
11
4
 
12
- module SwaggerClient
5
+ module AuthressSdk
13
6
  class ResourcePermissionsApi
14
- attr_accessor :api_client
7
+ attr_accessor :authress_client
15
8
 
16
- def initialize(api_client = ApiClient.default)
17
- @api_client = api_client
9
+ def initialize(authress_client = AuthressClient.default)
10
+ @authress_client = authress_client
18
11
  end
19
12
  # Get a resource permissions object.
20
13
  # Permissions can be set globally at a resource level. This will apply to all users in an account. <br><span class=\"badge badge-outline-secondary\">GRANT *: Authress:ResourcePermissions/{resourceUri}</span>
@@ -32,11 +25,11 @@ module SwaggerClient
32
25
  # @param [Hash] opts the optional parameters
33
26
  # @return [Array<(InlineResponse2005, Integer, Hash)>] InlineResponse2005 data, response status code and response headers
34
27
  def get_resource_permissions_with_http_info(resource_uri, opts = {})
35
- if @api_client.config.debugging
36
- @api_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 ...'
37
30
  end
38
31
  # verify the required parameter 'resource_uri' is set
39
- if @api_client.config.client_side_validation && resource_uri.nil?
32
+ if @authress_client.config.client_side_validation && resource_uri.nil?
40
33
  fail ArgumentError, "Missing the required parameter 'resource_uri' when calling ResourcePermissionsApi.get_resource_permissions"
41
34
  end
42
35
  # resource path
@@ -48,7 +41,7 @@ module SwaggerClient
48
41
  # header parameters
49
42
  header_params = opts[:header_params] || {}
50
43
  # HTTP header 'Accept' (if needed)
51
- header_params['Accept'] = @api_client.select_header_accept(['application/links+json'])
44
+ header_params['Accept'] = @authress_client.select_header_accept(['application/links+json'])
52
45
 
53
46
  # form parameters
54
47
  form_params = opts[:form_params] || {}
@@ -59,7 +52,7 @@ module SwaggerClient
59
52
  return_type = opts[:return_type] || 'InlineResponse2005'
60
53
 
61
54
  auth_names = opts[:auth_names] || ['oauth2']
62
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
55
+ data, status_code, headers = @authress_client.call_api(:GET, local_var_path,
63
56
  :header_params => header_params,
64
57
  :query_params => query_params,
65
58
  :form_params => form_params,
@@ -67,8 +60,8 @@ module SwaggerClient
67
60
  :auth_names => auth_names,
68
61
  :return_type => return_type)
69
62
 
70
- if @api_client.config.debugging
71
- @api_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}"
72
65
  end
73
66
  return data, status_code, headers
74
67
  end
@@ -92,11 +85,11 @@ module SwaggerClient
92
85
  # @option opts [String] :cursor Continuation cursor for paging (will automatically be set)
93
86
  # @return [Array<(InlineResponse2006, Integer, Hash)>] InlineResponse2006 data, response status code and response headers
94
87
  def get_resource_users_with_http_info(resource_uri, opts = {})
95
- if @api_client.config.debugging
96
- @api_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 ...'
97
90
  end
98
91
  # verify the required parameter 'resource_uri' is set
99
- if @api_client.config.client_side_validation && resource_uri.nil?
92
+ if @authress_client.config.client_side_validation && resource_uri.nil?
100
93
  fail ArgumentError, "Missing the required parameter 'resource_uri' when calling ResourcePermissionsApi.get_resource_users"
101
94
  end
102
95
  # resource path
@@ -110,7 +103,7 @@ module SwaggerClient
110
103
  # header parameters
111
104
  header_params = opts[:header_params] || {}
112
105
  # HTTP header 'Accept' (if needed)
113
- header_params['Accept'] = @api_client.select_header_accept(['application/links+json'])
106
+ header_params['Accept'] = @authress_client.select_header_accept(['application/links+json'])
114
107
 
115
108
  # form parameters
116
109
  form_params = opts[:form_params] || {}
@@ -121,7 +114,7 @@ module SwaggerClient
121
114
  return_type = opts[:return_type] || 'InlineResponse2006'
122
115
 
123
116
  auth_names = opts[:auth_names] || ['oauth2']
124
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
117
+ data, status_code, headers = @authress_client.call_api(:GET, local_var_path,
125
118
  :header_params => header_params,
126
119
  :query_params => query_params,
127
120
  :form_params => form_params,
@@ -129,8 +122,8 @@ module SwaggerClient
129
122
  :auth_names => auth_names,
130
123
  :return_type => return_type)
131
124
 
132
- if @api_client.config.debugging
133
- @api_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}"
134
127
  end
135
128
  return data, status_code, headers
136
129
  end
@@ -148,8 +141,8 @@ module SwaggerClient
148
141
  # @param [Hash] opts the optional parameters
149
142
  # @return [Array<(InlineResponse2004, Integer, Hash)>] InlineResponse2004 data, response status code and response headers
150
143
  def get_resources_with_http_info(opts = {})
151
- if @api_client.config.debugging
152
- @api_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 ...'
153
146
  end
154
147
  # resource path
155
148
  local_var_path = '/v1/resources'
@@ -160,7 +153,7 @@ module SwaggerClient
160
153
  # header parameters
161
154
  header_params = opts[:header_params] || {}
162
155
  # HTTP header 'Accept' (if needed)
163
- header_params['Accept'] = @api_client.select_header_accept(['application/links+json'])
156
+ header_params['Accept'] = @authress_client.select_header_accept(['application/links+json'])
164
157
 
165
158
  # form parameters
166
159
  form_params = opts[:form_params] || {}
@@ -171,7 +164,7 @@ module SwaggerClient
171
164
  return_type = opts[:return_type] || 'InlineResponse2004'
172
165
 
173
166
  auth_names = opts[:auth_names] || ['oauth2']
174
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
167
+ data, status_code, headers = @authress_client.call_api(:GET, local_var_path,
175
168
  :header_params => header_params,
176
169
  :query_params => query_params,
177
170
  :form_params => form_params,
@@ -179,8 +172,8 @@ module SwaggerClient
179
172
  :auth_names => auth_names,
180
173
  :return_type => return_type)
181
174
 
182
- if @api_client.config.debugging
183
- @api_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}"
184
177
  end
185
178
  return data, status_code, headers
186
179
  end
@@ -202,15 +195,15 @@ module SwaggerClient
202
195
  # @param [Hash] opts the optional parameters
203
196
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
204
197
  def update_resource_permissions_with_http_info(body, resource_uri, opts = {})
205
- if @api_client.config.debugging
206
- @api_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 ...'
207
200
  end
208
201
  # verify the required parameter 'body' is set
209
- if @api_client.config.client_side_validation && body.nil?
202
+ if @authress_client.config.client_side_validation && body.nil?
210
203
  fail ArgumentError, "Missing the required parameter 'body' when calling ResourcePermissionsApi.update_resource_permissions"
211
204
  end
212
205
  # verify the required parameter 'resource_uri' is set
213
- if @api_client.config.client_side_validation && resource_uri.nil?
206
+ if @authress_client.config.client_side_validation && resource_uri.nil?
214
207
  fail ArgumentError, "Missing the required parameter 'resource_uri' when calling ResourcePermissionsApi.update_resource_permissions"
215
208
  end
216
209
  # resource path
@@ -222,18 +215,18 @@ module SwaggerClient
222
215
  # header parameters
223
216
  header_params = opts[:header_params] || {}
224
217
  # HTTP header 'Content-Type'
225
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
218
+ header_params['Content-Type'] = @authress_client.select_header_content_type(['application/json'])
226
219
 
227
220
  # form parameters
228
221
  form_params = opts[:form_params] || {}
229
222
 
230
223
  # http body (model)
231
- post_body = opts[:body] || @api_client.object_to_http_body(body)
224
+ post_body = opts[:body] || @authress_client.object_to_http_body(body)
232
225
 
233
226
  return_type = opts[:return_type]
234
227
 
235
228
  auth_names = opts[:auth_names] || ['oauth2']
236
- data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
229
+ data, status_code, headers = @authress_client.call_api(:PUT, local_var_path,
237
230
  :header_params => header_params,
238
231
  :query_params => query_params,
239
232
  :form_params => form_params,
@@ -241,8 +234,8 @@ module SwaggerClient
241
234
  :auth_names => auth_names,
242
235
  :return_type => return_type)
243
236
 
244
- if @api_client.config.debugging
245
- @api_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}"
246
239
  end
247
240
  return data, status_code, headers
248
241
  end