permit-sdk 0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/config.rb +23 -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 +249 -0
@@ -0,0 +1,118 @@
|
|
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 AuditElementsDataApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# List audit logs
|
23
|
+
# Lists audit logs for for specific elements config (tenant scope)
|
24
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
25
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
26
|
+
# @param elements_config_id [String] Either the unique id of the elements_config, or the URL-friendly key of the elements_config (i.e: the \"slug\").
|
27
|
+
# @param [Hash] opts the optional parameters
|
28
|
+
# @option opts [String] :search Text search for the email field
|
29
|
+
# @option opts [Integer] :page Page number of the results to fetch, starting at 1. (default to 1)
|
30
|
+
# @option opts [Integer] :per_page The number of results per page (max 100). (default to 30)
|
31
|
+
# @return [PaginatedResultAuditLog]
|
32
|
+
def elements_list_audit_logs(proj_id, env_id, elements_config_id, opts = {})
|
33
|
+
data, _status_code, _headers = elements_list_audit_logs_with_http_info(proj_id, env_id, elements_config_id, opts)
|
34
|
+
data
|
35
|
+
end
|
36
|
+
|
37
|
+
# List audit logs
|
38
|
+
# Lists audit logs for for specific elements config (tenant scope)
|
39
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
40
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
41
|
+
# @param elements_config_id [String] Either the unique id of the elements_config, or the URL-friendly key of the elements_config (i.e: the \"slug\").
|
42
|
+
# @param [Hash] opts the optional parameters
|
43
|
+
# @option opts [String] :search Text search for the email field
|
44
|
+
# @option opts [Integer] :page Page number of the results to fetch, starting at 1. (default to 1)
|
45
|
+
# @option opts [Integer] :per_page The number of results per page (max 100). (default to 30)
|
46
|
+
# @return [Array<(PaginatedResultAuditLog, Integer, Hash)>] PaginatedResultAuditLog data, response status code and response headers
|
47
|
+
def elements_list_audit_logs_with_http_info(proj_id, env_id, elements_config_id, opts = {})
|
48
|
+
if @api_client.config.debugging
|
49
|
+
@api_client.config.logger.debug 'Calling API: AuditElementsDataApi.elements_list_audit_logs ...'
|
50
|
+
end
|
51
|
+
# verify the required parameter 'proj_id' is set
|
52
|
+
if @api_client.config.client_side_validation && proj_id.nil?
|
53
|
+
fail ArgumentError, "Missing the required parameter 'proj_id' when calling AuditElementsDataApi.elements_list_audit_logs"
|
54
|
+
end
|
55
|
+
# verify the required parameter 'env_id' is set
|
56
|
+
if @api_client.config.client_side_validation && env_id.nil?
|
57
|
+
fail ArgumentError, "Missing the required parameter 'env_id' when calling AuditElementsDataApi.elements_list_audit_logs"
|
58
|
+
end
|
59
|
+
# verify the required parameter 'elements_config_id' is set
|
60
|
+
if @api_client.config.client_side_validation && elements_config_id.nil?
|
61
|
+
fail ArgumentError, "Missing the required parameter 'elements_config_id' when calling AuditElementsDataApi.elements_list_audit_logs"
|
62
|
+
end
|
63
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
64
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling AuditElementsDataApi.elements_list_audit_logs, must be greater than or equal to 1.'
|
65
|
+
end
|
66
|
+
|
67
|
+
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100
|
68
|
+
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling AuditElementsDataApi.elements_list_audit_logs, must be smaller than or equal to 100.'
|
69
|
+
end
|
70
|
+
|
71
|
+
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
|
72
|
+
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling AuditElementsDataApi.elements_list_audit_logs, must be greater than or equal to 1.'
|
73
|
+
end
|
74
|
+
|
75
|
+
# resource path
|
76
|
+
local_var_path = '/v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/data/audit_logs'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'elements_config_id' + '}', CGI.escape(elements_config_id.to_s))
|
77
|
+
|
78
|
+
# query parameters
|
79
|
+
query_params = opts[:query_params] || {}
|
80
|
+
query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
|
81
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
82
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
83
|
+
|
84
|
+
# header parameters
|
85
|
+
header_params = opts[:header_params] || {}
|
86
|
+
# HTTP header 'Accept' (if needed)
|
87
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
88
|
+
|
89
|
+
# form parameters
|
90
|
+
form_params = opts[:form_params] || {}
|
91
|
+
|
92
|
+
# http body (model)
|
93
|
+
post_body = opts[:debug_body]
|
94
|
+
|
95
|
+
# return_type
|
96
|
+
return_type = opts[:debug_return_type] || 'PaginatedResultAuditLog'
|
97
|
+
|
98
|
+
# auth_names
|
99
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
100
|
+
|
101
|
+
new_options = opts.merge(
|
102
|
+
:operation => :"AuditElementsDataApi.elements_list_audit_logs",
|
103
|
+
:header_params => header_params,
|
104
|
+
:query_params => query_params,
|
105
|
+
:form_params => form_params,
|
106
|
+
:body => post_body,
|
107
|
+
:auth_names => auth_names,
|
108
|
+
:return_type => return_type
|
109
|
+
)
|
110
|
+
|
111
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
112
|
+
if @api_client.config.debugging
|
113
|
+
@api_client.config.logger.debug "API called: AuditElementsDataApi#elements_list_audit_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
114
|
+
end
|
115
|
+
return data, status_code, headers
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
@@ -0,0 +1,204 @@
|
|
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 AuditLogsApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Get detailed audit log
|
23
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
24
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
25
|
+
# @param log_id [String] The unique id of the audit log
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @return [DetailedAuditLog]
|
28
|
+
def get_detailed_audit_log(proj_id, env_id, log_id, opts = {})
|
29
|
+
data, _status_code, _headers = get_detailed_audit_log_with_http_info(proj_id, env_id, log_id, opts)
|
30
|
+
data
|
31
|
+
end
|
32
|
+
|
33
|
+
# Get detailed audit log
|
34
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
35
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
36
|
+
# @param log_id [String] The unique id of the audit log
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @return [Array<(DetailedAuditLog, Integer, Hash)>] DetailedAuditLog data, response status code and response headers
|
39
|
+
def get_detailed_audit_log_with_http_info(proj_id, env_id, log_id, opts = {})
|
40
|
+
if @api_client.config.debugging
|
41
|
+
@api_client.config.logger.debug 'Calling API: AuditLogsApi.get_detailed_audit_log ...'
|
42
|
+
end
|
43
|
+
# verify the required parameter 'proj_id' is set
|
44
|
+
if @api_client.config.client_side_validation && proj_id.nil?
|
45
|
+
fail ArgumentError, "Missing the required parameter 'proj_id' when calling AuditLogsApi.get_detailed_audit_log"
|
46
|
+
end
|
47
|
+
# verify the required parameter 'env_id' is set
|
48
|
+
if @api_client.config.client_side_validation && env_id.nil?
|
49
|
+
fail ArgumentError, "Missing the required parameter 'env_id' when calling AuditLogsApi.get_detailed_audit_log"
|
50
|
+
end
|
51
|
+
# verify the required parameter 'log_id' is set
|
52
|
+
if @api_client.config.client_side_validation && log_id.nil?
|
53
|
+
fail ArgumentError, "Missing the required parameter 'log_id' when calling AuditLogsApi.get_detailed_audit_log"
|
54
|
+
end
|
55
|
+
# resource path
|
56
|
+
local_var_path = '/v2/pdps/{proj_id}/{env_id}/audit_logs/{log_id}'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'log_id' + '}', CGI.escape(log_id.to_s))
|
57
|
+
|
58
|
+
# query parameters
|
59
|
+
query_params = opts[:query_params] || {}
|
60
|
+
|
61
|
+
# header parameters
|
62
|
+
header_params = opts[:header_params] || {}
|
63
|
+
# HTTP header 'Accept' (if needed)
|
64
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
65
|
+
|
66
|
+
# form parameters
|
67
|
+
form_params = opts[:form_params] || {}
|
68
|
+
|
69
|
+
# http body (model)
|
70
|
+
post_body = opts[:debug_body]
|
71
|
+
|
72
|
+
# return_type
|
73
|
+
return_type = opts[:debug_return_type] || 'DetailedAuditLog'
|
74
|
+
|
75
|
+
# auth_names
|
76
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
77
|
+
|
78
|
+
new_options = opts.merge(
|
79
|
+
:operation => :"AuditLogsApi.get_detailed_audit_log",
|
80
|
+
:header_params => header_params,
|
81
|
+
:query_params => query_params,
|
82
|
+
:form_params => form_params,
|
83
|
+
:body => post_body,
|
84
|
+
:auth_names => auth_names,
|
85
|
+
:return_type => return_type
|
86
|
+
)
|
87
|
+
|
88
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
89
|
+
if @api_client.config.debugging
|
90
|
+
@api_client.config.logger.debug "API called: AuditLogsApi#get_detailed_audit_log\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
91
|
+
end
|
92
|
+
return data, status_code, headers
|
93
|
+
end
|
94
|
+
|
95
|
+
# List Audit Logs
|
96
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
97
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
98
|
+
# @param [Hash] opts the optional parameters
|
99
|
+
# @option opts [String] :pdp_id Filter by pdp config id
|
100
|
+
# @option opts [Array<String>] :users List of user keys or emails to filter by
|
101
|
+
# @option opts [Boolean] :decision Filter by decision result
|
102
|
+
# @option opts [Array<String>] :resources Filter by resources
|
103
|
+
# @option opts [String] :tenant Filter by tenant
|
104
|
+
# @option opts [String] :action Filter by action
|
105
|
+
# @option opts [Integer] :timestamp_from Filter by timestamp from
|
106
|
+
# @option opts [Integer] :timestamp_to Filter by timestamp to
|
107
|
+
# @option opts [Integer] :page Page number of the results to fetch, starting at 1. (default to 1)
|
108
|
+
# @option opts [Integer] :per_page The number of results per page (max 100). (default to 30)
|
109
|
+
# @return [PaginatedResultAuditLog]
|
110
|
+
def list_audit_logs(proj_id, env_id, opts = {})
|
111
|
+
data, _status_code, _headers = list_audit_logs_with_http_info(proj_id, env_id, opts)
|
112
|
+
data
|
113
|
+
end
|
114
|
+
|
115
|
+
# List Audit Logs
|
116
|
+
# @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
|
117
|
+
# @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
|
118
|
+
# @param [Hash] opts the optional parameters
|
119
|
+
# @option opts [String] :pdp_id Filter by pdp config id
|
120
|
+
# @option opts [Array<String>] :users List of user keys or emails to filter by
|
121
|
+
# @option opts [Boolean] :decision Filter by decision result
|
122
|
+
# @option opts [Array<String>] :resources Filter by resources
|
123
|
+
# @option opts [String] :tenant Filter by tenant
|
124
|
+
# @option opts [String] :action Filter by action
|
125
|
+
# @option opts [Integer] :timestamp_from Filter by timestamp from
|
126
|
+
# @option opts [Integer] :timestamp_to Filter by timestamp to
|
127
|
+
# @option opts [Integer] :page Page number of the results to fetch, starting at 1. (default to 1)
|
128
|
+
# @option opts [Integer] :per_page The number of results per page (max 100). (default to 30)
|
129
|
+
# @return [Array<(PaginatedResultAuditLog, Integer, Hash)>] PaginatedResultAuditLog data, response status code and response headers
|
130
|
+
def list_audit_logs_with_http_info(proj_id, env_id, opts = {})
|
131
|
+
if @api_client.config.debugging
|
132
|
+
@api_client.config.logger.debug 'Calling API: AuditLogsApi.list_audit_logs ...'
|
133
|
+
end
|
134
|
+
# verify the required parameter 'proj_id' is set
|
135
|
+
if @api_client.config.client_side_validation && proj_id.nil?
|
136
|
+
fail ArgumentError, "Missing the required parameter 'proj_id' when calling AuditLogsApi.list_audit_logs"
|
137
|
+
end
|
138
|
+
# verify the required parameter 'env_id' is set
|
139
|
+
if @api_client.config.client_side_validation && env_id.nil?
|
140
|
+
fail ArgumentError, "Missing the required parameter 'env_id' when calling AuditLogsApi.list_audit_logs"
|
141
|
+
end
|
142
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
143
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling AuditLogsApi.list_audit_logs, must be greater than or equal to 1.'
|
144
|
+
end
|
145
|
+
|
146
|
+
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100
|
147
|
+
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling AuditLogsApi.list_audit_logs, must be smaller than or equal to 100.'
|
148
|
+
end
|
149
|
+
|
150
|
+
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
|
151
|
+
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling AuditLogsApi.list_audit_logs, must be greater than or equal to 1.'
|
152
|
+
end
|
153
|
+
|
154
|
+
# resource path
|
155
|
+
local_var_path = '/v2/pdps/{proj_id}/{env_id}/audit_logs'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s))
|
156
|
+
|
157
|
+
# query parameters
|
158
|
+
query_params = opts[:query_params] || {}
|
159
|
+
query_params[:'pdp_id'] = opts[:'pdp_id'] if !opts[:'pdp_id'].nil?
|
160
|
+
query_params[:'users'] = @api_client.build_collection_param(opts[:'users'], :multi) if !opts[:'users'].nil?
|
161
|
+
query_params[:'decision'] = opts[:'decision'] if !opts[:'decision'].nil?
|
162
|
+
query_params[:'resources'] = @api_client.build_collection_param(opts[:'resources'], :multi) if !opts[:'resources'].nil?
|
163
|
+
query_params[:'tenant'] = opts[:'tenant'] if !opts[:'tenant'].nil?
|
164
|
+
query_params[:'action'] = opts[:'action'] if !opts[:'action'].nil?
|
165
|
+
query_params[:'timestamp_from'] = opts[:'timestamp_from'] if !opts[:'timestamp_from'].nil?
|
166
|
+
query_params[:'timestamp_to'] = opts[:'timestamp_to'] if !opts[:'timestamp_to'].nil?
|
167
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
168
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
169
|
+
|
170
|
+
# header parameters
|
171
|
+
header_params = opts[:header_params] || {}
|
172
|
+
# HTTP header 'Accept' (if needed)
|
173
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
174
|
+
|
175
|
+
# form parameters
|
176
|
+
form_params = opts[:form_params] || {}
|
177
|
+
|
178
|
+
# http body (model)
|
179
|
+
post_body = opts[:debug_body]
|
180
|
+
|
181
|
+
# return_type
|
182
|
+
return_type = opts[:debug_return_type] || 'PaginatedResultAuditLog'
|
183
|
+
|
184
|
+
# auth_names
|
185
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
186
|
+
|
187
|
+
new_options = opts.merge(
|
188
|
+
:operation => :"AuditLogsApi.list_audit_logs",
|
189
|
+
:header_params => header_params,
|
190
|
+
:query_params => query_params,
|
191
|
+
:form_params => form_params,
|
192
|
+
:body => post_body,
|
193
|
+
:auth_names => auth_names,
|
194
|
+
:return_type => return_type
|
195
|
+
)
|
196
|
+
|
197
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
198
|
+
if @api_client.config.debugging
|
199
|
+
@api_client.config.logger.debug "API called: AuditLogsApi#list_audit_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
200
|
+
end
|
201
|
+
return data, status_code, headers
|
202
|
+
end
|
203
|
+
end
|
204
|
+
end
|