ory-oathkeeper-client 0.35.5.beta1
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 +103 -0
- data/Rakefile +10 -0
- data/docs/ApiApi.md +195 -0
- data/docs/CreateRuleCreated.md +17 -0
- data/docs/CreateRuleForbidden.md +17 -0
- data/docs/CreateRuleForbiddenBody.md +27 -0
- data/docs/CreateRuleInternalServerError.md +17 -0
- data/docs/CreateRuleInternalServerErrorBody.md +27 -0
- data/docs/CreateRuleUnauthorized.md +17 -0
- data/docs/CreateRuleUnauthorizedBody.md +27 -0
- data/docs/DecisionsForbidden.md +17 -0
- data/docs/DecisionsForbiddenBody.md +27 -0
- data/docs/DecisionsInternalServerError.md +17 -0
- data/docs/DecisionsInternalServerErrorBody.md +27 -0
- data/docs/DecisionsNotFound.md +17 -0
- data/docs/DecisionsNotFoundBody.md +27 -0
- data/docs/DecisionsUnauthorized.md +17 -0
- data/docs/DecisionsUnauthorizedBody.md +27 -0
- data/docs/DeleteRuleForbidden.md +17 -0
- data/docs/DeleteRuleForbiddenBody.md +27 -0
- data/docs/DeleteRuleInternalServerError.md +17 -0
- data/docs/DeleteRuleInternalServerErrorBody.md +27 -0
- data/docs/DeleteRuleNotFound.md +17 -0
- data/docs/DeleteRuleNotFoundBody.md +27 -0
- data/docs/DeleteRuleUnauthorized.md +17 -0
- data/docs/DeleteRuleUnauthorizedBody.md +27 -0
- data/docs/GetRuleForbidden.md +17 -0
- data/docs/GetRuleForbiddenBody.md +27 -0
- data/docs/GetRuleInternalServerError.md +17 -0
- data/docs/GetRuleInternalServerErrorBody.md +27 -0
- data/docs/GetRuleNotFound.md +17 -0
- data/docs/GetRuleNotFoundBody.md +27 -0
- data/docs/GetRuleOK.md +17 -0
- data/docs/GetRuleUnauthorized.md +17 -0
- data/docs/GetRuleUnauthorizedBody.md +27 -0
- data/docs/GetWellKnownForbidden.md +17 -0
- data/docs/GetWellKnownForbiddenBody.md +27 -0
- data/docs/GetWellKnownJSONWebKeysInternalServerError.md +17 -0
- data/docs/GetWellKnownJSONWebKeysInternalServerErrorBody.md +27 -0
- data/docs/GetWellKnownJSONWebKeysOK.md +17 -0
- data/docs/GetWellKnownOK.md +17 -0
- data/docs/GetWellKnownUnauthorized.md +17 -0
- data/docs/GetWellKnownUnauthorizedBody.md +27 -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/IsInstanceAliveInternalServerError.md +17 -0
- data/docs/IsInstanceAliveInternalServerErrorBody.md +27 -0
- data/docs/IsInstanceAliveOK.md +17 -0
- data/docs/JsonWebKey.md +49 -0
- data/docs/JsonWebKeySet.md +17 -0
- data/docs/JudgeForbidden.md +17 -0
- data/docs/JudgeForbiddenBody.md +27 -0
- data/docs/JudgeInternalServerError.md +17 -0
- data/docs/JudgeInternalServerErrorBody.md +27 -0
- data/docs/JudgeNotFound.md +17 -0
- data/docs/JudgeNotFoundBody.md +27 -0
- data/docs/JudgeUnauthorized.md +17 -0
- data/docs/JudgeUnauthorizedBody.md +27 -0
- data/docs/ListRulesForbidden.md +17 -0
- data/docs/ListRulesForbiddenBody.md +27 -0
- data/docs/ListRulesInternalServerError.md +17 -0
- data/docs/ListRulesInternalServerErrorBody.md +27 -0
- data/docs/ListRulesOK.md +17 -0
- data/docs/ListRulesUnauthorized.md +17 -0
- data/docs/ListRulesUnauthorizedBody.md +27 -0
- data/docs/Rule.md +29 -0
- data/docs/RuleHandler.md +19 -0
- data/docs/RuleMatch.md +19 -0
- data/docs/SwaggerCreateRuleParameters.md +17 -0
- data/docs/SwaggerGetRuleParameters.md +17 -0
- data/docs/SwaggerHealthStatus.md +17 -0
- data/docs/SwaggerJSONWebKey.md +49 -0
- data/docs/SwaggerJSONWebKeySet.md +17 -0
- data/docs/SwaggerListRulesParameters.md +19 -0
- data/docs/SwaggerNotReadyStatus.md +17 -0
- data/docs/SwaggerRule.md +29 -0
- data/docs/SwaggerRuleHandler.md +19 -0
- data/docs/SwaggerRuleMatch.md +19 -0
- data/docs/SwaggerRuleResponse.md +17 -0
- data/docs/SwaggerRulesResponse.md +17 -0
- data/docs/SwaggerUpdateRuleParameters.md +19 -0
- data/docs/SwaggerVersion.md +17 -0
- data/docs/UpdateRuleForbidden.md +17 -0
- data/docs/UpdateRuleForbiddenBody.md +27 -0
- data/docs/UpdateRuleInternalServerError.md +17 -0
- data/docs/UpdateRuleInternalServerErrorBody.md +27 -0
- data/docs/UpdateRuleNotFound.md +17 -0
- data/docs/UpdateRuleNotFoundBody.md +27 -0
- data/docs/UpdateRuleOK.md +17 -0
- data/docs/UpdateRuleUnauthorized.md +17 -0
- data/docs/UpdateRuleUnauthorizedBody.md +27 -0
- data/docs/Upstream.md +21 -0
- data/docs/Version.md +17 -0
- data/docs/VersionApi.md +52 -0
- data/lib/ory-oathkeeper-client.rb +52 -0
- data/lib/ory-oathkeeper-client/api/api_api.rb +258 -0
- data/lib/ory-oathkeeper-client/api/health_api.rb +134 -0
- data/lib/ory-oathkeeper-client/api/version_api.rb +78 -0
- data/lib/ory-oathkeeper-client/api_client.rb +385 -0
- data/lib/ory-oathkeeper-client/api_error.rb +57 -0
- data/lib/ory-oathkeeper-client/configuration.rb +241 -0
- data/lib/ory-oathkeeper-client/models/create_rule_created.rb +207 -0
- data/lib/ory-oathkeeper-client/models/create_rule_forbidden.rb +207 -0
- data/lib/ory-oathkeeper-client/models/create_rule_forbidden_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/create_rule_internal_server_error.rb +207 -0
- data/lib/ory-oathkeeper-client/models/create_rule_internal_server_error_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/create_rule_unauthorized.rb +207 -0
- data/lib/ory-oathkeeper-client/models/create_rule_unauthorized_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/decisions_forbidden.rb +207 -0
- data/lib/ory-oathkeeper-client/models/decisions_forbidden_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/decisions_internal_server_error.rb +207 -0
- data/lib/ory-oathkeeper-client/models/decisions_internal_server_error_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/decisions_not_found.rb +207 -0
- data/lib/ory-oathkeeper-client/models/decisions_not_found_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/decisions_unauthorized.rb +207 -0
- data/lib/ory-oathkeeper-client/models/decisions_unauthorized_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/delete_rule_forbidden.rb +207 -0
- data/lib/ory-oathkeeper-client/models/delete_rule_forbidden_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/delete_rule_internal_server_error.rb +207 -0
- data/lib/ory-oathkeeper-client/models/delete_rule_internal_server_error_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/delete_rule_not_found.rb +207 -0
- data/lib/ory-oathkeeper-client/models/delete_rule_not_found_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/delete_rule_unauthorized.rb +207 -0
- data/lib/ory-oathkeeper-client/models/delete_rule_unauthorized_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/get_rule_forbidden.rb +207 -0
- data/lib/ory-oathkeeper-client/models/get_rule_forbidden_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/get_rule_internal_server_error.rb +207 -0
- data/lib/ory-oathkeeper-client/models/get_rule_internal_server_error_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/get_rule_not_found.rb +207 -0
- data/lib/ory-oathkeeper-client/models/get_rule_not_found_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/get_rule_ok.rb +207 -0
- data/lib/ory-oathkeeper-client/models/get_rule_unauthorized.rb +207 -0
- data/lib/ory-oathkeeper-client/models/get_rule_unauthorized_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/get_well_known_forbidden.rb +207 -0
- data/lib/ory-oathkeeper-client/models/get_well_known_forbidden_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/get_well_known_json_web_keys_internal_server_error.rb +207 -0
- data/lib/ory-oathkeeper-client/models/get_well_known_json_web_keys_internal_server_error_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/get_well_known_json_web_keys_ok.rb +207 -0
- data/lib/ory-oathkeeper-client/models/get_well_known_ok.rb +207 -0
- data/lib/ory-oathkeeper-client/models/get_well_known_unauthorized.rb +207 -0
- data/lib/ory-oathkeeper-client/models/get_well_known_unauthorized_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/health_not_ready_status.rb +209 -0
- data/lib/ory-oathkeeper-client/models/health_status.rb +207 -0
- data/lib/ory-oathkeeper-client/models/inline_response500.rb +253 -0
- data/lib/ory-oathkeeper-client/models/is_instance_alive_internal_server_error.rb +207 -0
- data/lib/ory-oathkeeper-client/models/is_instance_alive_internal_server_error_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/is_instance_alive_ok.rb +207 -0
- data/lib/ory-oathkeeper-client/models/json_web_key.rb +357 -0
- data/lib/ory-oathkeeper-client/models/json_web_key_set.rb +209 -0
- data/lib/ory-oathkeeper-client/models/judge_forbidden.rb +207 -0
- data/lib/ory-oathkeeper-client/models/judge_forbidden_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/judge_internal_server_error.rb +207 -0
- data/lib/ory-oathkeeper-client/models/judge_internal_server_error_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/judge_not_found.rb +207 -0
- data/lib/ory-oathkeeper-client/models/judge_not_found_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/judge_unauthorized.rb +207 -0
- data/lib/ory-oathkeeper-client/models/judge_unauthorized_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/list_rules_forbidden.rb +207 -0
- data/lib/ory-oathkeeper-client/models/list_rules_forbidden_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/list_rules_internal_server_error.rb +207 -0
- data/lib/ory-oathkeeper-client/models/list_rules_internal_server_error_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/list_rules_ok.rb +210 -0
- data/lib/ory-oathkeeper-client/models/list_rules_unauthorized.rb +207 -0
- data/lib/ory-oathkeeper-client/models/list_rules_unauthorized_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/rule.rb +268 -0
- data/lib/ory-oathkeeper-client/models/rule_handler.rb +217 -0
- data/lib/ory-oathkeeper-client/models/rule_match.rb +219 -0
- data/lib/ory-oathkeeper-client/models/swagger_create_rule_parameters.rb +207 -0
- data/lib/ory-oathkeeper-client/models/swagger_get_rule_parameters.rb +213 -0
- data/lib/ory-oathkeeper-client/models/swagger_health_status.rb +208 -0
- data/lib/ory-oathkeeper-client/models/swagger_json_web_key.rb +370 -0
- data/lib/ory-oathkeeper-client/models/swagger_json_web_key_set.rb +210 -0
- data/lib/ory-oathkeeper-client/models/swagger_list_rules_parameters.rb +218 -0
- data/lib/ory-oathkeeper-client/models/swagger_not_ready_status.rb +210 -0
- data/lib/ory-oathkeeper-client/models/swagger_rule.rb +268 -0
- data/lib/ory-oathkeeper-client/models/swagger_rule_handler.rb +218 -0
- data/lib/ory-oathkeeper-client/models/swagger_rule_match.rb +220 -0
- data/lib/ory-oathkeeper-client/models/swagger_rule_response.rb +207 -0
- data/lib/ory-oathkeeper-client/models/swagger_rules_response.rb +210 -0
- data/lib/ory-oathkeeper-client/models/swagger_update_rule_parameters.rb +222 -0
- data/lib/ory-oathkeeper-client/models/swagger_version.rb +208 -0
- data/lib/ory-oathkeeper-client/models/update_rule_forbidden.rb +207 -0
- data/lib/ory-oathkeeper-client/models/update_rule_forbidden_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/update_rule_internal_server_error.rb +207 -0
- data/lib/ory-oathkeeper-client/models/update_rule_internal_server_error_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/update_rule_not_found.rb +207 -0
- data/lib/ory-oathkeeper-client/models/update_rule_not_found_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/update_rule_ok.rb +207 -0
- data/lib/ory-oathkeeper-client/models/update_rule_unauthorized.rb +207 -0
- data/lib/ory-oathkeeper-client/models/update_rule_unauthorized_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/upstream.rb +227 -0
- data/lib/ory-oathkeeper-client/models/version.rb +207 -0
- data/lib/ory-oathkeeper-client/version.rb +15 -0
- data/ory-oathkeeper-client.gemspec +39 -0
- data/spec/api/api_api_spec.rb +115 -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/create_rule_created_spec.rb +41 -0
- data/spec/models/create_rule_forbidden_body_spec.rb +71 -0
- data/spec/models/create_rule_forbidden_spec.rb +41 -0
- data/spec/models/create_rule_internal_server_error_body_spec.rb +71 -0
- data/spec/models/create_rule_internal_server_error_spec.rb +41 -0
- data/spec/models/create_rule_unauthorized_body_spec.rb +71 -0
- data/spec/models/create_rule_unauthorized_spec.rb +41 -0
- data/spec/models/decisions_forbidden_body_spec.rb +71 -0
- data/spec/models/decisions_forbidden_spec.rb +41 -0
- data/spec/models/decisions_internal_server_error_body_spec.rb +71 -0
- data/spec/models/decisions_internal_server_error_spec.rb +41 -0
- data/spec/models/decisions_not_found_body_spec.rb +71 -0
- data/spec/models/decisions_not_found_spec.rb +41 -0
- data/spec/models/decisions_unauthorized_body_spec.rb +71 -0
- data/spec/models/decisions_unauthorized_spec.rb +41 -0
- data/spec/models/delete_rule_forbidden_body_spec.rb +71 -0
- data/spec/models/delete_rule_forbidden_spec.rb +41 -0
- data/spec/models/delete_rule_internal_server_error_body_spec.rb +71 -0
- data/spec/models/delete_rule_internal_server_error_spec.rb +41 -0
- data/spec/models/delete_rule_not_found_body_spec.rb +71 -0
- data/spec/models/delete_rule_not_found_spec.rb +41 -0
- data/spec/models/delete_rule_unauthorized_body_spec.rb +71 -0
- data/spec/models/delete_rule_unauthorized_spec.rb +41 -0
- data/spec/models/get_rule_forbidden_body_spec.rb +71 -0
- data/spec/models/get_rule_forbidden_spec.rb +41 -0
- data/spec/models/get_rule_internal_server_error_body_spec.rb +71 -0
- data/spec/models/get_rule_internal_server_error_spec.rb +41 -0
- data/spec/models/get_rule_not_found_body_spec.rb +71 -0
- data/spec/models/get_rule_not_found_spec.rb +41 -0
- data/spec/models/get_rule_ok_spec.rb +41 -0
- data/spec/models/get_rule_unauthorized_body_spec.rb +71 -0
- data/spec/models/get_rule_unauthorized_spec.rb +41 -0
- data/spec/models/get_well_known_forbidden_body_spec.rb +71 -0
- data/spec/models/get_well_known_forbidden_spec.rb +41 -0
- data/spec/models/get_well_known_json_web_keys_internal_server_error_body_spec.rb +71 -0
- data/spec/models/get_well_known_json_web_keys_internal_server_error_spec.rb +41 -0
- data/spec/models/get_well_known_json_web_keys_ok_spec.rb +41 -0
- data/spec/models/get_well_known_ok_spec.rb +41 -0
- data/spec/models/get_well_known_unauthorized_body_spec.rb +71 -0
- data/spec/models/get_well_known_unauthorized_spec.rb +41 -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/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/json_web_key_set_spec.rb +41 -0
- data/spec/models/json_web_key_spec.rb +137 -0
- data/spec/models/judge_forbidden_body_spec.rb +71 -0
- data/spec/models/judge_forbidden_spec.rb +41 -0
- data/spec/models/judge_internal_server_error_body_spec.rb +71 -0
- data/spec/models/judge_internal_server_error_spec.rb +41 -0
- data/spec/models/judge_not_found_body_spec.rb +71 -0
- data/spec/models/judge_not_found_spec.rb +41 -0
- data/spec/models/judge_unauthorized_body_spec.rb +71 -0
- data/spec/models/judge_unauthorized_spec.rb +41 -0
- data/spec/models/list_rules_forbidden_body_spec.rb +71 -0
- data/spec/models/list_rules_forbidden_spec.rb +41 -0
- data/spec/models/list_rules_internal_server_error_body_spec.rb +71 -0
- data/spec/models/list_rules_internal_server_error_spec.rb +41 -0
- data/spec/models/list_rules_ok_spec.rb +41 -0
- data/spec/models/list_rules_unauthorized_body_spec.rb +71 -0
- data/spec/models/list_rules_unauthorized_spec.rb +41 -0
- data/spec/models/rule_handler_spec.rb +47 -0
- data/spec/models/rule_match_spec.rb +47 -0
- data/spec/models/rule_spec.rb +77 -0
- data/spec/models/swagger_create_rule_parameters_spec.rb +41 -0
- data/spec/models/swagger_get_rule_parameters_spec.rb +41 -0
- data/spec/models/swagger_health_status_spec.rb +41 -0
- data/spec/models/swagger_json_web_key_set_spec.rb +41 -0
- data/spec/models/swagger_json_web_key_spec.rb +137 -0
- data/spec/models/swagger_list_rules_parameters_spec.rb +47 -0
- data/spec/models/swagger_not_ready_status_spec.rb +41 -0
- data/spec/models/swagger_rule_handler_spec.rb +47 -0
- data/spec/models/swagger_rule_match_spec.rb +47 -0
- data/spec/models/swagger_rule_response_spec.rb +41 -0
- data/spec/models/swagger_rule_spec.rb +77 -0
- data/spec/models/swagger_rules_response_spec.rb +41 -0
- data/spec/models/swagger_update_rule_parameters_spec.rb +47 -0
- data/spec/models/swagger_version_spec.rb +41 -0
- data/spec/models/update_rule_forbidden_body_spec.rb +71 -0
- data/spec/models/update_rule_forbidden_spec.rb +41 -0
- data/spec/models/update_rule_internal_server_error_body_spec.rb +71 -0
- data/spec/models/update_rule_internal_server_error_spec.rb +41 -0
- data/spec/models/update_rule_not_found_body_spec.rb +71 -0
- data/spec/models/update_rule_not_found_spec.rb +41 -0
- data/spec/models/update_rule_ok_spec.rb +41 -0
- data/spec/models/update_rule_unauthorized_body_spec.rb +71 -0
- data/spec/models/update_rule_unauthorized_spec.rb +41 -0
- data/spec/models/upstream_spec.rb +53 -0
- data/spec/models/version_spec.rb +41 -0
- data/spec/spec_helper.rb +111 -0
- metadata +497 -0
@@ -0,0 +1,268 @@
|
|
1
|
+
=begin
|
2
|
+
#ORY Oathkeeper
|
3
|
+
|
4
|
+
#ORY Oathkeeper is a reverse proxy that checks the HTTP Authorization for validity against a set of rules. This service uses Hydra to validate access tokens and policies.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: Latest
|
7
|
+
Contact: hi@ory.am
|
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
|
+
class Rule
|
17
|
+
# Authenticators is a list of authentication handlers that will try and authenticate the provided credentials. Authenticators are checked iteratively from index 0 to n and if the first authenticator to return a positive result will be the one used. If you want the rule to first check a specific authenticator before \"falling back\" to others, have that authenticator as the first item in the array.
|
18
|
+
attr_accessor :authenticators
|
19
|
+
|
20
|
+
attr_accessor :authorizer
|
21
|
+
|
22
|
+
# Description is a human readable description of this rule.
|
23
|
+
attr_accessor :description
|
24
|
+
|
25
|
+
# ID is the unique id of the rule. It can be at most 190 characters long, but the layout of the ID is up to you. You will need this ID later on to update or delete the rule.
|
26
|
+
attr_accessor :id
|
27
|
+
|
28
|
+
attr_accessor :match
|
29
|
+
|
30
|
+
# Mutators is a list of mutation handlers that transform the HTTP request. A common use case is generating a new set of credentials (e.g. JWT) which then will be forwarded to the upstream server. Mutations are performed iteratively from index 0 to n and should all succeed in order for the HTTP request to be forwarded.
|
31
|
+
attr_accessor :mutators
|
32
|
+
|
33
|
+
attr_accessor :upstream
|
34
|
+
|
35
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
36
|
+
def self.attribute_map
|
37
|
+
{
|
38
|
+
:'authenticators' => :'authenticators',
|
39
|
+
:'authorizer' => :'authorizer',
|
40
|
+
:'description' => :'description',
|
41
|
+
:'id' => :'id',
|
42
|
+
:'match' => :'match',
|
43
|
+
:'mutators' => :'mutators',
|
44
|
+
:'upstream' => :'upstream'
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# Attribute type mapping.
|
49
|
+
def self.openapi_types
|
50
|
+
{
|
51
|
+
:'authenticators' => :'Array<RuleHandler>',
|
52
|
+
:'authorizer' => :'RuleHandler',
|
53
|
+
:'description' => :'String',
|
54
|
+
:'id' => :'String',
|
55
|
+
:'match' => :'RuleMatch',
|
56
|
+
:'mutators' => :'Array<RuleHandler>',
|
57
|
+
:'upstream' => :'Upstream'
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
# List of attributes with nullable: true
|
62
|
+
def self.openapi_nullable
|
63
|
+
Set.new([
|
64
|
+
])
|
65
|
+
end
|
66
|
+
|
67
|
+
# Initializes the object
|
68
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
69
|
+
def initialize(attributes = {})
|
70
|
+
if (!attributes.is_a?(Hash))
|
71
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::Rule` initialize method"
|
72
|
+
end
|
73
|
+
|
74
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
75
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
76
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
77
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::Rule`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
78
|
+
end
|
79
|
+
h[k.to_sym] = v
|
80
|
+
}
|
81
|
+
|
82
|
+
if attributes.key?(:'authenticators')
|
83
|
+
if (value = attributes[:'authenticators']).is_a?(Array)
|
84
|
+
self.authenticators = value
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
if attributes.key?(:'authorizer')
|
89
|
+
self.authorizer = attributes[:'authorizer']
|
90
|
+
end
|
91
|
+
|
92
|
+
if attributes.key?(:'description')
|
93
|
+
self.description = attributes[:'description']
|
94
|
+
end
|
95
|
+
|
96
|
+
if attributes.key?(:'id')
|
97
|
+
self.id = attributes[:'id']
|
98
|
+
end
|
99
|
+
|
100
|
+
if attributes.key?(:'match')
|
101
|
+
self.match = attributes[:'match']
|
102
|
+
end
|
103
|
+
|
104
|
+
if attributes.key?(:'mutators')
|
105
|
+
if (value = attributes[:'mutators']).is_a?(Array)
|
106
|
+
self.mutators = value
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.key?(:'upstream')
|
111
|
+
self.upstream = attributes[:'upstream']
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
116
|
+
# @return Array for valid properties with the reasons
|
117
|
+
def list_invalid_properties
|
118
|
+
invalid_properties = Array.new
|
119
|
+
invalid_properties
|
120
|
+
end
|
121
|
+
|
122
|
+
# Check to see if the all the properties in the model are valid
|
123
|
+
# @return true if the model is valid
|
124
|
+
def valid?
|
125
|
+
true
|
126
|
+
end
|
127
|
+
|
128
|
+
# Checks equality by comparing each attribute.
|
129
|
+
# @param [Object] Object to be compared
|
130
|
+
def ==(o)
|
131
|
+
return true if self.equal?(o)
|
132
|
+
self.class == o.class &&
|
133
|
+
authenticators == o.authenticators &&
|
134
|
+
authorizer == o.authorizer &&
|
135
|
+
description == o.description &&
|
136
|
+
id == o.id &&
|
137
|
+
match == o.match &&
|
138
|
+
mutators == o.mutators &&
|
139
|
+
upstream == o.upstream
|
140
|
+
end
|
141
|
+
|
142
|
+
# @see the `==` method
|
143
|
+
# @param [Object] Object to be compared
|
144
|
+
def eql?(o)
|
145
|
+
self == o
|
146
|
+
end
|
147
|
+
|
148
|
+
# Calculates hash code according to all attributes.
|
149
|
+
# @return [Integer] Hash code
|
150
|
+
def hash
|
151
|
+
[authenticators, authorizer, description, id, match, mutators, upstream].hash
|
152
|
+
end
|
153
|
+
|
154
|
+
# Builds the object from hash
|
155
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
156
|
+
# @return [Object] Returns the model itself
|
157
|
+
def self.build_from_hash(attributes)
|
158
|
+
new.build_from_hash(attributes)
|
159
|
+
end
|
160
|
+
|
161
|
+
# Builds the object from hash
|
162
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
163
|
+
# @return [Object] Returns the model itself
|
164
|
+
def build_from_hash(attributes)
|
165
|
+
return nil unless attributes.is_a?(Hash)
|
166
|
+
self.class.openapi_types.each_pair do |key, type|
|
167
|
+
if type =~ /\AArray<(.*)>/i
|
168
|
+
# check to ensure the input is an array given that the attribute
|
169
|
+
# is documented as an array but the input is not
|
170
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
171
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
172
|
+
end
|
173
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
174
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
175
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
176
|
+
end
|
177
|
+
|
178
|
+
self
|
179
|
+
end
|
180
|
+
|
181
|
+
# Deserializes the data based on type
|
182
|
+
# @param string type Data type
|
183
|
+
# @param string value Value to be deserialized
|
184
|
+
# @return [Object] Deserialized data
|
185
|
+
def _deserialize(type, value)
|
186
|
+
case type.to_sym
|
187
|
+
when :DateTime
|
188
|
+
DateTime.parse(value)
|
189
|
+
when :Date
|
190
|
+
Date.parse(value)
|
191
|
+
when :String
|
192
|
+
value.to_s
|
193
|
+
when :Integer
|
194
|
+
value.to_i
|
195
|
+
when :Float
|
196
|
+
value.to_f
|
197
|
+
when :Boolean
|
198
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
199
|
+
true
|
200
|
+
else
|
201
|
+
false
|
202
|
+
end
|
203
|
+
when :Object
|
204
|
+
# generic object (usually a Hash), return directly
|
205
|
+
value
|
206
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
207
|
+
inner_type = Regexp.last_match[:inner_type]
|
208
|
+
value.map { |v| _deserialize(inner_type, v) }
|
209
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
210
|
+
k_type = Regexp.last_match[:k_type]
|
211
|
+
v_type = Regexp.last_match[:v_type]
|
212
|
+
{}.tap do |hash|
|
213
|
+
value.each do |k, v|
|
214
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
215
|
+
end
|
216
|
+
end
|
217
|
+
else # model
|
218
|
+
OryHydraClient.const_get(type).build_from_hash(value)
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
222
|
+
# Returns the string representation of the object
|
223
|
+
# @return [String] String presentation of the object
|
224
|
+
def to_s
|
225
|
+
to_hash.to_s
|
226
|
+
end
|
227
|
+
|
228
|
+
# to_body is an alias to to_hash (backward compatibility)
|
229
|
+
# @return [Hash] Returns the object in the form of hash
|
230
|
+
def to_body
|
231
|
+
to_hash
|
232
|
+
end
|
233
|
+
|
234
|
+
# Returns the object in the form of hash
|
235
|
+
# @return [Hash] Returns the object in the form of hash
|
236
|
+
def to_hash
|
237
|
+
hash = {}
|
238
|
+
self.class.attribute_map.each_pair do |attr, param|
|
239
|
+
value = self.send(attr)
|
240
|
+
if value.nil?
|
241
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
242
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
243
|
+
end
|
244
|
+
|
245
|
+
hash[param] = _to_hash(value)
|
246
|
+
end
|
247
|
+
hash
|
248
|
+
end
|
249
|
+
|
250
|
+
# Outputs non-array value in the form of hash
|
251
|
+
# For object, use to_hash. Otherwise, just return the value
|
252
|
+
# @param [Object] value Any valid value
|
253
|
+
# @return [Hash] Returns the value in the form of hash
|
254
|
+
def _to_hash(value)
|
255
|
+
if value.is_a?(Array)
|
256
|
+
value.compact.map { |v| _to_hash(v) }
|
257
|
+
elsif value.is_a?(Hash)
|
258
|
+
{}.tap do |hash|
|
259
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
260
|
+
end
|
261
|
+
elsif value.respond_to? :to_hash
|
262
|
+
value.to_hash
|
263
|
+
else
|
264
|
+
value
|
265
|
+
end
|
266
|
+
end
|
267
|
+
end
|
268
|
+
end
|
@@ -0,0 +1,217 @@
|
|
1
|
+
=begin
|
2
|
+
#ORY Oathkeeper
|
3
|
+
|
4
|
+
#ORY Oathkeeper is a reverse proxy that checks the HTTP Authorization for validity against a set of rules. This service uses Hydra to validate access tokens and policies.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: Latest
|
7
|
+
Contact: hi@ory.am
|
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
|
+
class RuleHandler
|
17
|
+
# Config contains the configuration for the handler. Please read the user guide for a complete list of each handler's available settings.
|
18
|
+
attr_accessor :config
|
19
|
+
|
20
|
+
# Handler identifies the implementation which will be used to handle this specific request. Please read the user guide for a complete list of available handlers.
|
21
|
+
attr_accessor :handler
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'config' => :'config',
|
27
|
+
:'handler' => :'handler'
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
# Attribute type mapping.
|
32
|
+
def self.openapi_types
|
33
|
+
{
|
34
|
+
:'config' => :'Object',
|
35
|
+
:'handler' => :'String'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# List of attributes with nullable: true
|
40
|
+
def self.openapi_nullable
|
41
|
+
Set.new([
|
42
|
+
])
|
43
|
+
end
|
44
|
+
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
+
def initialize(attributes = {})
|
48
|
+
if (!attributes.is_a?(Hash))
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::RuleHandler` initialize method"
|
50
|
+
end
|
51
|
+
|
52
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
53
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::RuleHandler`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
|
+
end
|
57
|
+
h[k.to_sym] = v
|
58
|
+
}
|
59
|
+
|
60
|
+
if attributes.key?(:'config')
|
61
|
+
self.config = attributes[:'config']
|
62
|
+
end
|
63
|
+
|
64
|
+
if attributes.key?(:'handler')
|
65
|
+
self.handler = attributes[:'handler']
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
70
|
+
# @return Array for valid properties with the reasons
|
71
|
+
def list_invalid_properties
|
72
|
+
invalid_properties = Array.new
|
73
|
+
invalid_properties
|
74
|
+
end
|
75
|
+
|
76
|
+
# Check to see if the all the properties in the model are valid
|
77
|
+
# @return true if the model is valid
|
78
|
+
def valid?
|
79
|
+
true
|
80
|
+
end
|
81
|
+
|
82
|
+
# Checks equality by comparing each attribute.
|
83
|
+
# @param [Object] Object to be compared
|
84
|
+
def ==(o)
|
85
|
+
return true if self.equal?(o)
|
86
|
+
self.class == o.class &&
|
87
|
+
config == o.config &&
|
88
|
+
handler == o.handler
|
89
|
+
end
|
90
|
+
|
91
|
+
# @see the `==` method
|
92
|
+
# @param [Object] Object to be compared
|
93
|
+
def eql?(o)
|
94
|
+
self == o
|
95
|
+
end
|
96
|
+
|
97
|
+
# Calculates hash code according to all attributes.
|
98
|
+
# @return [Integer] Hash code
|
99
|
+
def hash
|
100
|
+
[config, handler].hash
|
101
|
+
end
|
102
|
+
|
103
|
+
# Builds the object from hash
|
104
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
105
|
+
# @return [Object] Returns the model itself
|
106
|
+
def self.build_from_hash(attributes)
|
107
|
+
new.build_from_hash(attributes)
|
108
|
+
end
|
109
|
+
|
110
|
+
# Builds the object from hash
|
111
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
112
|
+
# @return [Object] Returns the model itself
|
113
|
+
def build_from_hash(attributes)
|
114
|
+
return nil unless attributes.is_a?(Hash)
|
115
|
+
self.class.openapi_types.each_pair do |key, type|
|
116
|
+
if type =~ /\AArray<(.*)>/i
|
117
|
+
# check to ensure the input is an array given that the attribute
|
118
|
+
# is documented as an array but the input is not
|
119
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
120
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
121
|
+
end
|
122
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
123
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
124
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
125
|
+
end
|
126
|
+
|
127
|
+
self
|
128
|
+
end
|
129
|
+
|
130
|
+
# Deserializes the data based on type
|
131
|
+
# @param string type Data type
|
132
|
+
# @param string value Value to be deserialized
|
133
|
+
# @return [Object] Deserialized data
|
134
|
+
def _deserialize(type, value)
|
135
|
+
case type.to_sym
|
136
|
+
when :DateTime
|
137
|
+
DateTime.parse(value)
|
138
|
+
when :Date
|
139
|
+
Date.parse(value)
|
140
|
+
when :String
|
141
|
+
value.to_s
|
142
|
+
when :Integer
|
143
|
+
value.to_i
|
144
|
+
when :Float
|
145
|
+
value.to_f
|
146
|
+
when :Boolean
|
147
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
148
|
+
true
|
149
|
+
else
|
150
|
+
false
|
151
|
+
end
|
152
|
+
when :Object
|
153
|
+
# generic object (usually a Hash), return directly
|
154
|
+
value
|
155
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
156
|
+
inner_type = Regexp.last_match[:inner_type]
|
157
|
+
value.map { |v| _deserialize(inner_type, v) }
|
158
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
159
|
+
k_type = Regexp.last_match[:k_type]
|
160
|
+
v_type = Regexp.last_match[:v_type]
|
161
|
+
{}.tap do |hash|
|
162
|
+
value.each do |k, v|
|
163
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
else # model
|
167
|
+
OryHydraClient.const_get(type).build_from_hash(value)
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
# Returns the string representation of the object
|
172
|
+
# @return [String] String presentation of the object
|
173
|
+
def to_s
|
174
|
+
to_hash.to_s
|
175
|
+
end
|
176
|
+
|
177
|
+
# to_body is an alias to to_hash (backward compatibility)
|
178
|
+
# @return [Hash] Returns the object in the form of hash
|
179
|
+
def to_body
|
180
|
+
to_hash
|
181
|
+
end
|
182
|
+
|
183
|
+
# Returns the object in the form of hash
|
184
|
+
# @return [Hash] Returns the object in the form of hash
|
185
|
+
def to_hash
|
186
|
+
hash = {}
|
187
|
+
self.class.attribute_map.each_pair do |attr, param|
|
188
|
+
value = self.send(attr)
|
189
|
+
if value.nil?
|
190
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
191
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
192
|
+
end
|
193
|
+
|
194
|
+
hash[param] = _to_hash(value)
|
195
|
+
end
|
196
|
+
hash
|
197
|
+
end
|
198
|
+
|
199
|
+
# Outputs non-array value in the form of hash
|
200
|
+
# For object, use to_hash. Otherwise, just return the value
|
201
|
+
# @param [Object] value Any valid value
|
202
|
+
# @return [Hash] Returns the value in the form of hash
|
203
|
+
def _to_hash(value)
|
204
|
+
if value.is_a?(Array)
|
205
|
+
value.compact.map { |v| _to_hash(v) }
|
206
|
+
elsif value.is_a?(Hash)
|
207
|
+
{}.tap do |hash|
|
208
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
209
|
+
end
|
210
|
+
elsif value.respond_to? :to_hash
|
211
|
+
value.to_hash
|
212
|
+
else
|
213
|
+
value
|
214
|
+
end
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|