authress-sdk 0.1.20.0 → 2.0.29.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +39 -37
- data/lib/{swagger_client → authress_sdk}/api/access_records_api.rb +82 -89
- data/lib/{swagger_client → authress_sdk}/api/accounts_api.rb +31 -38
- data/lib/{swagger_client → authress_sdk}/api/metadata_api.rb +23 -30
- data/lib/{swagger_client → authress_sdk}/api/resource_permissions_api.rb +33 -40
- data/lib/{swagger_client → authress_sdk}/api/roles_api.rb +36 -43
- data/lib/{swagger_client → authress_sdk}/api/service_clients_api.rb +56 -63
- data/lib/{swagger_client → authress_sdk}/api/user_permissions_api.rb +44 -51
- data/lib/authress_sdk/api_error.rb +50 -0
- data/lib/{swagger_client/api_client.rb → authress_sdk/authress_client.rb} +36 -110
- data/lib/authress_sdk/constant_token_provider.rb +19 -0
- data/lib/{swagger_client → authress_sdk}/models/access_record.rb +17 -12
- data/lib/{swagger_client → authress_sdk}/models/access_record_collection.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/account.rb +4 -11
- data/lib/{swagger_client/models/inline_response_200_11.rb → authress_sdk/models/account_collection.rb} +5 -12
- data/lib/{swagger_client → authress_sdk}/models/account_collection_accounts.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/claim_request.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/claim_response.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/client.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/client_access_key.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/client_collection.rb +4 -11
- data/lib/{swagger_client/models/body_11.rb → authress_sdk/models/client_collection_clients.rb} +5 -12
- data/lib/{swagger_client → authress_sdk}/models/identity.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/identity_collection.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/identity_collection_identities.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/identity_request.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/inline_response_200.rb +4 -11
- data/lib/{swagger_client/models/body.rb → authress_sdk/models/inline_response_200_1.rb} +5 -12
- data/lib/{swagger_client/models/body_6.rb → authress_sdk/models/inline_response_200_10.rb} +5 -12
- data/lib/{swagger_client/models/account_collection.rb → authress_sdk/models/inline_response_200_11.rb} +5 -12
- data/lib/{swagger_client → authress_sdk}/models/inline_response_200_12.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/inline_response_200_13.rb +4 -11
- data/lib/{swagger_client/models/body_10.rb → authress_sdk/models/inline_response_200_14.rb} +5 -12
- data/lib/{swagger_client → authress_sdk}/models/inline_response_200_15.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/inline_response_200_2.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/inline_response_200_3.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/inline_response_200_4.rb +4 -11
- data/lib/{swagger_client/models/body_2.rb → authress_sdk/models/inline_response_200_5.rb} +5 -12
- data/lib/{swagger_client → authress_sdk}/models/inline_response_200_6.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/inline_response_200_7.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/inline_response_200_9.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/invite.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/link.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/metadata_object.rb +4 -11
- data/lib/{swagger_client/models/v1roles_permissions.rb → authress_sdk/models/permission_object.rb} +5 -12
- data/lib/{swagger_client → authress_sdk}/models/permission_response.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/resource_permission.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/resource_permission_collection.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/resource_permission_collection_links.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/resource_permission_collection_links_next.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/resource_permission_collection_resources.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/resource_users_collection.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/role.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/statement.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/token_request.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/user.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/user_resources.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/user_resources_resources.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/user_token.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/user_token_links.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/user_token_links_self.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/v1clients_options.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/v1records_account.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/v1records_links.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/v1records_links_self.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/v1records_users.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/v1resourcesresource_uri_permissions.rb +4 -11
- data/lib/{swagger_client/models/permission_object.rb → authress_sdk/models/v1roles_permissions.rb} +5 -12
- data/lib/{swagger_client → authress_sdk}/models/v1usersuser_idresourcesresource_urimetadata_account.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/v1usersuser_idtokens_resources.rb +4 -11
- data/lib/{swagger_client → authress_sdk}/models/v1usersuser_idtokens_statements.rb +4 -11
- data/lib/authress_sdk/service_client_token_provider.rb +19 -0
- data/lib/authress_sdk.rb +18 -0
- metadata +81 -108
- data/lib/swagger_client/api_error.rb +0 -57
- data/lib/swagger_client/configuration.rb +0 -205
- data/lib/swagger_client/models/access_record_collection_records.rb +0 -351
- data/lib/swagger_client/models/body_1.rb +0 -229
- data/lib/swagger_client/models/body_3.rb +0 -351
- data/lib/swagger_client/models/body_4.rb +0 -351
- data/lib/swagger_client/models/body_5.rb +0 -225
- data/lib/swagger_client/models/body_7.rb +0 -255
- data/lib/swagger_client/models/body_8.rb +0 -227
- data/lib/swagger_client/models/body_9.rb +0 -223
- data/lib/swagger_client/models/client_collection_clients.rb +0 -246
- data/lib/swagger_client/models/inline_response_200_1.rb +0 -236
- data/lib/swagger_client/models/inline_response_200_10.rb +0 -255
- data/lib/swagger_client/models/inline_response_200_14.rb +0 -246
- data/lib/swagger_client/models/inline_response_200_5.rb +0 -213
- data/lib/swagger_client/models/inline_response_200_8.rb +0 -351
- data/lib/swagger_client/version.rb +0 -14
- data/lib/swagger_client.rb +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3c95b25f7727e7f6b90209419704f659a8738dd52ebaad303401b444cf90e7f
|
4
|
+
data.tar.gz: 7d401c5035c2228c58963a05c594fe76246353b60cb07c30502c15b02f492d66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5800a573207985a6a2a27f9b51b7df07986e70c47f33b32d3f5851d12d91a8876e82ca3594e62cf1709d8147e39cd575dda1a93c43ffb47b9684ff6caa2135bf
|
7
|
+
data.tar.gz: b923b90bf8dead1f91fdc22f0f0b8f25fb022ba9e29ef01479073e15a44c64bcdf92534d4fa03f002d4b372cfce099b4589525925501fe5a6e0c2793b80c2638
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# Authress SDK for Ruby
|
2
2
|
This is the Authress SDK used to integrate with the authorization as a service provider Authress at https://authress.io.
|
3
3
|
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/authress-sdk.svg)](http://badge.fury.io/rb/authress-sdk)
|
@@ -12,86 +12,87 @@ gem install authress-sdk
|
|
12
12
|
|
13
13
|
Then required the package:
|
14
14
|
```rb
|
15
|
-
require 'authress-sdk'
|
15
|
+
require 'authress-sdk'
|
16
16
|
```
|
17
17
|
|
18
18
|
## Getting started examples
|
19
19
|
|
20
20
|
### Authorize using a user token
|
21
21
|
```rb
|
22
|
-
require 'authress-sdk'
|
22
|
+
require 'authress-sdk'
|
23
23
|
|
24
24
|
# create an instance of the API class during service initialization
|
25
|
-
# Replace
|
26
|
-
|
27
|
-
|
25
|
+
# Replace the base_url with the custom Authress domain for your account
|
26
|
+
# https://authress.io/app/#/settings?focus=domain
|
27
|
+
AuthressSdk.configure do |config|
|
28
|
+
config.base_url = 'https://login.company.com'
|
28
29
|
end
|
29
30
|
|
30
31
|
# on api route
|
31
32
|
[route('/resources/<resourceId>')]
|
32
|
-
|
33
|
+
def getResource(resourceId)
|
33
34
|
# Get the user token and pass it to authress
|
34
|
-
authorizationToken = request.headers.get('authorization')
|
35
|
-
AuthressClient.
|
35
|
+
authorizationToken = request.headers.get('authorization')
|
36
|
+
AuthressSdk::AuthressClient.set_token(authorizationToken)
|
36
37
|
|
37
38
|
# Check Authress to authorize the user
|
38
39
|
user_id = 'user_id_example' # String | The user to check permissions on
|
39
|
-
resource_uri =
|
40
|
+
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.
|
40
41
|
permission = 'READ' # String | Permission to check, '*' and scoped permissions can also be checked here.
|
41
42
|
begin
|
42
43
|
#Check to see if a user has permissions to a resource.
|
43
|
-
api_instance =
|
44
|
+
api_instance = AuthressSdk::UserPermissionsApi.new
|
44
45
|
api_instance.authorize_user(user_id, resource_uri, permission)
|
45
|
-
rescue
|
46
|
+
rescue AuthressSdk::ApiError => e
|
46
47
|
# Will throw except if the user is not authorized to read the resource
|
47
48
|
if (e.status === 404) {
|
48
|
-
return { statusCode: 404 }
|
49
|
+
return { statusCode: 404 }
|
49
50
|
}
|
50
51
|
puts "Exception when calling UserPermissionsApi->authorize_user: #{e}"
|
51
|
-
|
52
|
+
raise
|
52
53
|
end
|
53
54
|
|
54
55
|
# On success, continue with the route code to load resource and return it
|
55
|
-
return { resource: {}, statusCode: 200 }
|
56
|
+
return { resource: {}, statusCode: 200 }
|
56
57
|
```
|
57
58
|
|
58
59
|
### Authorize with a service client
|
59
60
|
```rb
|
60
|
-
require 'authress-sdk'
|
61
|
+
require 'authress-sdk'
|
61
62
|
|
62
63
|
# create an instance of the API class during service initialization
|
63
64
|
# Replace DOMAIN with the Authress domain for your account
|
64
65
|
|
65
66
|
# Create a service client in the Authress management portal and past the access token here
|
66
67
|
# This will generate a token automatically instead of passing the user token to the api
|
67
|
-
|
68
|
-
config.base_url = 'https://
|
69
|
-
|
70
|
-
config.token_provider = ServiceClientTokenProvider.new(
|
68
|
+
AuthressSdk.configure do |config|
|
69
|
+
config.base_url = 'https://login.company.com'
|
70
|
+
client_access_key = 'eyJrZXlJ....'
|
71
|
+
config.token_provider = AuthressSdk::ServiceClientTokenProvider.new(client_access_key)
|
71
72
|
end
|
72
73
|
|
73
74
|
# on api route
|
74
75
|
[route('/resources/<resourceId>')]
|
75
|
-
|
76
|
+
def getResource(resourceId) {
|
76
77
|
# Check Authress to authorize the user
|
77
78
|
user_id = 'user_id_example' # String | The user to check permissions on
|
78
|
-
resource_uri =
|
79
|
+
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.
|
79
80
|
permission = 'READ' # String | Permission to check, '*' and scoped permissions can also be checked here.
|
80
81
|
begin
|
81
|
-
#Check to see if a user has permissions to a resource.
|
82
|
-
api_instance =
|
82
|
+
# Check to see if a user has permissions to a resource.
|
83
|
+
api_instance = AuthressSdk::UserPermissionsApi.new
|
83
84
|
api_instance.authorize_user(user_id, resource_uri, permission)
|
84
|
-
rescue
|
85
|
-
# Will
|
85
|
+
rescue AuthressSdk::ApiError => e
|
86
|
+
# Will raise exception if the user is not authorized to read the resource
|
86
87
|
if (e.status === 404) {
|
87
|
-
return { statusCode: 404 }
|
88
|
+
return { statusCode: 404 }
|
88
89
|
}
|
89
90
|
puts "Exception when calling UserPermissionsApi->authorize_user: #{e}"
|
90
|
-
|
91
|
+
raise
|
91
92
|
end
|
92
93
|
|
93
94
|
# On success, continue with the route code to load resource and return it
|
94
|
-
return { resource: {}, statusCode: 200 }
|
95
|
+
return { resource: {}, statusCode: 200 }
|
95
96
|
```
|
96
97
|
|
97
98
|
### Creating resources
|
@@ -100,23 +101,24 @@ When a user creates a resource in your application, we want to ensure that they
|
|
100
101
|
You may receive **User does not have sufficient access to grant permissions to resources** as an error along with the status code **403**. This means that the service client or user jwt does not have access to create the access record. If using a service client, go to the Authress portal and create a one time record which grants the service client `Authress:Owner` to `Resources/` so that it can manage access records for these types of resources.
|
101
102
|
|
102
103
|
```rb
|
103
|
-
require 'authress-sdk'
|
104
|
+
require 'authress-sdk'
|
104
105
|
|
105
106
|
begin
|
106
|
-
#Create a new access record.
|
107
|
-
new_record =
|
108
|
-
name:
|
107
|
+
# Create a new access record.
|
108
|
+
new_record = AuthressSdk::AccessRecord.new {
|
109
|
+
name: "Access To New Resource #{NewResourceId}",
|
109
110
|
users: [{ userId: requestUserId }],
|
110
111
|
statements: [{
|
111
|
-
resources: [{ resourceUri:
|
112
|
+
resources: [{ resourceUri: "Resources/#{NewResourceId}" }],
|
112
113
|
# Owner by default gives full control over this new resource, including the ability to grant others access as well.
|
113
114
|
roles: ['Authress:Owner']
|
114
115
|
}]
|
115
|
-
}
|
116
|
-
api_instance =
|
116
|
+
}
|
117
|
+
api_instance = AuthressSdk::AccessRecordsApi.new
|
117
118
|
result = api_instance.create_record(new_record)
|
118
119
|
puts result
|
119
|
-
rescue
|
120
|
+
rescue AuthressSdk::ApiError => e
|
120
121
|
puts "Exception when calling AccessRecordsApi->create_record: #{e}"
|
122
|
+
raise
|
121
123
|
end
|
122
124
|
```
|
@@ -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
|
5
|
+
module AuthressSdk
|
13
6
|
class AccessRecordsApi
|
14
|
-
attr_accessor :
|
7
|
+
attr_accessor :authress_client
|
15
8
|
|
16
|
-
def initialize(
|
17
|
-
@
|
9
|
+
def initialize(authress_client = AuthressClient.default)
|
10
|
+
@authress_client = authress_client
|
18
11
|
end
|
19
12
|
# Claim a resource by an allowed user.
|
20
13
|
# Claim a resource by allowing a user to pick an identifier and receive admin access to that resource if it hasn't already been claimed. This only works for resources specifically marked as <strong>CLAIM</strong>. The result will be a new access record listing that user as the admin for this resource. The resourceUri will be appended to the collection resource uri using a '/' (forward slash) automatically. <br><span class=\"badge badge-outline-secondary\">RESOURCE CLAIM: {resourceUri}</span> or <span class=\"badge badge-outline-secondary\">DELEGATE *: {resourceUri}</span>
|
@@ -32,11 +25,11 @@ module SwaggerClient
|
|
32
25
|
# @param [Hash] opts the optional parameters
|
33
26
|
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
34
27
|
def create_claim_with_http_info(body, opts = {})
|
35
|
-
if @
|
36
|
-
@
|
28
|
+
if @authress_client.config.debugging
|
29
|
+
@authress_client.config.logger.debug 'Calling API: AccessRecordsApi.create_claim ...'
|
37
30
|
end
|
38
31
|
# verify the required parameter 'body' is set
|
39
|
-
if @
|
32
|
+
if @authress_client.config.client_side_validation && body.nil?
|
40
33
|
fail ArgumentError, "Missing the required parameter 'body' when calling AccessRecordsApi.create_claim"
|
41
34
|
end
|
42
35
|
# resource path
|
@@ -48,20 +41,20 @@ module SwaggerClient
|
|
48
41
|
# header parameters
|
49
42
|
header_params = opts[:header_params] || {}
|
50
43
|
# HTTP header 'Accept' (if needed)
|
51
|
-
header_params['Accept'] = @
|
44
|
+
header_params['Accept'] = @authress_client.select_header_accept(['application/links+json'])
|
52
45
|
# HTTP header 'Content-Type'
|
53
|
-
header_params['Content-Type'] = @
|
46
|
+
header_params['Content-Type'] = @authress_client.select_header_content_type(['application/json'])
|
54
47
|
|
55
48
|
# form parameters
|
56
49
|
form_params = opts[:form_params] || {}
|
57
50
|
|
58
51
|
# http body (model)
|
59
|
-
post_body = opts[:body] || @
|
52
|
+
post_body = opts[:body] || @authress_client.object_to_http_body(body)
|
60
53
|
|
61
54
|
return_type = opts[:return_type] || 'Object'
|
62
55
|
|
63
56
|
auth_names = opts[:auth_names] || ['oauth2']
|
64
|
-
data, status_code, headers = @
|
57
|
+
data, status_code, headers = @authress_client.call_api(:POST, local_var_path,
|
65
58
|
:header_params => header_params,
|
66
59
|
:query_params => query_params,
|
67
60
|
:form_params => form_params,
|
@@ -69,8 +62,8 @@ module SwaggerClient
|
|
69
62
|
:auth_names => auth_names,
|
70
63
|
:return_type => return_type)
|
71
64
|
|
72
|
-
if @
|
73
|
-
@
|
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}"
|
74
67
|
end
|
75
68
|
return data, status_code, headers
|
76
69
|
end
|
@@ -90,11 +83,11 @@ module SwaggerClient
|
|
90
83
|
# @param [Hash] opts the optional parameters
|
91
84
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
92
85
|
def create_invite_with_http_info(body, opts = {})
|
93
|
-
if @
|
94
|
-
@
|
86
|
+
if @authress_client.config.debugging
|
87
|
+
@authress_client.config.logger.debug 'Calling API: AccessRecordsApi.create_invite ...'
|
95
88
|
end
|
96
89
|
# verify the required parameter 'body' is set
|
97
|
-
if @
|
90
|
+
if @authress_client.config.client_side_validation && body.nil?
|
98
91
|
fail ArgumentError, "Missing the required parameter 'body' when calling AccessRecordsApi.create_invite"
|
99
92
|
end
|
100
93
|
# resource path
|
@@ -106,18 +99,18 @@ module SwaggerClient
|
|
106
99
|
# header parameters
|
107
100
|
header_params = opts[:header_params] || {}
|
108
101
|
# HTTP header 'Content-Type'
|
109
|
-
header_params['Content-Type'] = @
|
102
|
+
header_params['Content-Type'] = @authress_client.select_header_content_type(['application/json'])
|
110
103
|
|
111
104
|
# form parameters
|
112
105
|
form_params = opts[:form_params] || {}
|
113
106
|
|
114
107
|
# http body (model)
|
115
|
-
post_body = opts[:body] || @
|
108
|
+
post_body = opts[:body] || @authress_client.object_to_http_body(body)
|
116
109
|
|
117
110
|
return_type = opts[:return_type]
|
118
111
|
|
119
112
|
auth_names = opts[:auth_names] || ['oauth2']
|
120
|
-
data, status_code, headers = @
|
113
|
+
data, status_code, headers = @authress_client.call_api(:POST, local_var_path,
|
121
114
|
:header_params => header_params,
|
122
115
|
:query_params => query_params,
|
123
116
|
:form_params => form_params,
|
@@ -125,8 +118,8 @@ module SwaggerClient
|
|
125
118
|
:auth_names => auth_names,
|
126
119
|
:return_type => return_type)
|
127
120
|
|
128
|
-
if @
|
129
|
-
@
|
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}"
|
130
123
|
end
|
131
124
|
return data, status_code, headers
|
132
125
|
end
|
@@ -134,7 +127,7 @@ module SwaggerClient
|
|
134
127
|
# Specify user roles for specific resources. (Records have a maximum size of ~100KB) <br><span class=\"badge badge-outline-secondary\">GRANT: Existing Resource Permissions</span>
|
135
128
|
# @param body
|
136
129
|
# @param [Hash] opts the optional parameters
|
137
|
-
# @return [
|
130
|
+
# @return [AccessRecord]
|
138
131
|
def create_record(body, opts = {})
|
139
132
|
data, _status_code, _headers = create_record_with_http_info(body, opts)
|
140
133
|
data
|
@@ -144,13 +137,13 @@ module SwaggerClient
|
|
144
137
|
# Specify user roles for specific resources. (Records have a maximum size of ~100KB) <br><span class=\"badge badge-outline-secondary\">GRANT: Existing Resource Permissions</span>
|
145
138
|
# @param body
|
146
139
|
# @param [Hash] opts the optional parameters
|
147
|
-
# @return [Array<(
|
140
|
+
# @return [Array<(AccessRecord, Integer, Hash)>] AccessRecord data, response status code and response headers
|
148
141
|
def create_record_with_http_info(body, opts = {})
|
149
|
-
if @
|
150
|
-
@
|
142
|
+
if @authress_client.config.debugging
|
143
|
+
@authress_client.config.logger.debug 'Calling API: AccessRecordsApi.create_record ...'
|
151
144
|
end
|
152
145
|
# verify the required parameter 'body' is set
|
153
|
-
if @
|
146
|
+
if @authress_client.config.client_side_validation && body.nil?
|
154
147
|
fail ArgumentError, "Missing the required parameter 'body' when calling AccessRecordsApi.create_record"
|
155
148
|
end
|
156
149
|
# resource path
|
@@ -162,20 +155,20 @@ module SwaggerClient
|
|
162
155
|
# header parameters
|
163
156
|
header_params = opts[:header_params] || {}
|
164
157
|
# HTTP header 'Accept' (if needed)
|
165
|
-
header_params['Accept'] = @
|
158
|
+
header_params['Accept'] = @authress_client.select_header_accept(['application/links+json'])
|
166
159
|
# HTTP header 'Content-Type'
|
167
|
-
header_params['Content-Type'] = @
|
160
|
+
header_params['Content-Type'] = @authress_client.select_header_content_type(['application/json'])
|
168
161
|
|
169
162
|
# form parameters
|
170
163
|
form_params = opts[:form_params] || {}
|
171
164
|
|
172
165
|
# http body (model)
|
173
|
-
post_body = opts[:body] || @
|
166
|
+
post_body = opts[:body] || @authress_client.object_to_http_body(body)
|
174
167
|
|
175
|
-
return_type = opts[:return_type] || '
|
168
|
+
return_type = opts[:return_type] || 'AccessRecord'
|
176
169
|
|
177
170
|
auth_names = opts[:auth_names] || ['oauth2']
|
178
|
-
data, status_code, headers = @
|
171
|
+
data, status_code, headers = @authress_client.call_api(:POST, local_var_path,
|
179
172
|
:header_params => header_params,
|
180
173
|
:query_params => query_params,
|
181
174
|
:form_params => form_params,
|
@@ -183,8 +176,8 @@ module SwaggerClient
|
|
183
176
|
:auth_names => auth_names,
|
184
177
|
:return_type => return_type)
|
185
178
|
|
186
|
-
if @
|
187
|
-
@
|
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}"
|
188
181
|
end
|
189
182
|
return data, status_code, headers
|
190
183
|
end
|
@@ -204,11 +197,11 @@ module SwaggerClient
|
|
204
197
|
# @param [Hash] opts the optional parameters
|
205
198
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
206
199
|
def delete_invite_with_http_info(invite_id, opts = {})
|
207
|
-
if @
|
208
|
-
@
|
200
|
+
if @authress_client.config.debugging
|
201
|
+
@authress_client.config.logger.debug 'Calling API: AccessRecordsApi.delete_invite ...'
|
209
202
|
end
|
210
203
|
# verify the required parameter 'invite_id' is set
|
211
|
-
if @
|
204
|
+
if @authress_client.config.client_side_validation && invite_id.nil?
|
212
205
|
fail ArgumentError, "Missing the required parameter 'invite_id' when calling AccessRecordsApi.delete_invite"
|
213
206
|
end
|
214
207
|
# resource path
|
@@ -229,7 +222,7 @@ module SwaggerClient
|
|
229
222
|
return_type = opts[:return_type]
|
230
223
|
|
231
224
|
auth_names = opts[:auth_names] || ['oauth2']
|
232
|
-
data, status_code, headers = @
|
225
|
+
data, status_code, headers = @authress_client.call_api(:DELETE, local_var_path,
|
233
226
|
:header_params => header_params,
|
234
227
|
:query_params => query_params,
|
235
228
|
:form_params => form_params,
|
@@ -237,8 +230,8 @@ module SwaggerClient
|
|
237
230
|
:auth_names => auth_names,
|
238
231
|
:return_type => return_type)
|
239
232
|
|
240
|
-
if @
|
241
|
-
@
|
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}"
|
242
235
|
end
|
243
236
|
return data, status_code, headers
|
244
237
|
end
|
@@ -258,11 +251,11 @@ module SwaggerClient
|
|
258
251
|
# @param [Hash] opts the optional parameters
|
259
252
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
260
253
|
def delete_record_with_http_info(record_id, opts = {})
|
261
|
-
if @
|
262
|
-
@
|
254
|
+
if @authress_client.config.debugging
|
255
|
+
@authress_client.config.logger.debug 'Calling API: AccessRecordsApi.delete_record ...'
|
263
256
|
end
|
264
257
|
# verify the required parameter 'record_id' is set
|
265
|
-
if @
|
258
|
+
if @authress_client.config.client_side_validation && record_id.nil?
|
266
259
|
fail ArgumentError, "Missing the required parameter 'record_id' when calling AccessRecordsApi.delete_record"
|
267
260
|
end
|
268
261
|
# resource path
|
@@ -283,7 +276,7 @@ module SwaggerClient
|
|
283
276
|
return_type = opts[:return_type]
|
284
277
|
|
285
278
|
auth_names = opts[:auth_names] || ['oauth2']
|
286
|
-
data, status_code, headers = @
|
279
|
+
data, status_code, headers = @authress_client.call_api(:DELETE, local_var_path,
|
287
280
|
:header_params => header_params,
|
288
281
|
:query_params => query_params,
|
289
282
|
:form_params => form_params,
|
@@ -291,8 +284,8 @@ module SwaggerClient
|
|
291
284
|
:auth_names => auth_names,
|
292
285
|
:return_type => return_type)
|
293
286
|
|
294
|
-
if @
|
295
|
-
@
|
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}"
|
296
289
|
end
|
297
290
|
return data, status_code, headers
|
298
291
|
end
|
@@ -300,7 +293,7 @@ module SwaggerClient
|
|
300
293
|
# Access records contain information assigning permissions to users for resources. <br><span class=\"badge badge-outline-secondary\">READ (or Admin): Authress:AccessRecords/{recordId}</span>
|
301
294
|
# @param record_id The identifier of the access record.
|
302
295
|
# @param [Hash] opts the optional parameters
|
303
|
-
# @return [
|
296
|
+
# @return [AccessRecord]
|
304
297
|
def get_record(record_id, opts = {})
|
305
298
|
data, _status_code, _headers = get_record_with_http_info(record_id, opts)
|
306
299
|
data
|
@@ -310,13 +303,13 @@ module SwaggerClient
|
|
310
303
|
# Access records contain information assigning permissions to users for resources. <br><span class=\"badge badge-outline-secondary\">READ (or Admin): Authress:AccessRecords/{recordId}</span>
|
311
304
|
# @param record_id The identifier of the access record.
|
312
305
|
# @param [Hash] opts the optional parameters
|
313
|
-
# @return [Array<(
|
306
|
+
# @return [Array<(AccessRecord, Integer, Hash)>] AccessRecord data, response status code and response headers
|
314
307
|
def get_record_with_http_info(record_id, opts = {})
|
315
|
-
if @
|
316
|
-
@
|
308
|
+
if @authress_client.config.debugging
|
309
|
+
@authress_client.config.logger.debug 'Calling API: AccessRecordsApi.get_record ...'
|
317
310
|
end
|
318
311
|
# verify the required parameter 'record_id' is set
|
319
|
-
if @
|
312
|
+
if @authress_client.config.client_side_validation && record_id.nil?
|
320
313
|
fail ArgumentError, "Missing the required parameter 'record_id' when calling AccessRecordsApi.get_record"
|
321
314
|
end
|
322
315
|
# resource path
|
@@ -328,7 +321,7 @@ module SwaggerClient
|
|
328
321
|
# header parameters
|
329
322
|
header_params = opts[:header_params] || {}
|
330
323
|
# HTTP header 'Accept' (if needed)
|
331
|
-
header_params['Accept'] = @
|
324
|
+
header_params['Accept'] = @authress_client.select_header_accept(['application/links+json'])
|
332
325
|
|
333
326
|
# form parameters
|
334
327
|
form_params = opts[:form_params] || {}
|
@@ -336,10 +329,10 @@ module SwaggerClient
|
|
336
329
|
# http body (model)
|
337
330
|
post_body = opts[:body]
|
338
331
|
|
339
|
-
return_type = opts[:return_type] || '
|
332
|
+
return_type = opts[:return_type] || 'AccessRecord'
|
340
333
|
|
341
334
|
auth_names = opts[:auth_names] || ['oauth2']
|
342
|
-
data, status_code, headers = @
|
335
|
+
data, status_code, headers = @authress_client.call_api(:GET, local_var_path,
|
343
336
|
:header_params => header_params,
|
344
337
|
:query_params => query_params,
|
345
338
|
:form_params => form_params,
|
@@ -347,8 +340,8 @@ module SwaggerClient
|
|
347
340
|
:auth_names => auth_names,
|
348
341
|
:return_type => return_type)
|
349
342
|
|
350
|
-
if @
|
351
|
-
@
|
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}"
|
352
345
|
end
|
353
346
|
return data, status_code, headers
|
354
347
|
end
|
@@ -374,10 +367,10 @@ module SwaggerClient
|
|
374
367
|
# @option opts [String] :status Filter records by their current status.
|
375
368
|
# @return [Array<(InlineResponse2007, Integer, Hash)>] InlineResponse2007 data, response status code and response headers
|
376
369
|
def get_records_with_http_info(opts = {})
|
377
|
-
if @
|
378
|
-
@
|
370
|
+
if @authress_client.config.debugging
|
371
|
+
@authress_client.config.logger.debug 'Calling API: AccessRecordsApi.get_records ...'
|
379
372
|
end
|
380
|
-
if @
|
373
|
+
if @authress_client.config.client_side_validation && opts[:'status'] && !['ACTIVE', 'DELETED'].include?(opts[:'status'])
|
381
374
|
fail ArgumentError, 'invalid value for "status", must be one of ACTIVE, DELETED'
|
382
375
|
end
|
383
376
|
# resource path
|
@@ -393,7 +386,7 @@ module SwaggerClient
|
|
393
386
|
# header parameters
|
394
387
|
header_params = opts[:header_params] || {}
|
395
388
|
# HTTP header 'Accept' (if needed)
|
396
|
-
header_params['Accept'] = @
|
389
|
+
header_params['Accept'] = @authress_client.select_header_accept(['application/links+json'])
|
397
390
|
|
398
391
|
# form parameters
|
399
392
|
form_params = opts[:form_params] || {}
|
@@ -404,7 +397,7 @@ module SwaggerClient
|
|
404
397
|
return_type = opts[:return_type] || 'InlineResponse2007'
|
405
398
|
|
406
399
|
auth_names = opts[:auth_names] || ['oauth2']
|
407
|
-
data, status_code, headers = @
|
400
|
+
data, status_code, headers = @authress_client.call_api(:GET, local_var_path,
|
408
401
|
:header_params => header_params,
|
409
402
|
:query_params => query_params,
|
410
403
|
:form_params => form_params,
|
@@ -412,8 +405,8 @@ module SwaggerClient
|
|
412
405
|
:auth_names => auth_names,
|
413
406
|
:return_type => return_type)
|
414
407
|
|
415
|
-
if @
|
416
|
-
@
|
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}"
|
417
410
|
end
|
418
411
|
return data, status_code, headers
|
419
412
|
end
|
@@ -433,11 +426,11 @@ module SwaggerClient
|
|
433
426
|
# @param [Hash] opts the optional parameters
|
434
427
|
# @return [Array<(InlineResponse2009, Integer, Hash)>] InlineResponse2009 data, response status code and response headers
|
435
428
|
def respond_to_invite_with_http_info(invite_id, opts = {})
|
436
|
-
if @
|
437
|
-
@
|
429
|
+
if @authress_client.config.debugging
|
430
|
+
@authress_client.config.logger.debug 'Calling API: AccessRecordsApi.respond_to_invite ...'
|
438
431
|
end
|
439
432
|
# verify the required parameter 'invite_id' is set
|
440
|
-
if @
|
433
|
+
if @authress_client.config.client_side_validation && invite_id.nil?
|
441
434
|
fail ArgumentError, "Missing the required parameter 'invite_id' when calling AccessRecordsApi.respond_to_invite"
|
442
435
|
end
|
443
436
|
# resource path
|
@@ -449,7 +442,7 @@ module SwaggerClient
|
|
449
442
|
# header parameters
|
450
443
|
header_params = opts[:header_params] || {}
|
451
444
|
# HTTP header 'Accept' (if needed)
|
452
|
-
header_params['Accept'] = @
|
445
|
+
header_params['Accept'] = @authress_client.select_header_accept(['application/links+json'])
|
453
446
|
|
454
447
|
# form parameters
|
455
448
|
form_params = opts[:form_params] || {}
|
@@ -460,7 +453,7 @@ module SwaggerClient
|
|
460
453
|
return_type = opts[:return_type] || 'InlineResponse2009'
|
461
454
|
|
462
455
|
auth_names = opts[:auth_names] || ['oauth2']
|
463
|
-
data, status_code, headers = @
|
456
|
+
data, status_code, headers = @authress_client.call_api(:PATCH, local_var_path,
|
464
457
|
:header_params => header_params,
|
465
458
|
:query_params => query_params,
|
466
459
|
:form_params => form_params,
|
@@ -468,8 +461,8 @@ module SwaggerClient
|
|
468
461
|
:auth_names => auth_names,
|
469
462
|
:return_type => return_type)
|
470
463
|
|
471
|
-
if @
|
472
|
-
@
|
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}"
|
473
466
|
end
|
474
467
|
return data, status_code, headers
|
475
468
|
end
|
@@ -478,7 +471,7 @@ module SwaggerClient
|
|
478
471
|
# @param body
|
479
472
|
# @param record_id The identifier of the access record.
|
480
473
|
# @param [Hash] opts the optional parameters
|
481
|
-
# @return [
|
474
|
+
# @return [AccessRecord]
|
482
475
|
def update_record(body, record_id, opts = {})
|
483
476
|
data, _status_code, _headers = update_record_with_http_info(body, record_id, opts)
|
484
477
|
data
|
@@ -489,17 +482,17 @@ module SwaggerClient
|
|
489
482
|
# @param body
|
490
483
|
# @param record_id The identifier of the access record.
|
491
484
|
# @param [Hash] opts the optional parameters
|
492
|
-
# @return [Array<(
|
485
|
+
# @return [Array<(AccessRecord, Integer, Hash)>] AccessRecord data, response status code and response headers
|
493
486
|
def update_record_with_http_info(body, record_id, opts = {})
|
494
|
-
if @
|
495
|
-
@
|
487
|
+
if @authress_client.config.debugging
|
488
|
+
@authress_client.config.logger.debug 'Calling API: AccessRecordsApi.update_record ...'
|
496
489
|
end
|
497
490
|
# verify the required parameter 'body' is set
|
498
|
-
if @
|
491
|
+
if @authress_client.config.client_side_validation && body.nil?
|
499
492
|
fail ArgumentError, "Missing the required parameter 'body' when calling AccessRecordsApi.update_record"
|
500
493
|
end
|
501
494
|
# verify the required parameter 'record_id' is set
|
502
|
-
if @
|
495
|
+
if @authress_client.config.client_side_validation && record_id.nil?
|
503
496
|
fail ArgumentError, "Missing the required parameter 'record_id' when calling AccessRecordsApi.update_record"
|
504
497
|
end
|
505
498
|
# resource path
|
@@ -511,20 +504,20 @@ module SwaggerClient
|
|
511
504
|
# header parameters
|
512
505
|
header_params = opts[:header_params] || {}
|
513
506
|
# HTTP header 'Accept' (if needed)
|
514
|
-
header_params['Accept'] = @
|
507
|
+
header_params['Accept'] = @authress_client.select_header_accept(['application/links+json'])
|
515
508
|
# HTTP header 'Content-Type'
|
516
|
-
header_params['Content-Type'] = @
|
509
|
+
header_params['Content-Type'] = @authress_client.select_header_content_type(['application/json'])
|
517
510
|
|
518
511
|
# form parameters
|
519
512
|
form_params = opts[:form_params] || {}
|
520
513
|
|
521
514
|
# http body (model)
|
522
|
-
post_body = opts[:body] || @
|
515
|
+
post_body = opts[:body] || @authress_client.object_to_http_body(body)
|
523
516
|
|
524
|
-
return_type = opts[:return_type] || '
|
517
|
+
return_type = opts[:return_type] || 'AccessRecord'
|
525
518
|
|
526
519
|
auth_names = opts[:auth_names] || ['oauth2']
|
527
|
-
data, status_code, headers = @
|
520
|
+
data, status_code, headers = @authress_client.call_api(:PUT, local_var_path,
|
528
521
|
:header_params => header_params,
|
529
522
|
:query_params => query_params,
|
530
523
|
:form_params => form_params,
|
@@ -532,8 +525,8 @@ module SwaggerClient
|
|
532
525
|
:auth_names => auth_names,
|
533
526
|
:return_type => return_type)
|
534
527
|
|
535
|
-
if @
|
536
|
-
@
|
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}"
|
537
530
|
end
|
538
531
|
return data, status_code, headers
|
539
532
|
end
|