-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[THREESCALE-2236] Add methods option on Keycloak policy. #1039
Conversation
a175403
to
ef24d2d
Compare
gateway/src/apicast/policy/keycloak_role_check/keycloak_role_check.lua
Outdated
Show resolved
Hide resolved
gateway/src/apicast/policy/keycloak_role_check/keycloak_role_check.lua
Outdated
Show resolved
Hide resolved
@@ -393,3 +393,160 @@ yay, api backend | |||
--- no_error_log | |||
[error] | |||
oauth failed with | |||
|
|||
|
|||
=== TEST6: Role check with allow methods |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a space between TEST
and 6
? It's just because I don't know if that can cause some issue with the script that we have to automatically number tests correctly. https://github.com/3scale/APIcast/blob/master/script/reorder-tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated all the test.
2861336
to
12e595b
Compare
This commits add the `methods` option on the Keycloak policy. That allow users to define a new policy from any jwt claim, resource and method. To be backwards compatible 'ANY' method is in place, and if methods are not defined this global method will be used and all will work as normal. Example policy: ``` "policy_chain": [ { "name": "apicast.policy.keycloak_role_check", "configuration": { "scopes": [ { "realm_roles": [ { "name": "director" } ], "resource": "/confidential", "methods": ["POST"] } ], "type": "blacklist" } }, { "name": "apicast.policy.apicast" } ] ``` Signed-off-by: Eloy Coto <[email protected]>
This commits adds a ANY method to match any method in the mapping_rule so allow all and only block by the request uri. Signed-off-by: Eloy Coto <[email protected]>
Signed-off-by: Eloy Coto <[email protected]>
Code rebased with master branch, should be ready to merge. |
This commits add the
methods
option on the keycloack policy. Thatallow users to define a new policy from any jwt claim, resource and
method.
To be backwards compatible 'ANY' method is in place, and if methods are
not defined this global method will be used and all will work as normal.
Example policy:
Signed-off-by: Eloy Coto [email protected]