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.
Files changed (194) hide show
  1. checksums.yaml +7 -0
  2. data/lib/api/api.rb +25 -0
  3. data/lib/api/base.rb +26 -0
  4. data/lib/api/resources.rb +13 -0
  5. data/lib/api/tenants.rb +11 -0
  6. data/lib/api/users.rb +50 -0
  7. data/lib/config.rb +23 -0
  8. data/lib/openapi_client/api/api_keys_api.rb +413 -0
  9. data/lib/openapi_client/api/audit_elements_data_api.rb +118 -0
  10. data/lib/openapi_client/api/audit_logs_api.rb +204 -0
  11. data/lib/openapi_client/api/authentication_api.rb +512 -0
  12. data/lib/openapi_client/api/condition_set_rules_api.rb +278 -0
  13. data/lib/openapi_client/api/condition_sets_api.rb +428 -0
  14. data/lib/openapi_client/api/decision_logs_api.rb +128 -0
  15. data/lib/openapi_client/api/decision_logs_ingress_api.rb +90 -0
  16. data/lib/openapi_client/api/default_api.rb +297 -0
  17. data/lib/openapi_client/api/elements_configs_api.rb +657 -0
  18. data/lib/openapi_client/api/environments_api.rb +462 -0
  19. data/lib/openapi_client/api/instructions_api.rb +91 -0
  20. data/lib/openapi_client/api/members_api.rb +354 -0
  21. data/lib/openapi_client/api/opal_data_api.rb +343 -0
  22. data/lib/openapi_client/api/organizations_api.rb +652 -0
  23. data/lib/openapi_client/api/policy_api.rb +138 -0
  24. data/lib/openapi_client/api/policy_decision_points_api.rb +382 -0
  25. data/lib/openapi_client/api/policy_git_repositories_api.rb +510 -0
  26. data/lib/openapi_client/api/projects_api.rb +365 -0
  27. data/lib/openapi_client/api/resource_actions_api.rb +455 -0
  28. data/lib/openapi_client/api/resource_attributes_api.rb +473 -0
  29. data/lib/openapi_client/api/resource_instances_api.rb +425 -0
  30. data/lib/openapi_client/api/resource_roles_api.rb +813 -0
  31. data/lib/openapi_client/api/resources_api.rb +514 -0
  32. data/lib/openapi_client/api/role_assignments_api.rb +278 -0
  33. data/lib/openapi_client/api/roles_api.rb +759 -0
  34. data/lib/openapi_client/api/tenants_api.rb +603 -0
  35. data/lib/openapi_client/api/user_attributes_api.rb +458 -0
  36. data/lib/openapi_client/api/users_api.rb +684 -0
  37. data/lib/openapi_client/api/users_elements_data_api.rb +638 -0
  38. data/lib/openapi_client/api_client.rb +392 -0
  39. data/lib/openapi_client/api_error.rb +57 -0
  40. data/lib/openapi_client/configuration.rb +280 -0
  41. data/lib/openapi_client/models/action_block_editable.rb +230 -0
  42. data/lib/openapi_client/models/action_block_read.rb +255 -0
  43. data/lib/openapi_client/models/action_object.rb +275 -0
  44. data/lib/openapi_client/models/actor.rb +57 -0
  45. data/lib/openapi_client/models/add_role_permissions.rb +227 -0
  46. data/lib/openapi_client/models/api_key_create.rb +269 -0
  47. data/lib/openapi_client/models/api_key_owner_type.rb +41 -0
  48. data/lib/openapi_client/models/api_key_read.rb +329 -0
  49. data/lib/openapi_client/models/api_key_scope_read.rb +245 -0
  50. data/lib/openapi_client/models/attribute_block_editable.rb +235 -0
  51. data/lib/openapi_client/models/attribute_block_read.rb +260 -0
  52. data/lib/openapi_client/models/attribute_type.rb +44 -0
  53. data/lib/openapi_client/models/attributes.rb +231 -0
  54. data/lib/openapi_client/models/audit_log.rb +415 -0
  55. data/lib/openapi_client/models/audit_log_objects.rb +282 -0
  56. data/lib/openapi_client/models/authn_me_api_key_read.rb +329 -0
  57. data/lib/openapi_client/models/authn_me_member_read.rb +352 -0
  58. data/lib/openapi_client/models/authn_me_read.rb +224 -0
  59. data/lib/openapi_client/models/authn_me_user_read.rb +440 -0
  60. data/lib/openapi_client/models/condition_set_create.rb +340 -0
  61. data/lib/openapi_client/models/condition_set_read.rb +409 -0
  62. data/lib/openapi_client/models/condition_set_rule_create.rb +279 -0
  63. data/lib/openapi_client/models/condition_set_rule_read.rb +360 -0
  64. data/lib/openapi_client/models/condition_set_rule_remove.rb +279 -0
  65. data/lib/openapi_client/models/condition_set_type.rb +40 -0
  66. data/lib/openapi_client/models/condition_set_update.rb +255 -0
  67. data/lib/openapi_client/models/data_source_config.rb +228 -0
  68. data/lib/openapi_client/models/data_source_entry.rb +272 -0
  69. data/lib/openapi_client/models/detailed_audit_log.rb +443 -0
  70. data/lib/openapi_client/models/dev_login.rb +225 -0
  71. data/lib/openapi_client/models/dummy_engine_model.rb +229 -0
  72. data/lib/openapi_client/models/elements_config_create.rb +319 -0
  73. data/lib/openapi_client/models/elements_config_read.rb +402 -0
  74. data/lib/openapi_client/models/elements_config_runtime_read.rb +238 -0
  75. data/lib/openapi_client/models/elements_config_update.rb +268 -0
  76. data/lib/openapi_client/models/elements_env_type_read.rb +242 -0
  77. data/lib/openapi_client/models/elements_env_type_update.rb +222 -0
  78. data/lib/openapi_client/models/elements_permission_level.rb +44 -0
  79. data/lib/openapi_client/models/elements_role_read.rb +378 -0
  80. data/lib/openapi_client/models/elements_type.rb +41 -0
  81. data/lib/openapi_client/models/elements_user_create.rb +295 -0
  82. data/lib/openapi_client/models/elements_user_role_create.rb +225 -0
  83. data/lib/openapi_client/models/elements_user_role_remove.rb +225 -0
  84. data/lib/openapi_client/models/embedded_login_request_output.rb +265 -0
  85. data/lib/openapi_client/models/engine.rb +39 -0
  86. data/lib/openapi_client/models/environment_create.rb +281 -0
  87. data/lib/openapi_client/models/environment_object.rb +295 -0
  88. data/lib/openapi_client/models/environment_read.rb +335 -0
  89. data/lib/openapi_client/models/environment_stats.rb +365 -0
  90. data/lib/openapi_client/models/environment_update.rb +240 -0
  91. data/lib/openapi_client/models/failed_invite.rb +238 -0
  92. data/lib/openapi_client/models/full_data.rb +258 -0
  93. data/lib/openapi_client/models/http_validation_error.rb +221 -0
  94. data/lib/openapi_client/models/identity_read.rb +300 -0
  95. data/lib/openapi_client/models/invite_attempt_result.rb +232 -0
  96. data/lib/openapi_client/models/invite_create.rb +240 -0
  97. data/lib/openapi_client/models/invite_read.rb +325 -0
  98. data/lib/openapi_client/models/invite_status.rb +42 -0
  99. data/lib/openapi_client/models/labels.rb +238 -0
  100. data/lib/openapi_client/models/language_instructions.rb +252 -0
  101. data/lib/openapi_client/models/location_inner.rb +230 -0
  102. data/lib/openapi_client/models/login_result.rb +259 -0
  103. data/lib/openapi_client/models/member_access_level.rb +41 -0
  104. data/lib/openapi_client/models/member_access_obj.rb +41 -0
  105. data/lib/openapi_client/models/multi_invite_result.rb +238 -0
  106. data/lib/openapi_client/models/onboarding_step.rb +46 -0
  107. data/lib/openapi_client/models/opa_decision_log.rb +288 -0
  108. data/lib/openapi_client/models/opa_engine_decision_log.rb +345 -0
  109. data/lib/openapi_client/models/opa_labels.rb +238 -0
  110. data/lib/openapi_client/models/opa_metrics.rb +273 -0
  111. data/lib/openapi_client/models/opal_client.rb +305 -0
  112. data/lib/openapi_client/models/org_member_read.rb +420 -0
  113. data/lib/openapi_client/models/org_member_update.rb +230 -0
  114. data/lib/openapi_client/models/organization_create.rb +292 -0
  115. data/lib/openapi_client/models/organization_object.rb +295 -0
  116. data/lib/openapi_client/models/organization_read.rb +295 -0
  117. data/lib/openapi_client/models/organization_read_with_api_key.rb +313 -0
  118. data/lib/openapi_client/models/organization_update.rb +247 -0
  119. data/lib/openapi_client/models/paginated_result_api_key_read.rb +285 -0
  120. data/lib/openapi_client/models/paginated_result_audit_log.rb +285 -0
  121. data/lib/openapi_client/models/paginated_result_elements_config_read.rb +285 -0
  122. data/lib/openapi_client/models/paginated_result_opa_decision_log.rb +285 -0
  123. data/lib/openapi_client/models/paginated_result_user_read.rb +285 -0
  124. data/lib/openapi_client/models/pdp.rb +259 -0
  125. data/lib/openapi_client/models/pdp_config_object.rb +258 -0
  126. data/lib/openapi_client/models/pdp_config_read.rb +292 -0
  127. data/lib/openapi_client/models/pdp_context.rb +291 -0
  128. data/lib/openapi_client/models/pdp_state.rb +224 -0
  129. data/lib/openapi_client/models/pdp_state_update.rb +238 -0
  130. data/lib/openapi_client/models/pdp_values.rb +252 -0
  131. data/lib/openapi_client/models/permission_level_role_read.rb +254 -0
  132. data/lib/openapi_client/models/policy_repo_create.rb +318 -0
  133. data/lib/openapi_client/models/policy_repo_read.rb +347 -0
  134. data/lib/openapi_client/models/policy_repo_status.rb +41 -0
  135. data/lib/openapi_client/models/programming_language.rb +43 -0
  136. data/lib/openapi_client/models/project_create.rb +318 -0
  137. data/lib/openapi_client/models/project_object.rb +295 -0
  138. data/lib/openapi_client/models/project_read.rb +357 -0
  139. data/lib/openapi_client/models/project_update.rb +250 -0
  140. data/lib/openapi_client/models/raw_data.rb +329 -0
  141. data/lib/openapi_client/models/relationship_tuple_object.rb +252 -0
  142. data/lib/openapi_client/models/remote_config.rb +256 -0
  143. data/lib/openapi_client/models/remove_role_permissions.rb +227 -0
  144. data/lib/openapi_client/models/resource_action_create.rb +271 -0
  145. data/lib/openapi_client/models/resource_action_read.rb +370 -0
  146. data/lib/openapi_client/models/resource_action_update.rb +230 -0
  147. data/lib/openapi_client/models/resource_attribute_create.rb +271 -0
  148. data/lib/openapi_client/models/resource_attribute_read.rb +370 -0
  149. data/lib/openapi_client/models/resource_attribute_update.rb +230 -0
  150. data/lib/openapi_client/models/resource_attributes.rb +238 -0
  151. data/lib/openapi_client/models/resource_create.rb +310 -0
  152. data/lib/openapi_client/models/resource_id.rb +230 -0
  153. data/lib/openapi_client/models/resource_instance_create.rb +281 -0
  154. data/lib/openapi_client/models/resource_instance_read.rb +375 -0
  155. data/lib/openapi_client/models/resource_instance_update.rb +220 -0
  156. data/lib/openapi_client/models/resource_read.rb +374 -0
  157. data/lib/openapi_client/models/resource_replace.rb +274 -0
  158. data/lib/openapi_client/models/resource_role_create.rb +295 -0
  159. data/lib/openapi_client/models/resource_role_read.rb +379 -0
  160. data/lib/openapi_client/models/resource_role_update.rb +254 -0
  161. data/lib/openapi_client/models/resource_type_object.rb +286 -0
  162. data/lib/openapi_client/models/resource_update.rb +264 -0
  163. data/lib/openapi_client/models/role_assignment_create.rb +255 -0
  164. data/lib/openapi_client/models/role_assignment_read.rb +375 -0
  165. data/lib/openapi_client/models/role_assignment_remove.rb +255 -0
  166. data/lib/openapi_client/models/role_block.rb +244 -0
  167. data/lib/openapi_client/models/role_create.rb +295 -0
  168. data/lib/openapi_client/models/role_data.rb +221 -0
  169. data/lib/openapi_client/models/role_read.rb +364 -0
  170. data/lib/openapi_client/models/role_update.rb +254 -0
  171. data/lib/openapi_client/models/settings.rb +231 -0
  172. data/lib/openapi_client/models/ssh_auth_data.rb +295 -0
  173. data/lib/openapi_client/models/statistics.rb +389 -0
  174. data/lib/openapi_client/models/tenant_create.rb +281 -0
  175. data/lib/openapi_client/models/tenant_object.rb +284 -0
  176. data/lib/openapi_client/models/tenant_read.rb +365 -0
  177. data/lib/openapi_client/models/tenant_update.rb +240 -0
  178. data/lib/openapi_client/models/user_create.rb +286 -0
  179. data/lib/openapi_client/models/user_data.rb +232 -0
  180. data/lib/openapi_client/models/user_login_request_input.rb +240 -0
  181. data/lib/openapi_client/models/user_object.rb +313 -0
  182. data/lib/openapi_client/models/user_read.rb +336 -0
  183. data/lib/openapi_client/models/user_role.rb +240 -0
  184. data/lib/openapi_client/models/user_role_create.rb +240 -0
  185. data/lib/openapi_client/models/user_role_remove.rb +240 -0
  186. data/lib/openapi_client/models/user_update.rb +250 -0
  187. data/lib/openapi_client/models/validation_error.rb +254 -0
  188. data/lib/openapi_client/models/webhook_create.rb +235 -0
  189. data/lib/openapi_client/models/webhook_read.rb +315 -0
  190. data/lib/openapi_client/models/webhook_update.rb +230 -0
  191. data/lib/openapi_client/version.rb +15 -0
  192. data/lib/openapi_client.rb +220 -0
  193. data/lib/permit.rb +58 -0
  194. metadata +249 -0
