ory-oathkeeper-client 0.0.0.alpha38

Sign up to get free protection for your applications and to get access to all the features.
Files changed (296) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +184 -0
  4. data/Rakefile +10 -0
  5. data/docs/ApiApi.md +450 -0
  6. data/docs/CreateRuleCreated.md +18 -0
  7. data/docs/CreateRuleForbidden.md +18 -0
  8. data/docs/CreateRuleForbiddenBody.md +28 -0
  9. data/docs/CreateRuleInternalServerError.md +18 -0
  10. data/docs/CreateRuleInternalServerErrorBody.md +28 -0
  11. data/docs/CreateRuleUnauthorized.md +18 -0
  12. data/docs/CreateRuleUnauthorizedBody.md +28 -0
  13. data/docs/DecisionsForbidden.md +18 -0
  14. data/docs/DecisionsForbiddenBody.md +28 -0
  15. data/docs/DecisionsInternalServerError.md +18 -0
  16. data/docs/DecisionsInternalServerErrorBody.md +28 -0
  17. data/docs/DecisionsNotFound.md +18 -0
  18. data/docs/DecisionsNotFoundBody.md +28 -0
  19. data/docs/DecisionsUnauthorized.md +18 -0
  20. data/docs/DecisionsUnauthorizedBody.md +28 -0
  21. data/docs/DeleteRuleForbidden.md +18 -0
  22. data/docs/DeleteRuleForbiddenBody.md +28 -0
  23. data/docs/DeleteRuleInternalServerError.md +18 -0
  24. data/docs/DeleteRuleInternalServerErrorBody.md +28 -0
  25. data/docs/DeleteRuleNotFound.md +18 -0
  26. data/docs/DeleteRuleNotFoundBody.md +28 -0
  27. data/docs/DeleteRuleUnauthorized.md +18 -0
  28. data/docs/DeleteRuleUnauthorizedBody.md +28 -0
  29. data/docs/GetRuleForbidden.md +18 -0
  30. data/docs/GetRuleForbiddenBody.md +28 -0
  31. data/docs/GetRuleInternalServerError.md +18 -0
  32. data/docs/GetRuleInternalServerErrorBody.md +28 -0
  33. data/docs/GetRuleNotFound.md +18 -0
  34. data/docs/GetRuleNotFoundBody.md +28 -0
  35. data/docs/GetRuleOK.md +18 -0
  36. data/docs/GetRuleUnauthorized.md +18 -0
  37. data/docs/GetRuleUnauthorizedBody.md +28 -0
  38. data/docs/GetWellKnownForbidden.md +18 -0
  39. data/docs/GetWellKnownForbiddenBody.md +28 -0
  40. data/docs/GetWellKnownJSONWebKeysInternalServerError.md +18 -0
  41. data/docs/GetWellKnownJSONWebKeysInternalServerErrorBody.md +28 -0
  42. data/docs/GetWellKnownJSONWebKeysOK.md +18 -0
  43. data/docs/GetWellKnownOK.md +18 -0
  44. data/docs/GetWellKnownUnauthorized.md +18 -0
  45. data/docs/GetWellKnownUnauthorizedBody.md +28 -0
  46. data/docs/HealthApi.md +96 -0
  47. data/docs/HealthNotReadyStatus.md +18 -0
  48. data/docs/HealthStatus.md +18 -0
  49. data/docs/InlineResponse500.md +28 -0
  50. data/docs/IsInstanceAliveInternalServerError.md +18 -0
  51. data/docs/IsInstanceAliveInternalServerErrorBody.md +28 -0
  52. data/docs/IsInstanceAliveOK.md +18 -0
  53. data/docs/JsonWebKey.md +50 -0
  54. data/docs/JsonWebKeySet.md +18 -0
  55. data/docs/JudgeForbidden.md +18 -0
  56. data/docs/JudgeForbiddenBody.md +28 -0
  57. data/docs/JudgeInternalServerError.md +18 -0
  58. data/docs/JudgeInternalServerErrorBody.md +28 -0
  59. data/docs/JudgeNotFound.md +18 -0
  60. data/docs/JudgeNotFoundBody.md +28 -0
  61. data/docs/JudgeUnauthorized.md +18 -0
  62. data/docs/JudgeUnauthorizedBody.md +28 -0
  63. data/docs/ListRulesForbidden.md +18 -0
  64. data/docs/ListRulesForbiddenBody.md +28 -0
  65. data/docs/ListRulesInternalServerError.md +18 -0
  66. data/docs/ListRulesInternalServerErrorBody.md +28 -0
  67. data/docs/ListRulesOK.md +18 -0
  68. data/docs/ListRulesUnauthorized.md +18 -0
  69. data/docs/ListRulesUnauthorizedBody.md +28 -0
  70. data/docs/Rule.md +30 -0
  71. data/docs/RuleHandler.md +20 -0
  72. data/docs/RuleMatch.md +20 -0
  73. data/docs/SwaggerCreateRuleParameters.md +18 -0
  74. data/docs/SwaggerGetRuleParameters.md +18 -0
  75. data/docs/SwaggerHealthStatus.md +18 -0
  76. data/docs/SwaggerJSONWebKey.md +50 -0
  77. data/docs/SwaggerJSONWebKeySet.md +18 -0
  78. data/docs/SwaggerListRulesParameters.md +20 -0
  79. data/docs/SwaggerNotReadyStatus.md +18 -0
  80. data/docs/SwaggerRule.md +30 -0
  81. data/docs/SwaggerRuleHandler.md +20 -0
  82. data/docs/SwaggerRuleMatch.md +20 -0
  83. data/docs/SwaggerRuleResponse.md +18 -0
  84. data/docs/SwaggerRulesResponse.md +18 -0
  85. data/docs/SwaggerUpdateRuleParameters.md +20 -0
  86. data/docs/SwaggerVersion.md +18 -0
  87. data/docs/UpdateRuleForbidden.md +18 -0
  88. data/docs/UpdateRuleForbiddenBody.md +28 -0
  89. data/docs/UpdateRuleInternalServerError.md +18 -0
  90. data/docs/UpdateRuleInternalServerErrorBody.md +28 -0
  91. data/docs/UpdateRuleNotFound.md +18 -0
  92. data/docs/UpdateRuleNotFoundBody.md +28 -0
  93. data/docs/UpdateRuleOK.md +18 -0
  94. data/docs/UpdateRuleUnauthorized.md +18 -0
  95. data/docs/UpdateRuleUnauthorizedBody.md +28 -0
  96. data/docs/Upstream.md +22 -0
  97. data/docs/Version.md +18 -0
  98. data/docs/VersionApi.md +52 -0
  99. data/lib/ory-oathkeeper-client.rb +131 -0
  100. data/lib/ory-oathkeeper-client/api/api_api.rb +433 -0
  101. data/lib/ory-oathkeeper-client/api/health_api.rb +134 -0
  102. data/lib/ory-oathkeeper-client/api/version_api.rb +78 -0
  103. data/lib/ory-oathkeeper-client/api_client.rb +389 -0
  104. data/lib/ory-oathkeeper-client/api_error.rb +57 -0
  105. data/lib/ory-oathkeeper-client/configuration.rb +270 -0
  106. data/lib/ory-oathkeeper-client/models/create_rule_created.rb +219 -0
  107. data/lib/ory-oathkeeper-client/models/create_rule_forbidden.rb +219 -0
  108. data/lib/ory-oathkeeper-client/models/create_rule_forbidden_body.rb +272 -0
  109. data/lib/ory-oathkeeper-client/models/create_rule_internal_server_error.rb +219 -0
  110. data/lib/ory-oathkeeper-client/models/create_rule_internal_server_error_body.rb +272 -0
  111. data/lib/ory-oathkeeper-client/models/create_rule_unauthorized.rb +219 -0
  112. data/lib/ory-oathkeeper-client/models/create_rule_unauthorized_body.rb +272 -0
  113. data/lib/ory-oathkeeper-client/models/decisions_forbidden.rb +219 -0
  114. data/lib/ory-oathkeeper-client/models/decisions_forbidden_body.rb +272 -0
  115. data/lib/ory-oathkeeper-client/models/decisions_internal_server_error.rb +219 -0
  116. data/lib/ory-oathkeeper-client/models/decisions_internal_server_error_body.rb +272 -0
  117. data/lib/ory-oathkeeper-client/models/decisions_not_found.rb +219 -0
  118. data/lib/ory-oathkeeper-client/models/decisions_not_found_body.rb +272 -0
  119. data/lib/ory-oathkeeper-client/models/decisions_unauthorized.rb +219 -0
  120. data/lib/ory-oathkeeper-client/models/decisions_unauthorized_body.rb +272 -0
  121. data/lib/ory-oathkeeper-client/models/delete_rule_forbidden.rb +219 -0
  122. data/lib/ory-oathkeeper-client/models/delete_rule_forbidden_body.rb +272 -0
  123. data/lib/ory-oathkeeper-client/models/delete_rule_internal_server_error.rb +219 -0
  124. data/lib/ory-oathkeeper-client/models/delete_rule_internal_server_error_body.rb +272 -0
  125. data/lib/ory-oathkeeper-client/models/delete_rule_not_found.rb +219 -0
  126. data/lib/ory-oathkeeper-client/models/delete_rule_not_found_body.rb +272 -0
  127. data/lib/ory-oathkeeper-client/models/delete_rule_unauthorized.rb +219 -0
  128. data/lib/ory-oathkeeper-client/models/delete_rule_unauthorized_body.rb +272 -0
  129. data/lib/ory-oathkeeper-client/models/get_rule_forbidden.rb +219 -0
  130. data/lib/ory-oathkeeper-client/models/get_rule_forbidden_body.rb +272 -0
  131. data/lib/ory-oathkeeper-client/models/get_rule_internal_server_error.rb +219 -0
  132. data/lib/ory-oathkeeper-client/models/get_rule_internal_server_error_body.rb +272 -0
  133. data/lib/ory-oathkeeper-client/models/get_rule_not_found.rb +219 -0
  134. data/lib/ory-oathkeeper-client/models/get_rule_not_found_body.rb +272 -0
  135. data/lib/ory-oathkeeper-client/models/get_rule_ok.rb +219 -0
  136. data/lib/ory-oathkeeper-client/models/get_rule_unauthorized.rb +219 -0
  137. data/lib/ory-oathkeeper-client/models/get_rule_unauthorized_body.rb +272 -0
  138. data/lib/ory-oathkeeper-client/models/get_well_known_forbidden.rb +219 -0
  139. data/lib/ory-oathkeeper-client/models/get_well_known_forbidden_body.rb +272 -0
  140. data/lib/ory-oathkeeper-client/models/get_well_known_json_web_keys_internal_server_error.rb +219 -0
  141. data/lib/ory-oathkeeper-client/models/get_well_known_json_web_keys_internal_server_error_body.rb +272 -0
  142. data/lib/ory-oathkeeper-client/models/get_well_known_json_web_keys_ok.rb +219 -0
  143. data/lib/ory-oathkeeper-client/models/get_well_known_ok.rb +219 -0
  144. data/lib/ory-oathkeeper-client/models/get_well_known_unauthorized.rb +219 -0
  145. data/lib/ory-oathkeeper-client/models/get_well_known_unauthorized_body.rb +272 -0
  146. data/lib/ory-oathkeeper-client/models/health_not_ready_status.rb +221 -0
  147. data/lib/ory-oathkeeper-client/models/health_status.rb +219 -0
  148. data/lib/ory-oathkeeper-client/models/inline_response500.rb +265 -0
  149. data/lib/ory-oathkeeper-client/models/is_instance_alive_internal_server_error.rb +219 -0
  150. data/lib/ory-oathkeeper-client/models/is_instance_alive_internal_server_error_body.rb +272 -0
  151. data/lib/ory-oathkeeper-client/models/is_instance_alive_ok.rb +219 -0
  152. data/lib/ory-oathkeeper-client/models/json_web_key.rb +369 -0
  153. data/lib/ory-oathkeeper-client/models/json_web_key_set.rb +221 -0
  154. data/lib/ory-oathkeeper-client/models/judge_forbidden.rb +219 -0
  155. data/lib/ory-oathkeeper-client/models/judge_forbidden_body.rb +272 -0
  156. data/lib/ory-oathkeeper-client/models/judge_internal_server_error.rb +219 -0
  157. data/lib/ory-oathkeeper-client/models/judge_internal_server_error_body.rb +272 -0
  158. data/lib/ory-oathkeeper-client/models/judge_not_found.rb +219 -0
  159. data/lib/ory-oathkeeper-client/models/judge_not_found_body.rb +272 -0
  160. data/lib/ory-oathkeeper-client/models/judge_unauthorized.rb +219 -0
  161. data/lib/ory-oathkeeper-client/models/judge_unauthorized_body.rb +272 -0
  162. data/lib/ory-oathkeeper-client/models/list_rules_forbidden.rb +219 -0
  163. data/lib/ory-oathkeeper-client/models/list_rules_forbidden_body.rb +272 -0
  164. data/lib/ory-oathkeeper-client/models/list_rules_internal_server_error.rb +219 -0
  165. data/lib/ory-oathkeeper-client/models/list_rules_internal_server_error_body.rb +272 -0
  166. data/lib/ory-oathkeeper-client/models/list_rules_ok.rb +222 -0
  167. data/lib/ory-oathkeeper-client/models/list_rules_unauthorized.rb +219 -0
  168. data/lib/ory-oathkeeper-client/models/list_rules_unauthorized_body.rb +272 -0
  169. data/lib/ory-oathkeeper-client/models/rule.rb +280 -0
  170. data/lib/ory-oathkeeper-client/models/rule_handler.rb +229 -0
  171. data/lib/ory-oathkeeper-client/models/rule_match.rb +231 -0
  172. data/lib/ory-oathkeeper-client/models/swagger_create_rule_parameters.rb +219 -0
  173. data/lib/ory-oathkeeper-client/models/swagger_get_rule_parameters.rb +225 -0
  174. data/lib/ory-oathkeeper-client/models/swagger_health_status.rb +220 -0
  175. data/lib/ory-oathkeeper-client/models/swagger_json_web_key.rb +382 -0
  176. data/lib/ory-oathkeeper-client/models/swagger_json_web_key_set.rb +222 -0
  177. data/lib/ory-oathkeeper-client/models/swagger_list_rules_parameters.rb +230 -0
  178. data/lib/ory-oathkeeper-client/models/swagger_not_ready_status.rb +222 -0
  179. data/lib/ory-oathkeeper-client/models/swagger_rule.rb +280 -0
  180. data/lib/ory-oathkeeper-client/models/swagger_rule_handler.rb +230 -0
  181. data/lib/ory-oathkeeper-client/models/swagger_rule_match.rb +232 -0
  182. data/lib/ory-oathkeeper-client/models/swagger_rule_response.rb +219 -0
  183. data/lib/ory-oathkeeper-client/models/swagger_rules_response.rb +222 -0
  184. data/lib/ory-oathkeeper-client/models/swagger_update_rule_parameters.rb +234 -0
  185. data/lib/ory-oathkeeper-client/models/swagger_version.rb +220 -0
  186. data/lib/ory-oathkeeper-client/models/update_rule_forbidden.rb +219 -0
  187. data/lib/ory-oathkeeper-client/models/update_rule_forbidden_body.rb +272 -0
  188. data/lib/ory-oathkeeper-client/models/update_rule_internal_server_error.rb +219 -0
  189. data/lib/ory-oathkeeper-client/models/update_rule_internal_server_error_body.rb +272 -0
  190. data/lib/ory-oathkeeper-client/models/update_rule_not_found.rb +219 -0
  191. data/lib/ory-oathkeeper-client/models/update_rule_not_found_body.rb +272 -0
  192. data/lib/ory-oathkeeper-client/models/update_rule_ok.rb +219 -0
  193. data/lib/ory-oathkeeper-client/models/update_rule_unauthorized.rb +219 -0
  194. data/lib/ory-oathkeeper-client/models/update_rule_unauthorized_body.rb +272 -0
  195. data/lib/ory-oathkeeper-client/models/upstream.rb +240 -0
  196. data/lib/ory-oathkeeper-client/models/version.rb +219 -0
  197. data/lib/ory-oathkeeper-client/version.rb +15 -0
  198. data/ory-oathkeeper-client.gemspec +38 -0
  199. data/spec/api/api_api_spec.rb +115 -0
  200. data/spec/api/health_api_spec.rb +57 -0
  201. data/spec/api/version_api_spec.rb +46 -0
  202. data/spec/api_client_spec.rb +226 -0
  203. data/spec/configuration_spec.rb +42 -0
  204. data/spec/models/create_rule_created_spec.rb +41 -0
  205. data/spec/models/create_rule_forbidden_body_spec.rb +71 -0
  206. data/spec/models/create_rule_forbidden_spec.rb +41 -0
  207. data/spec/models/create_rule_internal_server_error_body_spec.rb +71 -0
  208. data/spec/models/create_rule_internal_server_error_spec.rb +41 -0
  209. data/spec/models/create_rule_unauthorized_body_spec.rb +71 -0
  210. data/spec/models/create_rule_unauthorized_spec.rb +41 -0
  211. data/spec/models/decisions_forbidden_body_spec.rb +71 -0
  212. data/spec/models/decisions_forbidden_spec.rb +41 -0
  213. data/spec/models/decisions_internal_server_error_body_spec.rb +71 -0
  214. data/spec/models/decisions_internal_server_error_spec.rb +41 -0
  215. data/spec/models/decisions_not_found_body_spec.rb +71 -0
  216. data/spec/models/decisions_not_found_spec.rb +41 -0
  217. data/spec/models/decisions_unauthorized_body_spec.rb +71 -0
  218. data/spec/models/decisions_unauthorized_spec.rb +41 -0
  219. data/spec/models/delete_rule_forbidden_body_spec.rb +71 -0
  220. data/spec/models/delete_rule_forbidden_spec.rb +41 -0
  221. data/spec/models/delete_rule_internal_server_error_body_spec.rb +71 -0
  222. data/spec/models/delete_rule_internal_server_error_spec.rb +41 -0
  223. data/spec/models/delete_rule_not_found_body_spec.rb +71 -0
  224. data/spec/models/delete_rule_not_found_spec.rb +41 -0
  225. data/spec/models/delete_rule_unauthorized_body_spec.rb +71 -0
  226. data/spec/models/delete_rule_unauthorized_spec.rb +41 -0
  227. data/spec/models/get_rule_forbidden_body_spec.rb +71 -0
  228. data/spec/models/get_rule_forbidden_spec.rb +41 -0
  229. data/spec/models/get_rule_internal_server_error_body_spec.rb +71 -0
  230. data/spec/models/get_rule_internal_server_error_spec.rb +41 -0
  231. data/spec/models/get_rule_not_found_body_spec.rb +71 -0
  232. data/spec/models/get_rule_not_found_spec.rb +41 -0
  233. data/spec/models/get_rule_ok_spec.rb +41 -0
  234. data/spec/models/get_rule_unauthorized_body_spec.rb +71 -0
  235. data/spec/models/get_rule_unauthorized_spec.rb +41 -0
  236. data/spec/models/get_well_known_forbidden_body_spec.rb +71 -0
  237. data/spec/models/get_well_known_forbidden_spec.rb +41 -0
  238. data/spec/models/get_well_known_json_web_keys_internal_server_error_body_spec.rb +71 -0
  239. data/spec/models/get_well_known_json_web_keys_internal_server_error_spec.rb +41 -0
  240. data/spec/models/get_well_known_json_web_keys_ok_spec.rb +41 -0
  241. data/spec/models/get_well_known_ok_spec.rb +41 -0
  242. data/spec/models/get_well_known_unauthorized_body_spec.rb +71 -0
  243. data/spec/models/get_well_known_unauthorized_spec.rb +41 -0
  244. data/spec/models/health_not_ready_status_spec.rb +41 -0
  245. data/spec/models/health_status_spec.rb +41 -0
  246. data/spec/models/inline_response500_spec.rb +71 -0
  247. data/spec/models/is_instance_alive_internal_server_error_body_spec.rb +71 -0
  248. data/spec/models/is_instance_alive_internal_server_error_spec.rb +41 -0
  249. data/spec/models/is_instance_alive_ok_spec.rb +41 -0
  250. data/spec/models/json_web_key_set_spec.rb +41 -0
  251. data/spec/models/json_web_key_spec.rb +137 -0
  252. data/spec/models/judge_forbidden_body_spec.rb +71 -0
  253. data/spec/models/judge_forbidden_spec.rb +41 -0
  254. data/spec/models/judge_internal_server_error_body_spec.rb +71 -0
  255. data/spec/models/judge_internal_server_error_spec.rb +41 -0
  256. data/spec/models/judge_not_found_body_spec.rb +71 -0
  257. data/spec/models/judge_not_found_spec.rb +41 -0
  258. data/spec/models/judge_unauthorized_body_spec.rb +71 -0
  259. data/spec/models/judge_unauthorized_spec.rb +41 -0
  260. data/spec/models/list_rules_forbidden_body_spec.rb +71 -0
  261. data/spec/models/list_rules_forbidden_spec.rb +41 -0
  262. data/spec/models/list_rules_internal_server_error_body_spec.rb +71 -0
  263. data/spec/models/list_rules_internal_server_error_spec.rb +41 -0
  264. data/spec/models/list_rules_ok_spec.rb +41 -0
  265. data/spec/models/list_rules_unauthorized_body_spec.rb +71 -0
  266. data/spec/models/list_rules_unauthorized_spec.rb +41 -0
  267. data/spec/models/rule_handler_spec.rb +47 -0
  268. data/spec/models/rule_match_spec.rb +47 -0
  269. data/spec/models/rule_spec.rb +77 -0
  270. data/spec/models/swagger_create_rule_parameters_spec.rb +41 -0
  271. data/spec/models/swagger_get_rule_parameters_spec.rb +41 -0
  272. data/spec/models/swagger_health_status_spec.rb +41 -0
  273. data/spec/models/swagger_json_web_key_set_spec.rb +41 -0
  274. data/spec/models/swagger_json_web_key_spec.rb +137 -0
  275. data/spec/models/swagger_list_rules_parameters_spec.rb +47 -0
  276. data/spec/models/swagger_not_ready_status_spec.rb +41 -0
  277. data/spec/models/swagger_rule_handler_spec.rb +47 -0
  278. data/spec/models/swagger_rule_match_spec.rb +47 -0
  279. data/spec/models/swagger_rule_response_spec.rb +41 -0
  280. data/spec/models/swagger_rule_spec.rb +77 -0
  281. data/spec/models/swagger_rules_response_spec.rb +41 -0
  282. data/spec/models/swagger_update_rule_parameters_spec.rb +47 -0
  283. data/spec/models/swagger_version_spec.rb +41 -0
  284. data/spec/models/update_rule_forbidden_body_spec.rb +71 -0
  285. data/spec/models/update_rule_forbidden_spec.rb +41 -0
  286. data/spec/models/update_rule_internal_server_error_body_spec.rb +71 -0
  287. data/spec/models/update_rule_internal_server_error_spec.rb +41 -0
  288. data/spec/models/update_rule_not_found_body_spec.rb +71 -0
  289. data/spec/models/update_rule_not_found_spec.rb +41 -0
  290. data/spec/models/update_rule_ok_spec.rb +41 -0
  291. data/spec/models/update_rule_unauthorized_body_spec.rb +71 -0
  292. data/spec/models/update_rule_unauthorized_spec.rb +41 -0
  293. data/spec/models/upstream_spec.rb +53 -0
  294. data/spec/models/version_spec.rb +41 -0
  295. data/spec/spec_helper.rb +111 -0
  296. metadata +477 -0
