ory-keto-client 0.4.3.alpha1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +129 -0
- data/Rakefile +10 -0
- data/docs/AddOryAccessControlPolicyRoleMembers.md +21 -0
- data/docs/AddOryAccessControlPolicyRoleMembersBody.md +17 -0
- data/docs/AddOryAccessControlPolicyRoleMembersInternalServerError.md +17 -0
- data/docs/AddOryAccessControlPolicyRoleMembersInternalServerErrorBody.md +27 -0
- data/docs/AddOryAccessControlPolicyRoleMembersOK.md +17 -0
- data/docs/AuthorizationResult.md +17 -0
- data/docs/DeleteOryAccessControlPolicy.md +19 -0
- data/docs/DeleteOryAccessControlPolicyInternalServerError.md +17 -0
- data/docs/DeleteOryAccessControlPolicyInternalServerErrorBody.md +27 -0
- data/docs/DeleteOryAccessControlPolicyRole.md +19 -0
- data/docs/DeleteOryAccessControlPolicyRoleInternalServerError.md +17 -0
- data/docs/DeleteOryAccessControlPolicyRoleInternalServerErrorBody.md +27 -0
- data/docs/DoOryAccessControlPoliciesAllow.md +19 -0
- data/docs/DoOryAccessControlPoliciesAllowForbidden.md +17 -0
- data/docs/DoOryAccessControlPoliciesAllowInternalServerError.md +17 -0
- data/docs/DoOryAccessControlPoliciesAllowInternalServerErrorBody.md +27 -0
- data/docs/DoOryAccessControlPoliciesAllowOK.md +17 -0
- data/docs/EnginesApi.md +579 -0
- data/docs/GetOryAccessControlPolicy.md +19 -0
- data/docs/GetOryAccessControlPolicyInternalServerError.md +17 -0
- data/docs/GetOryAccessControlPolicyInternalServerErrorBody.md +27 -0
- data/docs/GetOryAccessControlPolicyNotFound.md +17 -0
- data/docs/GetOryAccessControlPolicyNotFoundBody.md +27 -0
- data/docs/GetOryAccessControlPolicyOK.md +17 -0
- data/docs/GetOryAccessControlPolicyRole.md +19 -0
- data/docs/GetOryAccessControlPolicyRoleInternalServerError.md +17 -0
- data/docs/GetOryAccessControlPolicyRoleInternalServerErrorBody.md +27 -0
- data/docs/GetOryAccessControlPolicyRoleNotFound.md +17 -0
- data/docs/GetOryAccessControlPolicyRoleNotFoundBody.md +27 -0
- data/docs/GetOryAccessControlPolicyRoleOK.md +17 -0
- data/docs/HealthApi.md +96 -0
- data/docs/HealthNotReadyStatus.md +17 -0
- data/docs/HealthStatus.md +17 -0
- data/docs/InlineResponse500.md +27 -0
- data/docs/Input.md +23 -0
- data/docs/IsInstanceAliveInternalServerError.md +17 -0
- data/docs/IsInstanceAliveInternalServerErrorBody.md +27 -0
- data/docs/IsInstanceAliveOK.md +17 -0
- data/docs/ListOryAccessControlPolicies.md +21 -0
- data/docs/ListOryAccessControlPoliciesInternalServerError.md +17 -0
- data/docs/ListOryAccessControlPoliciesInternalServerErrorBody.md +27 -0
- data/docs/ListOryAccessControlPoliciesOK.md +17 -0
- data/docs/ListOryAccessControlPolicyRoles.md +21 -0
- data/docs/ListOryAccessControlPolicyRolesInternalServerError.md +17 -0
- data/docs/ListOryAccessControlPolicyRolesInternalServerErrorBody.md +27 -0
- data/docs/ListOryAccessControlPolicyRolesOK.md +17 -0
- data/docs/OryAccessControlPolicies.md +17 -0
- data/docs/OryAccessControlPolicy.md +29 -0
- data/docs/OryAccessControlPolicyAllowedInput.md +23 -0
- data/docs/OryAccessControlPolicyRole.md +19 -0
- data/docs/OryAccessControlPolicyRoles.md +17 -0
- data/docs/Policy.md +29 -0
- data/docs/RemoveOryAccessControlPolicyRoleMembers.md +21 -0
- data/docs/RemoveOryAccessControlPolicyRoleMembersInternalServerError.md +17 -0
- data/docs/RemoveOryAccessControlPolicyRoleMembersInternalServerErrorBody.md +27 -0
- data/docs/Role.md +19 -0
- data/docs/SwaggerHealthStatus.md +17 -0
- data/docs/SwaggerNotReadyStatus.md +17 -0
- data/docs/SwaggerVersion.md +17 -0
- data/docs/UpsertOryAccessControlPolicy.md +19 -0
- data/docs/UpsertOryAccessControlPolicyInternalServerError.md +17 -0
- data/docs/UpsertOryAccessControlPolicyInternalServerErrorBody.md +27 -0
- data/docs/UpsertOryAccessControlPolicyOK.md +17 -0
- data/docs/UpsertOryAccessControlPolicyRole.md +19 -0
- data/docs/UpsertOryAccessControlPolicyRoleInternalServerError.md +17 -0
- data/docs/UpsertOryAccessControlPolicyRoleInternalServerErrorBody.md +27 -0
- data/docs/UpsertOryAccessControlPolicyRoleOK.md +17 -0
- data/docs/Version.md +17 -0
- data/docs/VersionApi.md +52 -0
- data/lib/ory-keto-client.rb +65 -0
- data/lib/ory-keto-client/api/engines_api.rb +778 -0
- data/lib/ory-keto-client/api/health_api.rb +134 -0
- data/lib/ory-keto-client/api/version_api.rb +78 -0
- data/lib/ory-keto-client/api_client.rb +385 -0
- data/lib/ory-keto-client/api_error.rb +57 -0
- data/lib/ory-keto-client/configuration.rb +241 -0
- data/lib/ory-keto-client/models/add_ory_access_control_policy_role_members.rb +237 -0
- data/lib/ory-keto-client/models/add_ory_access_control_policy_role_members_body.rb +209 -0
- data/lib/ory-keto-client/models/add_ory_access_control_policy_role_members_internal_server_error.rb +207 -0
- data/lib/ory-keto-client/models/add_ory_access_control_policy_role_members_internal_server_error_body.rb +260 -0
- data/lib/ory-keto-client/models/add_ory_access_control_policy_role_members_ok.rb +207 -0
- data/lib/ory-keto-client/models/authorization_result.rb +212 -0
- data/lib/ory-keto-client/models/delete_ory_access_control_policy.rb +228 -0
- data/lib/ory-keto-client/models/delete_ory_access_control_policy_internal_server_error.rb +207 -0
- data/lib/ory-keto-client/models/delete_ory_access_control_policy_internal_server_error_body.rb +260 -0
- data/lib/ory-keto-client/models/delete_ory_access_control_policy_role.rb +228 -0
- data/lib/ory-keto-client/models/delete_ory_access_control_policy_role_internal_server_error.rb +207 -0
- data/lib/ory-keto-client/models/delete_ory_access_control_policy_role_internal_server_error_body.rb +260 -0
- data/lib/ory-keto-client/models/do_ory_access_control_policies_allow.rb +222 -0
- data/lib/ory-keto-client/models/do_ory_access_control_policies_allow_forbidden.rb +207 -0
- data/lib/ory-keto-client/models/do_ory_access_control_policies_allow_internal_server_error.rb +207 -0
- data/lib/ory-keto-client/models/do_ory_access_control_policies_allow_internal_server_error_body.rb +260 -0
- data/lib/ory-keto-client/models/do_ory_access_control_policies_allow_ok.rb +207 -0
- data/lib/ory-keto-client/models/get_ory_access_control_policy.rb +228 -0
- data/lib/ory-keto-client/models/get_ory_access_control_policy_internal_server_error.rb +207 -0
- data/lib/ory-keto-client/models/get_ory_access_control_policy_internal_server_error_body.rb +260 -0
- data/lib/ory-keto-client/models/get_ory_access_control_policy_not_found.rb +207 -0
- data/lib/ory-keto-client/models/get_ory_access_control_policy_not_found_body.rb +260 -0
- data/lib/ory-keto-client/models/get_ory_access_control_policy_ok.rb +207 -0
- data/lib/ory-keto-client/models/get_ory_access_control_policy_role.rb +228 -0
- data/lib/ory-keto-client/models/get_ory_access_control_policy_role_internal_server_error.rb +207 -0
- data/lib/ory-keto-client/models/get_ory_access_control_policy_role_internal_server_error_body.rb +260 -0
- data/lib/ory-keto-client/models/get_ory_access_control_policy_role_not_found.rb +207 -0
- data/lib/ory-keto-client/models/get_ory_access_control_policy_role_not_found_body.rb +260 -0
- data/lib/ory-keto-client/models/get_ory_access_control_policy_role_ok.rb +207 -0
- data/lib/ory-keto-client/models/health_not_ready_status.rb +210 -0
- data/lib/ory-keto-client/models/health_status.rb +208 -0
- data/lib/ory-keto-client/models/inline_response500.rb +253 -0
- data/lib/ory-keto-client/models/input.rb +239 -0
- data/lib/ory-keto-client/models/is_instance_alive_internal_server_error.rb +207 -0
- data/lib/ory-keto-client/models/is_instance_alive_internal_server_error_body.rb +260 -0
- data/lib/ory-keto-client/models/is_instance_alive_ok.rb +207 -0
- data/lib/ory-keto-client/models/list_ory_access_control_policies.rb +233 -0
- data/lib/ory-keto-client/models/list_ory_access_control_policies_internal_server_error.rb +207 -0
- data/lib/ory-keto-client/models/list_ory_access_control_policies_internal_server_error_body.rb +260 -0
- data/lib/ory-keto-client/models/list_ory_access_control_policies_ok.rb +210 -0
- data/lib/ory-keto-client/models/list_ory_access_control_policy_roles.rb +233 -0
- data/lib/ory-keto-client/models/list_ory_access_control_policy_roles_internal_server_error.rb +207 -0
- data/lib/ory-keto-client/models/list_ory_access_control_policy_roles_internal_server_error_body.rb +260 -0
- data/lib/ory-keto-client/models/list_ory_access_control_policy_roles_ok.rb +210 -0
- data/lib/ory-keto-client/models/ory_access_control_policies.rb +209 -0
- data/lib/ory-keto-client/models/ory_access_control_policy.rb +275 -0
- data/lib/ory-keto-client/models/ory_access_control_policy_allowed_input.rb +239 -0
- data/lib/ory-keto-client/models/ory_access_control_policy_role.rb +220 -0
- data/lib/ory-keto-client/models/ory_access_control_policy_roles.rb +209 -0
- data/lib/ory-keto-client/models/policy.rb +275 -0
- data/lib/ory-keto-client/models/remove_ory_access_control_policy_role_members.rb +243 -0
- data/lib/ory-keto-client/models/remove_ory_access_control_policy_role_members_internal_server_error.rb +207 -0
- data/lib/ory-keto-client/models/remove_ory_access_control_policy_role_members_internal_server_error_body.rb +260 -0
- data/lib/ory-keto-client/models/role.rb +220 -0
- data/lib/ory-keto-client/models/swagger_health_status.rb +208 -0
- data/lib/ory-keto-client/models/swagger_not_ready_status.rb +210 -0
- data/lib/ory-keto-client/models/swagger_version.rb +208 -0
- data/lib/ory-keto-client/models/upsert_ory_access_control_policy.rb +222 -0
- data/lib/ory-keto-client/models/upsert_ory_access_control_policy_internal_server_error.rb +207 -0
- data/lib/ory-keto-client/models/upsert_ory_access_control_policy_internal_server_error_body.rb +260 -0
- data/lib/ory-keto-client/models/upsert_ory_access_control_policy_ok.rb +207 -0
- data/lib/ory-keto-client/models/upsert_ory_access_control_policy_role.rb +222 -0
- data/lib/ory-keto-client/models/upsert_ory_access_control_policy_role_internal_server_error.rb +207 -0
- data/lib/ory-keto-client/models/upsert_ory_access_control_policy_role_internal_server_error_body.rb +260 -0
- data/lib/ory-keto-client/models/upsert_ory_access_control_policy_role_ok.rb +207 -0
- data/lib/ory-keto-client/models/version.rb +207 -0
- data/lib/ory-keto-client/version.rb +15 -0
- data/ory-keto-client.gemspec +39 -0
- data/spec/api/engines_api_spec.rb +182 -0
- data/spec/api/health_api_spec.rb +57 -0
- data/spec/api/version_api_spec.rb +46 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/add_ory_access_control_policy_role_members_body_spec.rb +41 -0
- data/spec/models/add_ory_access_control_policy_role_members_internal_server_error_body_spec.rb +71 -0
- data/spec/models/add_ory_access_control_policy_role_members_internal_server_error_spec.rb +41 -0
- data/spec/models/add_ory_access_control_policy_role_members_ok_spec.rb +41 -0
- data/spec/models/add_ory_access_control_policy_role_members_spec.rb +53 -0
- data/spec/models/authorization_result_spec.rb +41 -0
- data/spec/models/delete_ory_access_control_policy_internal_server_error_body_spec.rb +71 -0
- data/spec/models/delete_ory_access_control_policy_internal_server_error_spec.rb +41 -0
- data/spec/models/delete_ory_access_control_policy_role_internal_server_error_body_spec.rb +71 -0
- data/spec/models/delete_ory_access_control_policy_role_internal_server_error_spec.rb +41 -0
- data/spec/models/delete_ory_access_control_policy_role_spec.rb +47 -0
- data/spec/models/delete_ory_access_control_policy_spec.rb +47 -0
- data/spec/models/do_ory_access_control_policies_allow_forbidden_spec.rb +41 -0
- data/spec/models/do_ory_access_control_policies_allow_internal_server_error_body_spec.rb +71 -0
- data/spec/models/do_ory_access_control_policies_allow_internal_server_error_spec.rb +41 -0
- data/spec/models/do_ory_access_control_policies_allow_ok_spec.rb +41 -0
- data/spec/models/do_ory_access_control_policies_allow_spec.rb +47 -0
- data/spec/models/get_ory_access_control_policy_internal_server_error_body_spec.rb +71 -0
- data/spec/models/get_ory_access_control_policy_internal_server_error_spec.rb +41 -0
- data/spec/models/get_ory_access_control_policy_not_found_body_spec.rb +71 -0
- data/spec/models/get_ory_access_control_policy_not_found_spec.rb +41 -0
- data/spec/models/get_ory_access_control_policy_ok_spec.rb +41 -0
- data/spec/models/get_ory_access_control_policy_role_internal_server_error_body_spec.rb +71 -0
- data/spec/models/get_ory_access_control_policy_role_internal_server_error_spec.rb +41 -0
- data/spec/models/get_ory_access_control_policy_role_not_found_body_spec.rb +71 -0
- data/spec/models/get_ory_access_control_policy_role_not_found_spec.rb +41 -0
- data/spec/models/get_ory_access_control_policy_role_ok_spec.rb +41 -0
- data/spec/models/get_ory_access_control_policy_role_spec.rb +47 -0
- data/spec/models/get_ory_access_control_policy_spec.rb +47 -0
- data/spec/models/health_not_ready_status_spec.rb +41 -0
- data/spec/models/health_status_spec.rb +41 -0
- data/spec/models/inline_response500_spec.rb +71 -0
- data/spec/models/input_spec.rb +59 -0
- data/spec/models/is_instance_alive_internal_server_error_body_spec.rb +71 -0
- data/spec/models/is_instance_alive_internal_server_error_spec.rb +41 -0
- data/spec/models/is_instance_alive_ok_spec.rb +41 -0
- data/spec/models/list_ory_access_control_policies_internal_server_error_body_spec.rb +71 -0
- data/spec/models/list_ory_access_control_policies_internal_server_error_spec.rb +41 -0
- data/spec/models/list_ory_access_control_policies_ok_spec.rb +41 -0
- data/spec/models/list_ory_access_control_policies_spec.rb +53 -0
- data/spec/models/list_ory_access_control_policy_roles_internal_server_error_body_spec.rb +71 -0
- data/spec/models/list_ory_access_control_policy_roles_internal_server_error_spec.rb +41 -0
- data/spec/models/list_ory_access_control_policy_roles_ok_spec.rb +41 -0
- data/spec/models/list_ory_access_control_policy_roles_spec.rb +53 -0
- data/spec/models/ory_access_control_policies_spec.rb +41 -0
- data/spec/models/ory_access_control_policy_allowed_input_spec.rb +59 -0
- data/spec/models/ory_access_control_policy_role_spec.rb +47 -0
- data/spec/models/ory_access_control_policy_roles_spec.rb +41 -0
- data/spec/models/ory_access_control_policy_spec.rb +77 -0
- data/spec/models/policy_spec.rb +77 -0
- data/spec/models/remove_ory_access_control_policy_role_members_internal_server_error_body_spec.rb +71 -0
- data/spec/models/remove_ory_access_control_policy_role_members_internal_server_error_spec.rb +41 -0
- data/spec/models/remove_ory_access_control_policy_role_members_spec.rb +53 -0
- data/spec/models/role_spec.rb +47 -0
- data/spec/models/swagger_health_status_spec.rb +41 -0
- data/spec/models/swagger_not_ready_status_spec.rb +41 -0
- data/spec/models/swagger_version_spec.rb +41 -0
- data/spec/models/upsert_ory_access_control_policy_internal_server_error_body_spec.rb +71 -0
- data/spec/models/upsert_ory_access_control_policy_internal_server_error_spec.rb +41 -0
- data/spec/models/upsert_ory_access_control_policy_ok_spec.rb +41 -0
- data/spec/models/upsert_ory_access_control_policy_role_internal_server_error_body_spec.rb +71 -0
- data/spec/models/upsert_ory_access_control_policy_role_internal_server_error_spec.rb +41 -0
- data/spec/models/upsert_ory_access_control_policy_role_ok_spec.rb +41 -0
- data/spec/models/upsert_ory_access_control_policy_role_spec.rb +47 -0
- data/spec/models/upsert_ory_access_control_policy_spec.rb +47 -0
- data/spec/models/version_spec.rb +41 -0
- data/spec/spec_helper.rb +111 -0
- metadata +396 -0
@@ -0,0 +1,57 @@
|
|
1
|
+
=begin
|
2
|
+
#ORY Keto
|
3
|
+
|
4
|
+
#Ory Keto is a cloud native access control server providing best-practice patterns (RBAC, ABAC, ACL, AWS IAM Policies, Kubernetes Roles, ...) via REST APIs.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: Latest
|
7
|
+
Contact: hi@ory.sh
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.2
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
module OryHydraClient
|
14
|
+
class ApiError < StandardError
|
15
|
+
attr_reader :code, :response_headers, :response_body
|
16
|
+
|
17
|
+
# Usage examples:
|
18
|
+
# ApiError.new
|
19
|
+
# ApiError.new("message")
|
20
|
+
# ApiError.new(:code => 500, :response_headers => {}, :response_body => "")
|
21
|
+
# ApiError.new(:code => 404, :message => "Not Found")
|
22
|
+
def initialize(arg = nil)
|
23
|
+
if arg.is_a? Hash
|
24
|
+
if arg.key?(:message) || arg.key?('message')
|
25
|
+
super(arg[:message] || arg['message'])
|
26
|
+
else
|
27
|
+
super arg
|
28
|
+
end
|
29
|
+
|
30
|
+
arg.each do |k, v|
|
31
|
+
instance_variable_set "@#{k}", v
|
32
|
+
end
|
33
|
+
else
|
34
|
+
super arg
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
# Override to_s to display a friendly error message
|
39
|
+
def to_s
|
40
|
+
message
|
41
|
+
end
|
42
|
+
|
43
|
+
def message
|
44
|
+
if @message.nil?
|
45
|
+
msg = "Error message: the server returns an error"
|
46
|
+
else
|
47
|
+
msg = @message
|
48
|
+
end
|
49
|
+
|
50
|
+
msg += "\nHTTP status code: #{code}" if code
|
51
|
+
msg += "\nResponse headers: #{response_headers}" if response_headers
|
52
|
+
msg += "\nResponse body: #{response_body}" if response_body
|
53
|
+
|
54
|
+
msg
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,241 @@
|
|
1
|
+
=begin
|
2
|
+
#ORY Keto
|
3
|
+
|
4
|
+
#Ory Keto is a cloud native access control server providing best-practice patterns (RBAC, ABAC, ACL, AWS IAM Policies, Kubernetes Roles, ...) via REST APIs.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: Latest
|
7
|
+
Contact: hi@ory.sh
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.2
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
module OryHydraClient
|
14
|
+
class Configuration
|
15
|
+
# Defines url scheme
|
16
|
+
attr_accessor :scheme
|
17
|
+
|
18
|
+
# Defines url host
|
19
|
+
attr_accessor :host
|
20
|
+
|
21
|
+
# Defines url base path
|
22
|
+
attr_accessor :base_path
|
23
|
+
|
24
|
+
# Defines API keys used with API Key authentications.
|
25
|
+
#
|
26
|
+
# @return [Hash] key: parameter name, value: parameter value (API key)
|
27
|
+
#
|
28
|
+
# @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
|
29
|
+
# config.api_key['api_key'] = 'xxx'
|
30
|
+
attr_accessor :api_key
|
31
|
+
|
32
|
+
# Defines API key prefixes used with API Key authentications.
|
33
|
+
#
|
34
|
+
# @return [Hash] key: parameter name, value: API key prefix
|
35
|
+
#
|
36
|
+
# @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
|
37
|
+
# config.api_key_prefix['api_key'] = 'Token'
|
38
|
+
attr_accessor :api_key_prefix
|
39
|
+
|
40
|
+
# Defines the username used with HTTP basic authentication.
|
41
|
+
#
|
42
|
+
# @return [String]
|
43
|
+
attr_accessor :username
|
44
|
+
|
45
|
+
# Defines the password used with HTTP basic authentication.
|
46
|
+
#
|
47
|
+
# @return [String]
|
48
|
+
attr_accessor :password
|
49
|
+
|
50
|
+
# Defines the access token (Bearer) used with OAuth2.
|
51
|
+
attr_accessor :access_token
|
52
|
+
|
53
|
+
# Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
|
54
|
+
# details will be logged with `logger.debug` (see the `logger` attribute).
|
55
|
+
# Default to false.
|
56
|
+
#
|
57
|
+
# @return [true, false]
|
58
|
+
attr_accessor :debugging
|
59
|
+
|
60
|
+
# Defines the logger used for debugging.
|
61
|
+
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
|
62
|
+
#
|
63
|
+
# @return [#debug]
|
64
|
+
attr_accessor :logger
|
65
|
+
|
66
|
+
# Defines the temporary folder to store downloaded files
|
67
|
+
# (for API endpoints that have file response).
|
68
|
+
# Default to use `Tempfile`.
|
69
|
+
#
|
70
|
+
# @return [String]
|
71
|
+
attr_accessor :temp_folder_path
|
72
|
+
|
73
|
+
# The time limit for HTTP request in seconds.
|
74
|
+
# Default to 0 (never times out).
|
75
|
+
attr_accessor :timeout
|
76
|
+
|
77
|
+
# Set this to false to skip client side validation in the operation.
|
78
|
+
# Default to true.
|
79
|
+
# @return [true, false]
|
80
|
+
attr_accessor :client_side_validation
|
81
|
+
|
82
|
+
### TLS/SSL setting
|
83
|
+
# Set this to false to skip verifying SSL certificate when calling API from https server.
|
84
|
+
# Default to true.
|
85
|
+
#
|
86
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
87
|
+
#
|
88
|
+
# @return [true, false]
|
89
|
+
attr_accessor :verify_ssl
|
90
|
+
|
91
|
+
### TLS/SSL setting
|
92
|
+
# Set this to false to skip verifying SSL host name
|
93
|
+
# Default to true.
|
94
|
+
#
|
95
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
96
|
+
#
|
97
|
+
# @return [true, false]
|
98
|
+
attr_accessor :verify_ssl_host
|
99
|
+
|
100
|
+
### TLS/SSL setting
|
101
|
+
# Set this to customize the certificate file to verify the peer.
|
102
|
+
#
|
103
|
+
# @return [String] the path to the certificate file
|
104
|
+
#
|
105
|
+
# @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
|
106
|
+
# https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
|
107
|
+
attr_accessor :ssl_ca_cert
|
108
|
+
|
109
|
+
### TLS/SSL setting
|
110
|
+
# Client certificate file (for client certificate)
|
111
|
+
attr_accessor :cert_file
|
112
|
+
|
113
|
+
### TLS/SSL setting
|
114
|
+
# Client private key file (for client certificate)
|
115
|
+
attr_accessor :key_file
|
116
|
+
|
117
|
+
# Set this to customize parameters encoding of array parameter with multi collectionFormat.
|
118
|
+
# Default to nil.
|
119
|
+
#
|
120
|
+
# @see The params_encoding option of Ethon. Related source code:
|
121
|
+
# https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
|
122
|
+
attr_accessor :params_encoding
|
123
|
+
|
124
|
+
attr_accessor :inject_format
|
125
|
+
|
126
|
+
attr_accessor :force_ending_format
|
127
|
+
|
128
|
+
def initialize
|
129
|
+
@scheme = 'http'
|
130
|
+
@host = 'localhost'
|
131
|
+
@base_path = ''
|
132
|
+
@api_key = {}
|
133
|
+
@api_key_prefix = {}
|
134
|
+
@timeout = 0
|
135
|
+
@client_side_validation = true
|
136
|
+
@verify_ssl = true
|
137
|
+
@verify_ssl_host = true
|
138
|
+
@params_encoding = nil
|
139
|
+
@cert_file = nil
|
140
|
+
@key_file = nil
|
141
|
+
@debugging = false
|
142
|
+
@inject_format = false
|
143
|
+
@force_ending_format = false
|
144
|
+
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
145
|
+
|
146
|
+
yield(self) if block_given?
|
147
|
+
end
|
148
|
+
|
149
|
+
# The default Configuration object.
|
150
|
+
def self.default
|
151
|
+
@@default ||= Configuration.new
|
152
|
+
end
|
153
|
+
|
154
|
+
def configure
|
155
|
+
yield(self) if block_given?
|
156
|
+
end
|
157
|
+
|
158
|
+
def scheme=(scheme)
|
159
|
+
# remove :// from scheme
|
160
|
+
@scheme = scheme.sub(/:\/\//, '')
|
161
|
+
end
|
162
|
+
|
163
|
+
def host=(host)
|
164
|
+
# remove http(s):// and anything after a slash
|
165
|
+
@host = host.sub(/https?:\/\//, '').split('/').first
|
166
|
+
end
|
167
|
+
|
168
|
+
def base_path=(base_path)
|
169
|
+
# Add leading and trailing slashes to base_path
|
170
|
+
@base_path = "/#{base_path}".gsub(/\/+/, '/')
|
171
|
+
@base_path = '' if @base_path == '/'
|
172
|
+
end
|
173
|
+
|
174
|
+
def base_url
|
175
|
+
"#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
|
176
|
+
end
|
177
|
+
|
178
|
+
# Gets API key (with prefix if set).
|
179
|
+
# @param [String] param_name the parameter name of API key auth
|
180
|
+
def api_key_with_prefix(param_name)
|
181
|
+
if @api_key_prefix[param_name]
|
182
|
+
"#{@api_key_prefix[param_name]} #{@api_key[param_name]}"
|
183
|
+
else
|
184
|
+
@api_key[param_name]
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
# Gets Basic Auth token string
|
189
|
+
def basic_auth_token
|
190
|
+
'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
|
191
|
+
end
|
192
|
+
|
193
|
+
# Returns Auth Settings hash for api client.
|
194
|
+
def auth_settings
|
195
|
+
{
|
196
|
+
}
|
197
|
+
end
|
198
|
+
|
199
|
+
# Returns an array of Server setting
|
200
|
+
def server_settings
|
201
|
+
[
|
202
|
+
{
|
203
|
+
url: "/",
|
204
|
+
description: "No description provided",
|
205
|
+
}
|
206
|
+
]
|
207
|
+
end
|
208
|
+
|
209
|
+
# Returns URL based on server settings
|
210
|
+
#
|
211
|
+
# @param index array index of the server settings
|
212
|
+
# @param variables hash of variable and the corresponding value
|
213
|
+
def server_url(index, variables = {})
|
214
|
+
servers = server_settings
|
215
|
+
|
216
|
+
# check array index out of bound
|
217
|
+
if (index < 0 || index >= servers.size)
|
218
|
+
fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}"
|
219
|
+
end
|
220
|
+
|
221
|
+
server = servers[index]
|
222
|
+
url = server[:url]
|
223
|
+
|
224
|
+
# go through variable and assign a value
|
225
|
+
server[:variables].each do |name, variable|
|
226
|
+
if variables.key?(name)
|
227
|
+
if (server[:variables][name][:enum_values].include? variables[name])
|
228
|
+
url.gsub! "{" + name.to_s + "}", variables[name]
|
229
|
+
else
|
230
|
+
fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
|
231
|
+
end
|
232
|
+
else
|
233
|
+
# use default value
|
234
|
+
url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
238
|
+
url
|
239
|
+
end
|
240
|
+
end
|
241
|
+
end
|
@@ -0,0 +1,237 @@
|
|
1
|
+
=begin
|
2
|
+
#ORY Keto
|
3
|
+
|
4
|
+
#A cloud native access control server providing best-practice patterns (RBAC, ABAC, ACL, AWS IAM Policies, Kubernetes Roles, ...) via REST APIs.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v0.0.0-alpha.37
|
7
|
+
Contact: hi@ory.sh
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.2
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module OryHydraClient
|
16
|
+
# AddOryAccessControlPolicyRoleMembers add ory access control policy role members
|
17
|
+
class AddOryAccessControlPolicyRoleMembers
|
18
|
+
attr_accessor :body
|
19
|
+
|
20
|
+
# The ORY Access Control Policy flavor. Can be \"regex\", \"glob\", and \"exact\". in: path
|
21
|
+
attr_accessor :flavor
|
22
|
+
|
23
|
+
# The ID of the ORY Access Control Policy Role. in: path
|
24
|
+
attr_accessor :id
|
25
|
+
|
26
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
27
|
+
def self.attribute_map
|
28
|
+
{
|
29
|
+
:'body' => :'Body',
|
30
|
+
:'flavor' => :'flavor',
|
31
|
+
:'id' => :'id'
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
# Attribute type mapping.
|
36
|
+
def self.openapi_types
|
37
|
+
{
|
38
|
+
:'body' => :'AddOryAccessControlPolicyRoleMembersBody',
|
39
|
+
:'flavor' => :'String',
|
40
|
+
:'id' => :'String'
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
# List of attributes with nullable: true
|
45
|
+
def self.openapi_nullable
|
46
|
+
Set.new([
|
47
|
+
])
|
48
|
+
end
|
49
|
+
|
50
|
+
# Initializes the object
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
52
|
+
def initialize(attributes = {})
|
53
|
+
if (!attributes.is_a?(Hash))
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::AddOryAccessControlPolicyRoleMembers` initialize method"
|
55
|
+
end
|
56
|
+
|
57
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
58
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
59
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
60
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::AddOryAccessControlPolicyRoleMembers`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
61
|
+
end
|
62
|
+
h[k.to_sym] = v
|
63
|
+
}
|
64
|
+
|
65
|
+
if attributes.key?(:'body')
|
66
|
+
self.body = attributes[:'body']
|
67
|
+
end
|
68
|
+
|
69
|
+
if attributes.key?(:'flavor')
|
70
|
+
self.flavor = attributes[:'flavor']
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.key?(:'id')
|
74
|
+
self.id = attributes[:'id']
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
79
|
+
# @return Array for valid properties with the reasons
|
80
|
+
def list_invalid_properties
|
81
|
+
invalid_properties = Array.new
|
82
|
+
if @flavor.nil?
|
83
|
+
invalid_properties.push('invalid value for "flavor", flavor cannot be nil.')
|
84
|
+
end
|
85
|
+
|
86
|
+
if @id.nil?
|
87
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
88
|
+
end
|
89
|
+
|
90
|
+
invalid_properties
|
91
|
+
end
|
92
|
+
|
93
|
+
# Check to see if the all the properties in the model are valid
|
94
|
+
# @return true if the model is valid
|
95
|
+
def valid?
|
96
|
+
return false if @flavor.nil?
|
97
|
+
return false if @id.nil?
|
98
|
+
true
|
99
|
+
end
|
100
|
+
|
101
|
+
# Checks equality by comparing each attribute.
|
102
|
+
# @param [Object] Object to be compared
|
103
|
+
def ==(o)
|
104
|
+
return true if self.equal?(o)
|
105
|
+
self.class == o.class &&
|
106
|
+
body == o.body &&
|
107
|
+
flavor == o.flavor &&
|
108
|
+
id == o.id
|
109
|
+
end
|
110
|
+
|
111
|
+
# @see the `==` method
|
112
|
+
# @param [Object] Object to be compared
|
113
|
+
def eql?(o)
|
114
|
+
self == o
|
115
|
+
end
|
116
|
+
|
117
|
+
# Calculates hash code according to all attributes.
|
118
|
+
# @return [Integer] Hash code
|
119
|
+
def hash
|
120
|
+
[body, flavor, id].hash
|
121
|
+
end
|
122
|
+
|
123
|
+
# Builds the object from hash
|
124
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
125
|
+
# @return [Object] Returns the model itself
|
126
|
+
def self.build_from_hash(attributes)
|
127
|
+
new.build_from_hash(attributes)
|
128
|
+
end
|
129
|
+
|
130
|
+
# Builds the object from hash
|
131
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
132
|
+
# @return [Object] Returns the model itself
|
133
|
+
def build_from_hash(attributes)
|
134
|
+
return nil unless attributes.is_a?(Hash)
|
135
|
+
self.class.openapi_types.each_pair do |key, type|
|
136
|
+
if type =~ /\AArray<(.*)>/i
|
137
|
+
# check to ensure the input is an array given that the attribute
|
138
|
+
# is documented as an array but the input is not
|
139
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
140
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
141
|
+
end
|
142
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
143
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
144
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
145
|
+
end
|
146
|
+
|
147
|
+
self
|
148
|
+
end
|
149
|
+
|
150
|
+
# Deserializes the data based on type
|
151
|
+
# @param string type Data type
|
152
|
+
# @param string value Value to be deserialized
|
153
|
+
# @return [Object] Deserialized data
|
154
|
+
def _deserialize(type, value)
|
155
|
+
case type.to_sym
|
156
|
+
when :DateTime
|
157
|
+
DateTime.parse(value)
|
158
|
+
when :Date
|
159
|
+
Date.parse(value)
|
160
|
+
when :String
|
161
|
+
value.to_s
|
162
|
+
when :Integer
|
163
|
+
value.to_i
|
164
|
+
when :Float
|
165
|
+
value.to_f
|
166
|
+
when :Boolean
|
167
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
168
|
+
true
|
169
|
+
else
|
170
|
+
false
|
171
|
+
end
|
172
|
+
when :Object
|
173
|
+
# generic object (usually a Hash), return directly
|
174
|
+
value
|
175
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
176
|
+
inner_type = Regexp.last_match[:inner_type]
|
177
|
+
value.map { |v| _deserialize(inner_type, v) }
|
178
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
179
|
+
k_type = Regexp.last_match[:k_type]
|
180
|
+
v_type = Regexp.last_match[:v_type]
|
181
|
+
{}.tap do |hash|
|
182
|
+
value.each do |k, v|
|
183
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
184
|
+
end
|
185
|
+
end
|
186
|
+
else # model
|
187
|
+
OryHydraClient.const_get(type).build_from_hash(value)
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
# Returns the string representation of the object
|
192
|
+
# @return [String] String presentation of the object
|
193
|
+
def to_s
|
194
|
+
to_hash.to_s
|
195
|
+
end
|
196
|
+
|
197
|
+
# to_body is an alias to to_hash (backward compatibility)
|
198
|
+
# @return [Hash] Returns the object in the form of hash
|
199
|
+
def to_body
|
200
|
+
to_hash
|
201
|
+
end
|
202
|
+
|
203
|
+
# Returns the object in the form of hash
|
204
|
+
# @return [Hash] Returns the object in the form of hash
|
205
|
+
def to_hash
|
206
|
+
hash = {}
|
207
|
+
self.class.attribute_map.each_pair do |attr, param|
|
208
|
+
value = self.send(attr)
|
209
|
+
if value.nil?
|
210
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
211
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
212
|
+
end
|
213
|
+
|
214
|
+
hash[param] = _to_hash(value)
|
215
|
+
end
|
216
|
+
hash
|
217
|
+
end
|
218
|
+
|
219
|
+
# Outputs non-array value in the form of hash
|
220
|
+
# For object, use to_hash. Otherwise, just return the value
|
221
|
+
# @param [Object] value Any valid value
|
222
|
+
# @return [Hash] Returns the value in the form of hash
|
223
|
+
def _to_hash(value)
|
224
|
+
if value.is_a?(Array)
|
225
|
+
value.compact.map { |v| _to_hash(v) }
|
226
|
+
elsif value.is_a?(Hash)
|
227
|
+
{}.tap do |hash|
|
228
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
229
|
+
end
|
230
|
+
elsif value.respond_to? :to_hash
|
231
|
+
value.to_hash
|
232
|
+
else
|
233
|
+
value
|
234
|
+
end
|
235
|
+
end
|
236
|
+
end
|
237
|
+
end
|