@@ -0,0 +1,138 @@
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 PolicyApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get Opal Data Sources
23
+ # @param [Hash] opts the optional parameters
24
+ # @option opts [String] :token
25
+ # @return [DataSourceConfig]
26
+ def get_opal_data_sources(opts = {})
27
+ data, _status_code, _headers = get_opal_data_sources_with_http_info(opts)
28
+ data
29
+ end
30
+
31
+ # Get Opal Data Sources
32
+ # @param [Hash] opts the optional parameters
33
+ # @option opts [String] :token
34
+ # @return [Array<(DataSourceConfig, Integer, Hash)>] DataSourceConfig data, response status code and response headers
35
+ def get_opal_data_sources_with_http_info(opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: PolicyApi.get_opal_data_sources ...'
38
+ end
39
+ # resource path
40
+ local_var_path = '/v2/opal/data/config'
41
+
42
+ # query parameters
43
+ query_params = opts[:query_params] || {}
44
+ query_params[:'token'] = opts[:'token'] if !opts[:'token'].nil?
45
+
46
+ # header parameters
47
+ header_params = opts[:header_params] || {}
48
+ # HTTP header 'Accept' (if needed)
49
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
50
+
51
+ # form parameters
52
+ form_params = opts[:form_params] || {}
53
+
54
+ # http body (model)
55
+ post_body = opts[:debug_body]
56
+
57
+ # return_type
58
+ return_type = opts[:debug_return_type] || 'DataSourceConfig'
59
+
60
+ # auth_names
61
+ auth_names = opts[:debug_auth_names] || []
62
+
63
+ new_options = opts.merge(
64
+ :operation => :"PolicyApi.get_opal_data_sources",
65
+ :header_params => header_params,
66
+ :query_params => query_params,
67
+ :form_params => form_params,
68
+ :body => post_body,
69
+ :auth_names => auth_names,
70
+ :return_type => return_type
71
+ )
72
+
73
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
74
+ if @api_client.config.debugging
75
+ @api_client.config.logger.debug "API called: PolicyApi#get_opal_data_sources\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
76
+ end
77
+ return data, status_code, headers
78
+ end
79
+
80
+ # Get Opal Data Sources
81
+ # @param [Hash] opts the optional parameters
82
+ # @option opts [String] :token
83
+ # @return [DataSourceConfig]
84
+ def get_opal_data_sources_opal_data_config_get(opts = {})
85
+ data, _status_code, _headers = get_opal_data_sources_opal_data_config_get_with_http_info(opts)
86
+ data
87
+ end
88
+
89
+ # Get Opal Data Sources
90
+ # @param [Hash] opts the optional parameters
91
+ # @option opts [String] :token
92
+ # @return [Array<(DataSourceConfig, Integer, Hash)>] DataSourceConfig data, response status code and response headers
93
+ def get_opal_data_sources_opal_data_config_get_with_http_info(opts = {})
94
+ if @api_client.config.debugging
95
+ @api_client.config.logger.debug 'Calling API: PolicyApi.get_opal_data_sources_opal_data_config_get ...'
96
+ end
97
+ # resource path
98
+ local_var_path = '/opal/data/config'
99
+
100
+ # query parameters
101
+ query_params = opts[:query_params] || {}
102
+ query_params[:'token'] = opts[:'token'] if !opts[:'token'].nil?
103
+
104
+ # header parameters
105
+ header_params = opts[:header_params] || {}
106
+ # HTTP header 'Accept' (if needed)
107
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
108
+
109
+ # form parameters
110
+ form_params = opts[:form_params] || {}
111
+
112
+ # http body (model)
113
+ post_body = opts[:debug_body]
114
+
115
+ # return_type
116
+ return_type = opts[:debug_return_type] || 'DataSourceConfig'
117
+
118
+ # auth_names
119
+ auth_names = opts[:debug_auth_names] || []
120
+
121
+ new_options = opts.merge(
122
+ :operation => :"PolicyApi.get_opal_data_sources_opal_data_config_get",
123
+ :header_params => header_params,
124
+ :query_params => query_params,
125
+ :form_params => form_params,
126
+ :body => post_body,
127
+ :auth_names => auth_names,
128
+ :return_type => return_type
129
+ )
130
+
131
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
132
+ if @api_client.config.debugging
133
+ @api_client.config.logger.debug "API called: PolicyApi#get_opal_data_sources_opal_data_config_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
134
+ end
135
+ return data, status_code, headers
136
+ end
137
+ end
138
+ end
@@ -0,0 +1,382 @@
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 PolicyDecisionPointsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get connected PDP configuration and push state
23
+ # Gets the configuration values for the currently authenticated PDP container. The PDP authenticates with an API key scoped to a given Permit.io environment. The system identifies the PDP via its API key and then returns all the configuration values required for the container to run correctly. The config values returned are considered \"overrides\", meaning they are overriding any default values given to the container by the user.
24
+ # @param pdp_state_update [PDPStateUpdate]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [RemoteConfig]
27
+ def get_authenticating_pdp_config_values(pdp_state_update, opts = {})
28
+ data, _status_code, _headers = get_authenticating_pdp_config_values_with_http_info(pdp_state_update, opts)
29
+ data
30
+ end
31
+
32
+ # Get connected PDP configuration and push state
33
+ # Gets the configuration values for the currently authenticated PDP container. The PDP authenticates with an API key scoped to a given Permit.io environment. The system identifies the PDP via its API key and then returns all the configuration values required for the container to run correctly. The config values returned are considered \&quot;overrides\&quot;, meaning they are overriding any default values given to the container by the user.
34
+ # @param pdp_state_update [PDPStateUpdate]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(RemoteConfig, Integer, Hash)>] RemoteConfig data, response status code and response headers
37
+ def get_authenticating_pdp_config_values_with_http_info(pdp_state_update, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: PolicyDecisionPointsApi.get_authenticating_pdp_config_values ...'
40
+ end
41
+ # verify the required parameter 'pdp_state_update' is set
42
+ if @api_client.config.client_side_validation && pdp_state_update.nil?
43
+ fail ArgumentError, "Missing the required parameter 'pdp_state_update' when calling PolicyDecisionPointsApi.get_authenticating_pdp_config_values"
44
+ end
45
+ # resource path
46
+ local_var_path = '/v2/pdps/me/config'
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(pdp_state_update)
66
+
67
+ # return_type
68
+ return_type = opts[:debug_return_type] || 'RemoteConfig'
69
+
70
+ # auth_names
71
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
72
+
73
+ new_options = opts.merge(
74
+ :operation => :"PolicyDecisionPointsApi.get_authenticating_pdp_config_values",
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: PolicyDecisionPointsApi#get_authenticating_pdp_config_values\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
86
+ end
87
+ return data, status_code, headers
88
+ end
89
+
90
+ # Get connected PDP configuration
91
+ # Gets the configuration values for the currently authenticated PDP container. The PDP authenticates with an API key scoped to a given Permit.io environment. The system identifies the PDP via its API key and then returns all the configuration values required for the container to run correctly. The config values returned are considered \"overrides\", meaning they are overriding any default values given to the container by the user.
92
+ # @param [Hash] opts the optional parameters
93
+ # @return [RemoteConfig]
94
+ def get_authenticating_pdp_config_values_legacy(opts = {})
95
+ data, _status_code, _headers = get_authenticating_pdp_config_values_legacy_with_http_info(opts)
96
+ data
97
+ end
98
+
99
+ # Get connected PDP configuration
100
+ # Gets the configuration values for the currently authenticated PDP container. The PDP authenticates with an API key scoped to a given Permit.io environment. The system identifies the PDP via its API key and then returns all the configuration values required for the container to run correctly. The config values returned are considered \&quot;overrides\&quot;, meaning they are overriding any default values given to the container by the user.
101
+ # @param [Hash] opts the optional parameters
102
+ # @return [Array<(RemoteConfig, Integer, Hash)>] RemoteConfig data, response status code and response headers
103
+ def get_authenticating_pdp_config_values_legacy_with_http_info(opts = {})
104
+ if @api_client.config.debugging
105
+ @api_client.config.logger.debug 'Calling API: PolicyDecisionPointsApi.get_authenticating_pdp_config_values_legacy ...'
106
+ end
107
+ # resource path
108
+ local_var_path = '/v2/pdps/me/config'
109
+
110
+ # query parameters
111
+ query_params = opts[:query_params] || {}
112
+
113
+ # header parameters
114
+ header_params = opts[:header_params] || {}
115
+ # HTTP header 'Accept' (if needed)
116
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
117
+
118
+ # form parameters
119
+ form_params = opts[:form_params] || {}
120
+
121
+ # http body (model)
122
+ post_body = opts[:debug_body]
123
+
124
+ # return_type
125
+ return_type = opts[:debug_return_type] || 'RemoteConfig'
126
+
127
+ # auth_names
128
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
129
+
130
+ new_options = opts.merge(
131
+ :operation => :"PolicyDecisionPointsApi.get_authenticating_pdp_config_values_legacy",
132
+ :header_params => header_params,
133
+ :query_params => query_params,
134
+ :form_params => form_params,
135
+ :body => post_body,
136
+ :auth_names => auth_names,
137
+ :return_type => return_type
138
+ )
139
+
140
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
141
+ if @api_client.config.debugging
142
+ @api_client.config.logger.debug "API called: PolicyDecisionPointsApi#get_authenticating_pdp_config_values_legacy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
143
+ end
144
+ return data, status_code, headers
145
+ end
146
+
147
+ # Get PDP configuration
148
+ # Gets the configuration values for the PDP container with id `pdp_id`. The config values returned are considered \"overrides\", meaning they are overriding any default values given to the container by the user.
149
+ # @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \&quot;slug\&quot;).
150
+ # @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \&quot;slug\&quot;).
151
+ # @param pdp_id [String] The unique id of the pdp
152
+ # @param [Hash] opts the optional parameters
153
+ # @return [RemoteConfig]
154
+ def get_pdp_config_values(proj_id, env_id, pdp_id, opts = {})
155
+ data, _status_code, _headers = get_pdp_config_values_with_http_info(proj_id, env_id, pdp_id, opts)
156
+ data
157
+ end
158
+
159
+ # Get PDP configuration
160
+ # Gets the configuration values for the PDP container with id &#x60;pdp_id&#x60;. The config values returned are considered \&quot;overrides\&quot;, meaning they are overriding any default values given to the container by the user.
161
+ # @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \&quot;slug\&quot;).
162
+ # @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \&quot;slug\&quot;).
163
+ # @param pdp_id [String] The unique id of the pdp
164
+ # @param [Hash] opts the optional parameters
165
+ # @return [Array<(RemoteConfig, Integer, Hash)>] RemoteConfig data, response status code and response headers
166
+ def get_pdp_config_values_with_http_info(proj_id, env_id, pdp_id, opts = {})
167
+ if @api_client.config.debugging
168
+ @api_client.config.logger.debug 'Calling API: PolicyDecisionPointsApi.get_pdp_config_values ...'
169
+ end
170
+ # verify the required parameter 'proj_id' is set
171
+ if @api_client.config.client_side_validation && proj_id.nil?
172
+ fail ArgumentError, "Missing the required parameter 'proj_id' when calling PolicyDecisionPointsApi.get_pdp_config_values"
173
+ end
174
+ # verify the required parameter 'env_id' is set
175
+ if @api_client.config.client_side_validation && env_id.nil?
176
+ fail ArgumentError, "Missing the required parameter 'env_id' when calling PolicyDecisionPointsApi.get_pdp_config_values"
177
+ end
178
+ # verify the required parameter 'pdp_id' is set
179
+ if @api_client.config.client_side_validation && pdp_id.nil?
180
+ fail ArgumentError, "Missing the required parameter 'pdp_id' when calling PolicyDecisionPointsApi.get_pdp_config_values"
181
+ end
182
+ # resource path
183
+ local_var_path = '/v2/pdps/{proj_id}/{env_id}/configs/{pdp_id}/values'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'pdp_id' + '}', CGI.escape(pdp_id.to_s))
184
+
185
+ # query parameters
186
+ query_params = opts[:query_params] || {}
187
+
188
+ # header parameters
189
+ header_params = opts[:header_params] || {}
190
+ # HTTP header 'Accept' (if needed)
191
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
192
+
193
+ # form parameters
194
+ form_params = opts[:form_params] || {}
195
+
196
+ # http body (model)
197
+ post_body = opts[:debug_body]
198
+
199
+ # return_type
200
+ return_type = opts[:debug_return_type] || 'RemoteConfig'
201
+
202
+ # auth_names
203
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
204
+
205
+ new_options = opts.merge(
206
+ :operation => :"PolicyDecisionPointsApi.get_pdp_config_values",
207
+ :header_params => header_params,
208
+ :query_params => query_params,
209
+ :form_params => form_params,
210
+ :body => post_body,
211
+ :auth_names => auth_names,
212
+ :return_type => return_type
213
+ )
214
+
215
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
216
+ if @api_client.config.debugging
217
+ @api_client.config.logger.debug "API called: PolicyDecisionPointsApi#get_pdp_config_values\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
218
+ end
219
+ return data, status_code, headers
220
+ end
221
+
222
+ # List PDP configurations
223
+ # @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \&quot;slug\&quot;).
224
+ # @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \&quot;slug\&quot;).
225
+ # @param [Hash] opts the optional parameters
226
+ # @option opts [Integer] :page Page number of the results to fetch, starting at 1. (default to 1)
227
+ # @option opts [Integer] :per_page The number of results per page (max 100). (default to 30)
228
+ # @return [Array<PDPConfigRead>]
229
+ def list_pdp_configs(proj_id, env_id, opts = {})
230
+ data, _status_code, _headers = list_pdp_configs_with_http_info(proj_id, env_id, opts)
231
+ data
232
+ end
233
+
234
+ # List PDP configurations
235
+ # @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \&quot;slug\&quot;).
236
+ # @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \&quot;slug\&quot;).
237
+ # @param [Hash] opts the optional parameters
238
+ # @option opts [Integer] :page Page number of the results to fetch, starting at 1. (default to 1)
239
+ # @option opts [Integer] :per_page The number of results per page (max 100). (default to 30)
240
+ # @return [Array<(Array<PDPConfigRead>, Integer, Hash)>] Array<PDPConfigRead> data, response status code and response headers
241
+ def list_pdp_configs_with_http_info(proj_id, env_id, opts = {})
242
+ if @api_client.config.debugging
243
+ @api_client.config.logger.debug 'Calling API: PolicyDecisionPointsApi.list_pdp_configs ...'
244
+ end
245
+ # verify the required parameter 'proj_id' is set
246
+ if @api_client.config.client_side_validation && proj_id.nil?
247
+ fail ArgumentError, "Missing the required parameter 'proj_id' when calling PolicyDecisionPointsApi.list_pdp_configs"
248
+ end
249
+ # verify the required parameter 'env_id' is set
250
+ if @api_client.config.client_side_validation && env_id.nil?
251
+ fail ArgumentError, "Missing the required parameter 'env_id' when calling PolicyDecisionPointsApi.list_pdp_configs"
252
+ end
253
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
254
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling PolicyDecisionPointsApi.list_pdp_configs, must be greater than or equal to 1.'
255
+ end
256
+
257
+ if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100
258
+ fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling PolicyDecisionPointsApi.list_pdp_configs, must be smaller than or equal to 100.'
259
+ end
260
+
261
+ if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
262
+ fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling PolicyDecisionPointsApi.list_pdp_configs, must be greater than or equal to 1.'
263
+ end
264
+
265
+ # resource path
266
+ local_var_path = '/v2/pdps/{proj_id}/{env_id}/configs'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s))
267
+
268
+ # query parameters
269
+ query_params = opts[:query_params] || {}
270
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
271
+ query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
272
+
273
+ # header parameters
274
+ header_params = opts[:header_params] || {}
275
+ # HTTP header 'Accept' (if needed)
276
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
277
+
278
+ # form parameters
279
+ form_params = opts[:form_params] || {}
280
+
281
+ # http body (model)
282
+ post_body = opts[:debug_body]
283
+
284
+ # return_type
285
+ return_type = opts[:debug_return_type] || 'Array<PDPConfigRead>'
286
+
287
+ # auth_names
288
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
289
+
290
+ new_options = opts.merge(
291
+ :operation => :"PolicyDecisionPointsApi.list_pdp_configs",
292
+ :header_params => header_params,
293
+ :query_params => query_params,
294
+ :form_params => form_params,
295
+ :body => post_body,
296
+ :auth_names => auth_names,
297
+ :return_type => return_type
298
+ )
299
+
300
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
301
+ if @api_client.config.debugging
302
+ @api_client.config.logger.debug "API called: PolicyDecisionPointsApi#list_pdp_configs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
303
+ end
304
+ return data, status_code, headers
305
+ end
306
+
307
+ # Rotate PDP API Key
308
+ # Rotates the API key of the PDP container with id `pdp_id`. The rotation of the API key revokes the old API key and issues a new API key to the PDP.
309
+ # @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \&quot;slug\&quot;).
310
+ # @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \&quot;slug\&quot;).
311
+ # @param pdp_id [String] The unique id of the pdp
312
+ # @param [Hash] opts the optional parameters
313
+ # @return [PDPConfigRead]
314
+ def rotate_pdp_api_key(proj_id, env_id, pdp_id, opts = {})
315
+ data, _status_code, _headers = rotate_pdp_api_key_with_http_info(proj_id, env_id, pdp_id, opts)
316
+ data
317
+ end
318
+
319
+ # Rotate PDP API Key
320
+ # Rotates the API key of the PDP container with id &#x60;pdp_id&#x60;. The rotation of the API key revokes the old API key and issues a new API key to the PDP.
321
+ # @param proj_id [String] Either the unique id of the project, or the URL-friendly key of the project (i.e: the \&quot;slug\&quot;).
322
+ # @param env_id [String] Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \&quot;slug\&quot;).
323
+ # @param pdp_id [String] The unique id of the pdp
324
+ # @param [Hash] opts the optional parameters
325
+ # @return [Array<(PDPConfigRead, Integer, Hash)>] PDPConfigRead data, response status code and response headers
326
+ def rotate_pdp_api_key_with_http_info(proj_id, env_id, pdp_id, opts = {})
327
+ if @api_client.config.debugging
328
+ @api_client.config.logger.debug 'Calling API: PolicyDecisionPointsApi.rotate_pdp_api_key ...'
329
+ end
330
+ # verify the required parameter 'proj_id' is set
331
+ if @api_client.config.client_side_validation && proj_id.nil?
332
+ fail ArgumentError, "Missing the required parameter 'proj_id' when calling PolicyDecisionPointsApi.rotate_pdp_api_key"
333
+ end
334
+ # verify the required parameter 'env_id' is set
335
+ if @api_client.config.client_side_validation && env_id.nil?
336
+ fail ArgumentError, "Missing the required parameter 'env_id' when calling PolicyDecisionPointsApi.rotate_pdp_api_key"
337
+ end
338
+ # verify the required parameter 'pdp_id' is set
339
+ if @api_client.config.client_side_validation && pdp_id.nil?
340
+ fail ArgumentError, "Missing the required parameter 'pdp_id' when calling PolicyDecisionPointsApi.rotate_pdp_api_key"
341
+ end
342
+ # resource path
343
+ local_var_path = '/v2/pdps/{proj_id}/{env_id}/configs/{pdp_id}/rotate-api-key'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'pdp_id' + '}', CGI.escape(pdp_id.to_s))
344
+
345
+ # query parameters
346
+ query_params = opts[:query_params] || {}
347
+
348
+ # header parameters
349
+ header_params = opts[:header_params] || {}
350
+ # HTTP header 'Accept' (if needed)
351
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
352
+
353
+ # form parameters
354
+ form_params = opts[:form_params] || {}
355
+
356
+ # http body (model)
357
+ post_body = opts[:debug_body]
358
+
359
+ # return_type
360
+ return_type = opts[:debug_return_type] || 'PDPConfigRead'
361
+
362
+ # auth_names
363
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
364
+
365
+ new_options = opts.merge(
366
+ :operation => :"PolicyDecisionPointsApi.rotate_pdp_api_key",
367
+ :header_params => header_params,
368
+ :query_params => query_params,
369
+ :form_params => form_params,
370
+ :body => post_body,
371
+ :auth_names => auth_names,
372
+ :return_type => return_type
373
+ )
374
+
375
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
376
+ if @api_client.config.debugging
377
+ @api_client.config.logger.debug "API called: PolicyDecisionPointsApi#rotate_pdp_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
378
+ end
379
+ return data, status_code, headers
380
+ end
381
+ end
382
+ end