@@ -0,0 +1,231 @@
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: v0.0.0-alpha.38
7
+ Contact: hi@ory.am
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.2.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module OryOathkeeperClient
17
+ class RuleMatch
18
+ # An array of HTTP methods (e.g. GET, POST, PUT, DELETE, ...). When ORY Oathkeeper searches for rules to decide what to do with an incoming request to the proxy server, it compares the HTTP method of the incoming request with the HTTP methods of each rules. If a match is found, the rule is considered a partial match. If the matchesUrl field is satisfied as well, the rule is considered a full match.
19
+ attr_accessor :methods
20
+
21
+ # This field represents the URL pattern this rule matches. When ORY Oathkeeper searches for rules to decide what to do with an incoming request to the proxy server, it compares the full request URL (e.g. https://mydomain.com/api/resource) without query parameters of the incoming request with this field. If a match is found, the rule is considered a partial match. If the matchesMethods field is satisfied as well, the rule is considered a full match. You can use regular expressions in this field to match more than one url. Regular expressions are encapsulated in brackets < and >. The following example matches all paths of the domain `mydomain.com`: `https://mydomain.com/<.*>`.
22
+ attr_accessor :url
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'methods' => :'methods',
28
+ :'url' => :'url'
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'methods' => :'Array<String>',
41
+ :'url' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OryOathkeeperClient::RuleMatch` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OryOathkeeperClient::RuleMatch`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'methods')
67
+ if (value = attributes[:'methods']).is_a?(Array)
68
+ self.methods = value
69
+ end
70
+ end
71
+
72
+ if attributes.key?(:'url')
73
+ self.url = attributes[:'url']
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ invalid_properties = Array.new
81
+ invalid_properties
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ true
88
+ end
89
+
90
+ # Checks equality by comparing each attribute.
91
+ # @param [Object] Object to be compared
92
+ def ==(o)
93
+ return true if self.equal?(o)
94
+ self.class == o.class &&
95
+ methods == o.methods &&
96
+ url == o.url
97
+ end
98
+
99
+ # @see the `==` method
100
+ # @param [Object] Object to be compared
101
+ def eql?(o)
102
+ self == o
103
+ end
104
+
105
+ # Calculates hash code according to all attributes.
106
+ # @return [Integer] Hash code
107
+ def hash
108
+ [methods, url].hash
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def self.build_from_hash(attributes)
115
+ new.build_from_hash(attributes)
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ self.class.openapi_types.each_pair do |key, type|
124
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
125
+ self.send("#{key}=", nil)
126
+ elsif type =~ /\AArray<(.*)>/i
127
+ # check to ensure the input is an array given that the attribute
128
+ # is documented as an array but the input is not
129
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
130
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
131
+ end
132
+ elsif !attributes[self.class.attribute_map[key]].nil?
133
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
134
+ end
135
+ end
136
+
137
+ self
138
+ end
139
+
140
+ # Deserializes the data based on type
141
+ # @param string type Data type
142
+ # @param string value Value to be deserialized
143
+ # @return [Object] Deserialized data
144
+ def _deserialize(type, value)
145
+ case type.to_sym
146
+ when :Time
147
+ Time.parse(value)
148
+ when :Date
149
+ Date.parse(value)
150
+ when :String
151
+ value.to_s
152
+ when :Integer
153
+ value.to_i
154
+ when :Float
155
+ value.to_f
156
+ when :Boolean
157
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
158
+ true
159
+ else
160
+ false
161
+ end
162
+ when :Object
163
+ # generic object (usually a Hash), return directly
164
+ value
165
+ when /\AArray<(?<inner_type>.+)>\z/
166
+ inner_type = Regexp.last_match[:inner_type]
167
+ value.map { |v| _deserialize(inner_type, v) }
168
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
169
+ k_type = Regexp.last_match[:k_type]
170
+ v_type = Regexp.last_match[:v_type]
171
+ {}.tap do |hash|
172
+ value.each do |k, v|
173
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
174
+ end
175
+ end
176
+ else # model
177
+ # models (e.g. Pet) or oneOf
178
+ klass = OryOathkeeperClient.const_get(type)
179
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
180
+ end
181
+ end
182
+
183
+ # Returns the string representation of the object
184
+ # @return [String] String presentation of the object
185
+ def to_s
186
+ to_hash.to_s
187
+ end
188
+
189
+ # to_body is an alias to to_hash (backward compatibility)
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_body
192
+ to_hash
193
+ end
194
+
195
+ # Returns the object in the form of hash
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_hash
198
+ hash = {}
199
+ self.class.attribute_map.each_pair do |attr, param|
200
+ value = self.send(attr)
201
+ if value.nil?
202
+ is_nullable = self.class.openapi_nullable.include?(attr)
203
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
204
+ end
205
+
206
+ hash[param] = _to_hash(value)
207
+ end
208
+ hash
209
+ end
210
+
211
+ # Outputs non-array value in the form of hash
212
+ # For object, use to_hash. Otherwise, just return the value
213
+ # @param [Object] value Any valid value
214
+ # @return [Hash] Returns the value in the form of hash
215
+ def _to_hash(value)
216
+ if value.is_a?(Array)
217
+ value.compact.map { |v| _to_hash(v) }
218
+ elsif value.is_a?(Hash)
219
+ {}.tap do |hash|
220
+ value.each { |k, v| hash[k] = _to_hash(v) }
221
+ end
222
+ elsif value.respond_to? :to_hash
223
+ value.to_hash
224
+ else
225
+ value
226
+ end
227
+ end
228
+
229
+ end
230
+
231
+ end
@@ -0,0 +1,219 @@
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: v0.0.0-alpha.38
7
+ Contact: hi@ory.am
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.2.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module OryOathkeeperClient
17
+ # SwaggerCreateRuleParameters SwaggerCreateRuleParameters SwaggerCreateRuleParameters SwaggerCreateRuleParameters SwaggerCreateRuleParameters swagger create rule parameters
18
+ class SwaggerCreateRuleParameters
19
+ attr_accessor :body
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'body' => :'Body'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'body' => :'SwaggerRule'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OryOathkeeperClient::SwaggerCreateRuleParameters` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OryOathkeeperClient::SwaggerCreateRuleParameters`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'body')
62
+ self.body = attributes[:'body']
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ invalid_properties
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ def valid?
76
+ true
77
+ end
78
+
79
+ # Checks equality by comparing each attribute.
80
+ # @param [Object] Object to be compared
81
+ def ==(o)
82
+ return true if self.equal?(o)
83
+ self.class == o.class &&
84
+ body == o.body
85
+ end
86
+
87
+ # @see the `==` method
88
+ # @param [Object] Object to be compared
89
+ def eql?(o)
90
+ self == o
91
+ end
92
+
93
+ # Calculates hash code according to all attributes.
94
+ # @return [Integer] Hash code
95
+ def hash
96
+ [body].hash
97
+ end
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def self.build_from_hash(attributes)
103
+ new.build_from_hash(attributes)
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ self.class.openapi_types.each_pair do |key, type|
112
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
113
+ self.send("#{key}=", nil)
114
+ elsif type =~ /\AArray<(.*)>/i
115
+ # check to ensure the input is an array given that the attribute
116
+ # is documented as an array but the input is not
117
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
118
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
119
+ end
120
+ elsif !attributes[self.class.attribute_map[key]].nil?
121
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
122
+ end
123
+ end
124
+
125
+ self
126
+ end
127
+
128
+ # Deserializes the data based on type
129
+ # @param string type Data type
130
+ # @param string value Value to be deserialized
131
+ # @return [Object] Deserialized data
132
+ def _deserialize(type, value)
133
+ case type.to_sym
134
+ when :Time
135
+ Time.parse(value)
136
+ when :Date
137
+ Date.parse(value)
138
+ when :String
139
+ value.to_s
140
+ when :Integer
141
+ value.to_i
142
+ when :Float
143
+ value.to_f
144
+ when :Boolean
145
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
146
+ true
147
+ else
148
+ false
149
+ end
150
+ when :Object
151
+ # generic object (usually a Hash), return directly
152
+ value
153
+ when /\AArray<(?<inner_type>.+)>\z/
154
+ inner_type = Regexp.last_match[:inner_type]
155
+ value.map { |v| _deserialize(inner_type, v) }
156
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
157
+ k_type = Regexp.last_match[:k_type]
158
+ v_type = Regexp.last_match[:v_type]
159
+ {}.tap do |hash|
160
+ value.each do |k, v|
161
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
162
+ end
163
+ end
164
+ else # model
165
+ # models (e.g. Pet) or oneOf
166
+ klass = OryOathkeeperClient.const_get(type)
167
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.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
+
217
+ end
218
+
219
+ end