permit-sdk 0.0.1
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.
- checksums.yaml +7 -0
- data/lib/api/api.rb +25 -0
- data/lib/api/base.rb +26 -0
- data/lib/api/resources.rb +13 -0
- data/lib/api/tenants.rb +11 -0
- data/lib/api/users.rb +50 -0
- data/lib/api/utils.rb +9 -0
- data/lib/config.rb +23 -0
- data/lib/main.rb +49 -0
- data/lib/openapi_client/api/api_keys_api.rb +413 -0
- data/lib/openapi_client/api/audit_elements_data_api.rb +118 -0
- data/lib/openapi_client/api/audit_logs_api.rb +204 -0
- data/lib/openapi_client/api/authentication_api.rb +512 -0
- data/lib/openapi_client/api/condition_set_rules_api.rb +278 -0
- data/lib/openapi_client/api/condition_sets_api.rb +428 -0
- data/lib/openapi_client/api/decision_logs_api.rb +128 -0
- data/lib/openapi_client/api/decision_logs_ingress_api.rb +90 -0
- data/lib/openapi_client/api/default_api.rb +297 -0
- data/lib/openapi_client/api/elements_configs_api.rb +657 -0
- data/lib/openapi_client/api/environments_api.rb +462 -0
- data/lib/openapi_client/api/instructions_api.rb +91 -0
- data/lib/openapi_client/api/members_api.rb +354 -0
- data/lib/openapi_client/api/opal_data_api.rb +343 -0
- data/lib/openapi_client/api/organizations_api.rb +652 -0
- data/lib/openapi_client/api/policy_api.rb +138 -0
- data/lib/openapi_client/api/policy_decision_points_api.rb +382 -0
- data/lib/openapi_client/api/policy_git_repositories_api.rb +510 -0
- data/lib/openapi_client/api/projects_api.rb +365 -0
- data/lib/openapi_client/api/resource_actions_api.rb +455 -0
- data/lib/openapi_client/api/resource_attributes_api.rb +473 -0
- data/lib/openapi_client/api/resource_instances_api.rb +425 -0
- data/lib/openapi_client/api/resource_roles_api.rb +813 -0
- data/lib/openapi_client/api/resources_api.rb +514 -0
- data/lib/openapi_client/api/role_assignments_api.rb +278 -0
- data/lib/openapi_client/api/roles_api.rb +759 -0
- data/lib/openapi_client/api/tenants_api.rb +603 -0
- data/lib/openapi_client/api/user_attributes_api.rb +458 -0
- data/lib/openapi_client/api/users_api.rb +684 -0
- data/lib/openapi_client/api/users_elements_data_api.rb +638 -0
- data/lib/openapi_client/api_client.rb +392 -0
- data/lib/openapi_client/api_error.rb +57 -0
- data/lib/openapi_client/configuration.rb +280 -0
- data/lib/openapi_client/models/action_block_editable.rb +230 -0
- data/lib/openapi_client/models/action_block_read.rb +255 -0
- data/lib/openapi_client/models/action_object.rb +275 -0
- data/lib/openapi_client/models/actor.rb +57 -0
- data/lib/openapi_client/models/add_role_permissions.rb +227 -0
- data/lib/openapi_client/models/api_key_create.rb +269 -0
- data/lib/openapi_client/models/api_key_owner_type.rb +41 -0
- data/lib/openapi_client/models/api_key_read.rb +329 -0
- data/lib/openapi_client/models/api_key_scope_read.rb +245 -0
- data/lib/openapi_client/models/attribute_block_editable.rb +235 -0
- data/lib/openapi_client/models/attribute_block_read.rb +260 -0
- data/lib/openapi_client/models/attribute_type.rb +44 -0
- data/lib/openapi_client/models/attributes.rb +231 -0
- data/lib/openapi_client/models/audit_log.rb +415 -0
- data/lib/openapi_client/models/audit_log_objects.rb +282 -0
- data/lib/openapi_client/models/authn_me_api_key_read.rb +329 -0
- data/lib/openapi_client/models/authn_me_member_read.rb +352 -0
- data/lib/openapi_client/models/authn_me_read.rb +224 -0
- data/lib/openapi_client/models/authn_me_user_read.rb +440 -0
- data/lib/openapi_client/models/condition_set_create.rb +340 -0
- data/lib/openapi_client/models/condition_set_read.rb +409 -0
- data/lib/openapi_client/models/condition_set_rule_create.rb +279 -0
- data/lib/openapi_client/models/condition_set_rule_read.rb +360 -0
- data/lib/openapi_client/models/condition_set_rule_remove.rb +279 -0
- data/lib/openapi_client/models/condition_set_type.rb +40 -0
- data/lib/openapi_client/models/condition_set_update.rb +255 -0
- data/lib/openapi_client/models/data_source_config.rb +228 -0
- data/lib/openapi_client/models/data_source_entry.rb +272 -0
- data/lib/openapi_client/models/detailed_audit_log.rb +443 -0
- data/lib/openapi_client/models/dev_login.rb +225 -0
- data/lib/openapi_client/models/dummy_engine_model.rb +229 -0
- data/lib/openapi_client/models/elements_config_create.rb +319 -0
- data/lib/openapi_client/models/elements_config_read.rb +402 -0
- data/lib/openapi_client/models/elements_config_runtime_read.rb +238 -0
- data/lib/openapi_client/models/elements_config_update.rb +268 -0
- data/lib/openapi_client/models/elements_env_type_read.rb +242 -0
- data/lib/openapi_client/models/elements_env_type_update.rb +222 -0
- data/lib/openapi_client/models/elements_permission_level.rb +44 -0
- data/lib/openapi_client/models/elements_role_read.rb +378 -0
- data/lib/openapi_client/models/elements_type.rb +41 -0
- data/lib/openapi_client/models/elements_user_create.rb +295 -0
- data/lib/openapi_client/models/elements_user_role_create.rb +225 -0
- data/lib/openapi_client/models/elements_user_role_remove.rb +225 -0
- data/lib/openapi_client/models/embedded_login_request_output.rb +265 -0
- data/lib/openapi_client/models/engine.rb +39 -0
- data/lib/openapi_client/models/environment_create.rb +281 -0
- data/lib/openapi_client/models/environment_object.rb +295 -0
- data/lib/openapi_client/models/environment_read.rb +335 -0
- data/lib/openapi_client/models/environment_stats.rb +365 -0
- data/lib/openapi_client/models/environment_update.rb +240 -0
- data/lib/openapi_client/models/failed_invite.rb +238 -0
- data/lib/openapi_client/models/full_data.rb +258 -0
- data/lib/openapi_client/models/http_validation_error.rb +221 -0
- data/lib/openapi_client/models/identity_read.rb +300 -0
- data/lib/openapi_client/models/invite_attempt_result.rb +232 -0
- data/lib/openapi_client/models/invite_create.rb +240 -0
- data/lib/openapi_client/models/invite_read.rb +325 -0
- data/lib/openapi_client/models/invite_status.rb +42 -0
- data/lib/openapi_client/models/labels.rb +238 -0
- data/lib/openapi_client/models/language_instructions.rb +252 -0
- data/lib/openapi_client/models/location_inner.rb +230 -0
- data/lib/openapi_client/models/login_result.rb +259 -0
- data/lib/openapi_client/models/member_access_level.rb +41 -0
- data/lib/openapi_client/models/member_access_obj.rb +41 -0
- data/lib/openapi_client/models/multi_invite_result.rb +238 -0
- data/lib/openapi_client/models/onboarding_step.rb +46 -0
- data/lib/openapi_client/models/opa_decision_log.rb +288 -0
- data/lib/openapi_client/models/opa_engine_decision_log.rb +345 -0
- data/lib/openapi_client/models/opa_labels.rb +238 -0
- data/lib/openapi_client/models/opa_metrics.rb +273 -0
- data/lib/openapi_client/models/opal_client.rb +305 -0
- data/lib/openapi_client/models/org_member_read.rb +420 -0
- data/lib/openapi_client/models/org_member_update.rb +230 -0
- data/lib/openapi_client/models/organization_create.rb +292 -0
- data/lib/openapi_client/models/organization_object.rb +295 -0
- data/lib/openapi_client/models/organization_read.rb +295 -0
- data/lib/openapi_client/models/organization_read_with_api_key.rb +313 -0
- data/lib/openapi_client/models/organization_update.rb +247 -0
- data/lib/openapi_client/models/paginated_result_api_key_read.rb +285 -0
- data/lib/openapi_client/models/paginated_result_audit_log.rb +285 -0
- data/lib/openapi_client/models/paginated_result_elements_config_read.rb +285 -0
- data/lib/openapi_client/models/paginated_result_opa_decision_log.rb +285 -0
- data/lib/openapi_client/models/paginated_result_user_read.rb +285 -0
- data/lib/openapi_client/models/pdp.rb +259 -0
- data/lib/openapi_client/models/pdp_config_object.rb +258 -0
- data/lib/openapi_client/models/pdp_config_read.rb +292 -0
- data/lib/openapi_client/models/pdp_context.rb +291 -0
- data/lib/openapi_client/models/pdp_state.rb +224 -0
- data/lib/openapi_client/models/pdp_state_update.rb +238 -0
- data/lib/openapi_client/models/pdp_values.rb +252 -0
- data/lib/openapi_client/models/permission_level_role_read.rb +254 -0
- data/lib/openapi_client/models/policy_repo_create.rb +318 -0
- data/lib/openapi_client/models/policy_repo_read.rb +347 -0
- data/lib/openapi_client/models/policy_repo_status.rb +41 -0
- data/lib/openapi_client/models/programming_language.rb +43 -0
- data/lib/openapi_client/models/project_create.rb +318 -0
- data/lib/openapi_client/models/project_object.rb +295 -0
- data/lib/openapi_client/models/project_read.rb +357 -0
- data/lib/openapi_client/models/project_update.rb +250 -0
- data/lib/openapi_client/models/raw_data.rb +329 -0
- data/lib/openapi_client/models/relationship_tuple_object.rb +252 -0
- data/lib/openapi_client/models/remote_config.rb +256 -0
- data/lib/openapi_client/models/remove_role_permissions.rb +227 -0
- data/lib/openapi_client/models/resource_action_create.rb +271 -0
- data/lib/openapi_client/models/resource_action_read.rb +370 -0
- data/lib/openapi_client/models/resource_action_update.rb +230 -0
- data/lib/openapi_client/models/resource_attribute_create.rb +271 -0
- data/lib/openapi_client/models/resource_attribute_read.rb +370 -0
- data/lib/openapi_client/models/resource_attribute_update.rb +230 -0
- data/lib/openapi_client/models/resource_attributes.rb +238 -0
- data/lib/openapi_client/models/resource_create.rb +310 -0
- data/lib/openapi_client/models/resource_id.rb +230 -0
- data/lib/openapi_client/models/resource_instance_create.rb +281 -0
- data/lib/openapi_client/models/resource_instance_read.rb +375 -0
- data/lib/openapi_client/models/resource_instance_update.rb +220 -0
- data/lib/openapi_client/models/resource_read.rb +374 -0
- data/lib/openapi_client/models/resource_replace.rb +274 -0
- data/lib/openapi_client/models/resource_role_create.rb +295 -0
- data/lib/openapi_client/models/resource_role_read.rb +379 -0
- data/lib/openapi_client/models/resource_role_update.rb +254 -0
- data/lib/openapi_client/models/resource_type_object.rb +286 -0
- data/lib/openapi_client/models/resource_update.rb +264 -0
- data/lib/openapi_client/models/role_assignment_create.rb +255 -0
- data/lib/openapi_client/models/role_assignment_read.rb +375 -0
- data/lib/openapi_client/models/role_assignment_remove.rb +255 -0
- data/lib/openapi_client/models/role_block.rb +244 -0
- data/lib/openapi_client/models/role_create.rb +295 -0
- data/lib/openapi_client/models/role_data.rb +221 -0
- data/lib/openapi_client/models/role_read.rb +364 -0
- data/lib/openapi_client/models/role_update.rb +254 -0
- data/lib/openapi_client/models/settings.rb +231 -0
- data/lib/openapi_client/models/ssh_auth_data.rb +295 -0
- data/lib/openapi_client/models/statistics.rb +389 -0
- data/lib/openapi_client/models/tenant_create.rb +281 -0
- data/lib/openapi_client/models/tenant_object.rb +284 -0
- data/lib/openapi_client/models/tenant_read.rb +365 -0
- data/lib/openapi_client/models/tenant_update.rb +240 -0
- data/lib/openapi_client/models/user_create.rb +286 -0
- data/lib/openapi_client/models/user_data.rb +232 -0
- data/lib/openapi_client/models/user_login_request_input.rb +240 -0
- data/lib/openapi_client/models/user_object.rb +313 -0
- data/lib/openapi_client/models/user_read.rb +336 -0
- data/lib/openapi_client/models/user_role.rb +240 -0
- data/lib/openapi_client/models/user_role_create.rb +240 -0
- data/lib/openapi_client/models/user_role_remove.rb +240 -0
- data/lib/openapi_client/models/user_update.rb +250 -0
- data/lib/openapi_client/models/validation_error.rb +254 -0
- data/lib/openapi_client/models/webhook_create.rb +235 -0
- data/lib/openapi_client/models/webhook_read.rb +315 -0
- data/lib/openapi_client/models/webhook_update.rb +230 -0
- data/lib/openapi_client/version.rb +15 -0
- data/lib/openapi_client.rb +220 -0
- data/lib/permit.rb +58 -0
- metadata +251 -0
@@ -0,0 +1,512 @@
|
|
1
|
+
=begin
|
2
|
+
#Permit.io API
|
3
|
+
|
4
|
+
# Authorization as a service
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.2.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module OpenapiClient
|
16
|
+
class AuthenticationApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# (DEV MODE) Login
|
23
|
+
# The dev-login endpoints allows a developer inside permit.io to log in with an email address. THIS IS ONLY AVAILABLE IN DEV MODE.
|
24
|
+
# @param dev_login [DevLogin]
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [nil]
|
27
|
+
def dev_login(dev_login, opts = {})
|
28
|
+
dev_login_with_http_info(dev_login, opts)
|
29
|
+
nil
|
30
|
+
end
|
31
|
+
|
32
|
+
# (DEV MODE) Login
|
33
|
+
# The dev-login endpoints allows a developer inside permit.io to log in with an email address. THIS IS ONLY AVAILABLE IN DEV MODE.
|
34
|
+
# @param dev_login [DevLogin]
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
37
|
+
def dev_login_with_http_info(dev_login, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: AuthenticationApi.dev_login ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'dev_login' is set
|
42
|
+
if @api_client.config.client_side_validation && dev_login.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'dev_login' when calling AuthenticationApi.dev_login"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/v2/auth/devlogin'
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = opts[:query_params] || {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = opts[:header_params] || {}
|
53
|
+
# HTTP header 'Accept' (if needed)
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
55
|
+
# HTTP header 'Content-Type'
|
56
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
57
|
+
if !content_type.nil?
|
58
|
+
header_params['Content-Type'] = content_type
|
59
|
+
end
|
60
|
+
|
61
|
+
# form parameters
|
62
|
+
form_params = opts[:form_params] || {}
|
63
|
+
|
64
|
+
# http body (model)
|
65
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(dev_login)
|
66
|
+
|
67
|
+
# return_type
|
68
|
+
return_type = opts[:debug_return_type]
|
69
|
+
|
70
|
+
# auth_names
|
71
|
+
auth_names = opts[:debug_auth_names] || []
|
72
|
+
|
73
|
+
new_options = opts.merge(
|
74
|
+
:operation => :"AuthenticationApi.dev_login",
|
75
|
+
:header_params => header_params,
|
76
|
+
:query_params => query_params,
|
77
|
+
:form_params => form_params,
|
78
|
+
:body => post_body,
|
79
|
+
:auth_names => auth_names,
|
80
|
+
:return_type => return_type
|
81
|
+
)
|
82
|
+
|
83
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
84
|
+
if @api_client.config.debugging
|
85
|
+
@api_client.config.logger.debug "API called: AuthenticationApi#dev_login\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
86
|
+
end
|
87
|
+
return data, status_code, headers
|
88
|
+
end
|
89
|
+
|
90
|
+
# Elements Login As
|
91
|
+
# @param user_login_request_input [UserLoginRequestInput]
|
92
|
+
# @param [Hash] opts the optional parameters
|
93
|
+
# @return [EmbeddedLoginRequestOutput]
|
94
|
+
def elements_login_as(user_login_request_input, opts = {})
|
95
|
+
data, _status_code, _headers = elements_login_as_with_http_info(user_login_request_input, opts)
|
96
|
+
data
|
97
|
+
end
|
98
|
+
|
99
|
+
# Elements Login As
|
100
|
+
# @param user_login_request_input [UserLoginRequestInput]
|
101
|
+
# @param [Hash] opts the optional parameters
|
102
|
+
# @return [Array<(EmbeddedLoginRequestOutput, Integer, Hash)>] EmbeddedLoginRequestOutput data, response status code and response headers
|
103
|
+
def elements_login_as_with_http_info(user_login_request_input, opts = {})
|
104
|
+
if @api_client.config.debugging
|
105
|
+
@api_client.config.logger.debug 'Calling API: AuthenticationApi.elements_login_as ...'
|
106
|
+
end
|
107
|
+
# verify the required parameter 'user_login_request_input' is set
|
108
|
+
if @api_client.config.client_side_validation && user_login_request_input.nil?
|
109
|
+
fail ArgumentError, "Missing the required parameter 'user_login_request_input' when calling AuthenticationApi.elements_login_as"
|
110
|
+
end
|
111
|
+
# resource path
|
112
|
+
local_var_path = '/v2/auth/elements_login_as'
|
113
|
+
|
114
|
+
# query parameters
|
115
|
+
query_params = opts[:query_params] || {}
|
116
|
+
|
117
|
+
# header parameters
|
118
|
+
header_params = opts[:header_params] || {}
|
119
|
+
# HTTP header 'Accept' (if needed)
|
120
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
121
|
+
# HTTP header 'Content-Type'
|
122
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
123
|
+
if !content_type.nil?
|
124
|
+
header_params['Content-Type'] = content_type
|
125
|
+
end
|
126
|
+
|
127
|
+
# form parameters
|
128
|
+
form_params = opts[:form_params] || {}
|
129
|
+
|
130
|
+
# http body (model)
|
131
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(user_login_request_input)
|
132
|
+
|
133
|
+
# return_type
|
134
|
+
return_type = opts[:debug_return_type] || 'EmbeddedLoginRequestOutput'
|
135
|
+
|
136
|
+
# auth_names
|
137
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
138
|
+
|
139
|
+
new_options = opts.merge(
|
140
|
+
:operation => :"AuthenticationApi.elements_login_as",
|
141
|
+
:header_params => header_params,
|
142
|
+
:query_params => query_params,
|
143
|
+
:form_params => form_params,
|
144
|
+
:body => post_body,
|
145
|
+
:auth_names => auth_names,
|
146
|
+
:return_type => return_type
|
147
|
+
)
|
148
|
+
|
149
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
150
|
+
if @api_client.config.debugging
|
151
|
+
@api_client.config.logger.debug "API called: AuthenticationApi#elements_login_as\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
152
|
+
end
|
153
|
+
return data, status_code, headers
|
154
|
+
end
|
155
|
+
|
156
|
+
# Login
|
157
|
+
# The login endpoint allows the frontend app to exchange a user JWT with a user session. The user session is stored on an httpOnly + secure cookie.
|
158
|
+
# @param [Hash] opts the optional parameters
|
159
|
+
# @option opts [String] :invite_code An optional invite code to an existing organization. If the invite code is provided and is valid, the member will gain access to that organization.
|
160
|
+
# @return [LoginResult]
|
161
|
+
def login(opts = {})
|
162
|
+
data, _status_code, _headers = login_with_http_info(opts)
|
163
|
+
data
|
164
|
+
end
|
165
|
+
|
166
|
+
# Login
|
167
|
+
# The login endpoint allows the frontend app to exchange a user JWT with a user session. The user session is stored on an httpOnly + secure cookie.
|
168
|
+
# @param [Hash] opts the optional parameters
|
169
|
+
# @option opts [String] :invite_code An optional invite code to an existing organization. If the invite code is provided and is valid, the member will gain access to that organization.
|
170
|
+
# @return [Array<(LoginResult, Integer, Hash)>] LoginResult data, response status code and response headers
|
171
|
+
def login_with_http_info(opts = {})
|
172
|
+
if @api_client.config.debugging
|
173
|
+
@api_client.config.logger.debug 'Calling API: AuthenticationApi.login ...'
|
174
|
+
end
|
175
|
+
# resource path
|
176
|
+
local_var_path = '/v2/auth/login'
|
177
|
+
|
178
|
+
# query parameters
|
179
|
+
query_params = opts[:query_params] || {}
|
180
|
+
query_params[:'invite_code'] = opts[:'invite_code'] if !opts[:'invite_code'].nil?
|
181
|
+
|
182
|
+
# header parameters
|
183
|
+
header_params = opts[:header_params] || {}
|
184
|
+
# HTTP header 'Accept' (if needed)
|
185
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
186
|
+
|
187
|
+
# form parameters
|
188
|
+
form_params = opts[:form_params] || {}
|
189
|
+
|
190
|
+
# http body (model)
|
191
|
+
post_body = opts[:debug_body]
|
192
|
+
|
193
|
+
# return_type
|
194
|
+
return_type = opts[:debug_return_type] || 'LoginResult'
|
195
|
+
|
196
|
+
# auth_names
|
197
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
198
|
+
|
199
|
+
new_options = opts.merge(
|
200
|
+
:operation => :"AuthenticationApi.login",
|
201
|
+
:header_params => header_params,
|
202
|
+
:query_params => query_params,
|
203
|
+
:form_params => form_params,
|
204
|
+
:body => post_body,
|
205
|
+
:auth_names => auth_names,
|
206
|
+
:return_type => return_type
|
207
|
+
)
|
208
|
+
|
209
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
210
|
+
if @api_client.config.debugging
|
211
|
+
@api_client.config.logger.debug "API called: AuthenticationApi#login\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
212
|
+
end
|
213
|
+
return data, status_code, headers
|
214
|
+
end
|
215
|
+
|
216
|
+
# Login Elements
|
217
|
+
# The login endpoint allows the frontend app to exchange a user JWT with a user session. The user session is stored on an httpOnly + secure cookie.
|
218
|
+
# @param token [String]
|
219
|
+
# @param [Hash] opts the optional parameters
|
220
|
+
# @return [LoginResult]
|
221
|
+
def login_elements(token, opts = {})
|
222
|
+
data, _status_code, _headers = login_elements_with_http_info(token, opts)
|
223
|
+
data
|
224
|
+
end
|
225
|
+
|
226
|
+
# Login Elements
|
227
|
+
# The login endpoint allows the frontend app to exchange a user JWT with a user session. The user session is stored on an httpOnly + secure cookie.
|
228
|
+
# @param token [String]
|
229
|
+
# @param [Hash] opts the optional parameters
|
230
|
+
# @return [Array<(LoginResult, Integer, Hash)>] LoginResult data, response status code and response headers
|
231
|
+
def login_elements_with_http_info(token, opts = {})
|
232
|
+
if @api_client.config.debugging
|
233
|
+
@api_client.config.logger.debug 'Calling API: AuthenticationApi.login_elements ...'
|
234
|
+
end
|
235
|
+
# verify the required parameter 'token' is set
|
236
|
+
if @api_client.config.client_side_validation && token.nil?
|
237
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling AuthenticationApi.login_elements"
|
238
|
+
end
|
239
|
+
# resource path
|
240
|
+
local_var_path = '/v2/auth/login_elements'
|
241
|
+
|
242
|
+
# query parameters
|
243
|
+
query_params = opts[:query_params] || {}
|
244
|
+
query_params[:'token'] = token
|
245
|
+
|
246
|
+
# header parameters
|
247
|
+
header_params = opts[:header_params] || {}
|
248
|
+
# HTTP header 'Accept' (if needed)
|
249
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
250
|
+
|
251
|
+
# form parameters
|
252
|
+
form_params = opts[:form_params] || {}
|
253
|
+
|
254
|
+
# http body (model)
|
255
|
+
post_body = opts[:debug_body]
|
256
|
+
|
257
|
+
# return_type
|
258
|
+
return_type = opts[:debug_return_type] || 'LoginResult'
|
259
|
+
|
260
|
+
# auth_names
|
261
|
+
auth_names = opts[:debug_auth_names] || []
|
262
|
+
|
263
|
+
new_options = opts.merge(
|
264
|
+
:operation => :"AuthenticationApi.login_elements",
|
265
|
+
:header_params => header_params,
|
266
|
+
:query_params => query_params,
|
267
|
+
:form_params => form_params,
|
268
|
+
:body => post_body,
|
269
|
+
:auth_names => auth_names,
|
270
|
+
:return_type => return_type
|
271
|
+
)
|
272
|
+
|
273
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
274
|
+
if @api_client.config.debugging
|
275
|
+
@api_client.config.logger.debug "API called: AuthenticationApi#login_elements\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
276
|
+
end
|
277
|
+
return data, status_code, headers
|
278
|
+
end
|
279
|
+
|
280
|
+
# Logout Get
|
281
|
+
# The logout endpoint deletes the session cookie of a logged in user and invalidates cached VCs.
|
282
|
+
# @param [Hash] opts the optional parameters
|
283
|
+
# @return [nil]
|
284
|
+
def logout_get(opts = {})
|
285
|
+
logout_get_with_http_info(opts)
|
286
|
+
nil
|
287
|
+
end
|
288
|
+
|
289
|
+
# Logout Get
|
290
|
+
# The logout endpoint deletes the session cookie of a logged in user and invalidates cached VCs.
|
291
|
+
# @param [Hash] opts the optional parameters
|
292
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
293
|
+
def logout_get_with_http_info(opts = {})
|
294
|
+
if @api_client.config.debugging
|
295
|
+
@api_client.config.logger.debug 'Calling API: AuthenticationApi.logout_get ...'
|
296
|
+
end
|
297
|
+
# resource path
|
298
|
+
local_var_path = '/v2/auth/logout'
|
299
|
+
|
300
|
+
# query parameters
|
301
|
+
query_params = opts[:query_params] || {}
|
302
|
+
|
303
|
+
# header parameters
|
304
|
+
header_params = opts[:header_params] || {}
|
305
|
+
# HTTP header 'Accept' (if needed)
|
306
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
307
|
+
|
308
|
+
# form parameters
|
309
|
+
form_params = opts[:form_params] || {}
|
310
|
+
|
311
|
+
# http body (model)
|
312
|
+
post_body = opts[:debug_body]
|
313
|
+
|
314
|
+
# return_type
|
315
|
+
return_type = opts[:debug_return_type]
|
316
|
+
|
317
|
+
# auth_names
|
318
|
+
auth_names = opts[:debug_auth_names] || []
|
319
|
+
|
320
|
+
new_options = opts.merge(
|
321
|
+
:operation => :"AuthenticationApi.logout_get",
|
322
|
+
:header_params => header_params,
|
323
|
+
:query_params => query_params,
|
324
|
+
:form_params => form_params,
|
325
|
+
:body => post_body,
|
326
|
+
:auth_names => auth_names,
|
327
|
+
:return_type => return_type
|
328
|
+
)
|
329
|
+
|
330
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
331
|
+
if @api_client.config.debugging
|
332
|
+
@api_client.config.logger.debug "API called: AuthenticationApi#logout_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
333
|
+
end
|
334
|
+
return data, status_code, headers
|
335
|
+
end
|
336
|
+
|
337
|
+
# Logout Post
|
338
|
+
# The logout endpoint deletes the session cookie of a logged in user and invalidates cached VCs.
|
339
|
+
# @param [Hash] opts the optional parameters
|
340
|
+
# @return [nil]
|
341
|
+
def logout_post(opts = {})
|
342
|
+
logout_post_with_http_info(opts)
|
343
|
+
nil
|
344
|
+
end
|
345
|
+
|
346
|
+
# Logout Post
|
347
|
+
# The logout endpoint deletes the session cookie of a logged in user and invalidates cached VCs.
|
348
|
+
# @param [Hash] opts the optional parameters
|
349
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
350
|
+
def logout_post_with_http_info(opts = {})
|
351
|
+
if @api_client.config.debugging
|
352
|
+
@api_client.config.logger.debug 'Calling API: AuthenticationApi.logout_post ...'
|
353
|
+
end
|
354
|
+
# resource path
|
355
|
+
local_var_path = '/v2/auth/logout'
|
356
|
+
|
357
|
+
# query parameters
|
358
|
+
query_params = opts[:query_params] || {}
|
359
|
+
|
360
|
+
# header parameters
|
361
|
+
header_params = opts[:header_params] || {}
|
362
|
+
# HTTP header 'Accept' (if needed)
|
363
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
364
|
+
|
365
|
+
# form parameters
|
366
|
+
form_params = opts[:form_params] || {}
|
367
|
+
|
368
|
+
# http body (model)
|
369
|
+
post_body = opts[:debug_body]
|
370
|
+
|
371
|
+
# return_type
|
372
|
+
return_type = opts[:debug_return_type]
|
373
|
+
|
374
|
+
# auth_names
|
375
|
+
auth_names = opts[:debug_auth_names] || []
|
376
|
+
|
377
|
+
new_options = opts.merge(
|
378
|
+
:operation => :"AuthenticationApi.logout_post",
|
379
|
+
:header_params => header_params,
|
380
|
+
:query_params => query_params,
|
381
|
+
:form_params => form_params,
|
382
|
+
:body => post_body,
|
383
|
+
:auth_names => auth_names,
|
384
|
+
:return_type => return_type
|
385
|
+
)
|
386
|
+
|
387
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
388
|
+
if @api_client.config.debugging
|
389
|
+
@api_client.config.logger.debug "API called: AuthenticationApi#logout_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
390
|
+
end
|
391
|
+
return data, status_code, headers
|
392
|
+
end
|
393
|
+
|
394
|
+
# Me
|
395
|
+
# @param [Hash] opts the optional parameters
|
396
|
+
# @return [AuthnMeRead]
|
397
|
+
def me(opts = {})
|
398
|
+
data, _status_code, _headers = me_with_http_info(opts)
|
399
|
+
data
|
400
|
+
end
|
401
|
+
|
402
|
+
# Me
|
403
|
+
# @param [Hash] opts the optional parameters
|
404
|
+
# @return [Array<(AuthnMeRead, Integer, Hash)>] AuthnMeRead data, response status code and response headers
|
405
|
+
def me_with_http_info(opts = {})
|
406
|
+
if @api_client.config.debugging
|
407
|
+
@api_client.config.logger.debug 'Calling API: AuthenticationApi.me ...'
|
408
|
+
end
|
409
|
+
# resource path
|
410
|
+
local_var_path = '/v2/auth/me'
|
411
|
+
|
412
|
+
# query parameters
|
413
|
+
query_params = opts[:query_params] || {}
|
414
|
+
|
415
|
+
# header parameters
|
416
|
+
header_params = opts[:header_params] || {}
|
417
|
+
# HTTP header 'Accept' (if needed)
|
418
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
419
|
+
|
420
|
+
# form parameters
|
421
|
+
form_params = opts[:form_params] || {}
|
422
|
+
|
423
|
+
# http body (model)
|
424
|
+
post_body = opts[:debug_body]
|
425
|
+
|
426
|
+
# return_type
|
427
|
+
return_type = opts[:debug_return_type] || 'AuthnMeRead'
|
428
|
+
|
429
|
+
# auth_names
|
430
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
431
|
+
|
432
|
+
new_options = opts.merge(
|
433
|
+
:operation => :"AuthenticationApi.me",
|
434
|
+
:header_params => header_params,
|
435
|
+
:query_params => query_params,
|
436
|
+
:form_params => form_params,
|
437
|
+
:body => post_body,
|
438
|
+
:auth_names => auth_names,
|
439
|
+
:return_type => return_type
|
440
|
+
)
|
441
|
+
|
442
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
443
|
+
if @api_client.config.debugging
|
444
|
+
@api_client.config.logger.debug "API called: AuthenticationApi#me\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
445
|
+
end
|
446
|
+
return data, status_code, headers
|
447
|
+
end
|
448
|
+
|
449
|
+
# Switch Organization
|
450
|
+
# Allows the user to switch his active organization (manipulates the user's login session). This route will return a new login cookie to the user.
|
451
|
+
# @param org_id [String] the organization id the user wishes to switch to as the active org on the session
|
452
|
+
# @param [Hash] opts the optional parameters
|
453
|
+
# @return [LoginResult]
|
454
|
+
def switch_organization(org_id, opts = {})
|
455
|
+
data, _status_code, _headers = switch_organization_with_http_info(org_id, opts)
|
456
|
+
data
|
457
|
+
end
|
458
|
+
|
459
|
+
# Switch Organization
|
460
|
+
# Allows the user to switch his active organization (manipulates the user's login session). This route will return a new login cookie to the user.
|
461
|
+
# @param org_id [String] the organization id the user wishes to switch to as the active org on the session
|
462
|
+
# @param [Hash] opts the optional parameters
|
463
|
+
# @return [Array<(LoginResult, Integer, Hash)>] LoginResult data, response status code and response headers
|
464
|
+
def switch_organization_with_http_info(org_id, opts = {})
|
465
|
+
if @api_client.config.debugging
|
466
|
+
@api_client.config.logger.debug 'Calling API: AuthenticationApi.switch_organization ...'
|
467
|
+
end
|
468
|
+
# verify the required parameter 'org_id' is set
|
469
|
+
if @api_client.config.client_side_validation && org_id.nil?
|
470
|
+
fail ArgumentError, "Missing the required parameter 'org_id' when calling AuthenticationApi.switch_organization"
|
471
|
+
end
|
472
|
+
# resource path
|
473
|
+
local_var_path = '/v2/auth/switch_org/{org_id}'.sub('{' + 'org_id' + '}', CGI.escape(org_id.to_s))
|
474
|
+
|
475
|
+
# query parameters
|
476
|
+
query_params = opts[:query_params] || {}
|
477
|
+
|
478
|
+
# header parameters
|
479
|
+
header_params = opts[:header_params] || {}
|
480
|
+
# HTTP header 'Accept' (if needed)
|
481
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
482
|
+
|
483
|
+
# form parameters
|
484
|
+
form_params = opts[:form_params] || {}
|
485
|
+
|
486
|
+
# http body (model)
|
487
|
+
post_body = opts[:debug_body]
|
488
|
+
|
489
|
+
# return_type
|
490
|
+
return_type = opts[:debug_return_type] || 'LoginResult'
|
491
|
+
|
492
|
+
# auth_names
|
493
|
+
auth_names = opts[:debug_auth_names] || []
|
494
|
+
|
495
|
+
new_options = opts.merge(
|
496
|
+
:operation => :"AuthenticationApi.switch_organization",
|
497
|
+
:header_params => header_params,
|
498
|
+
:query_params => query_params,
|
499
|
+
:form_params => form_params,
|
500
|
+
:body => post_body,
|
501
|
+
:auth_names => auth_names,
|
502
|
+
:return_type => return_type
|
503
|
+
)
|
504
|
+
|
505
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
506
|
+
if @api_client.config.debugging
|
507
|
+
@api_client.config.logger.debug "API called: AuthenticationApi#switch_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
508
|
+
end
|
509
|
+
return data, status_code, headers
|
510
|
+
end
|
511
|
+
end
|
512
|
+
end
|