THREESCALE-11887 Add configurable no_match policy option - #1605
Open
borisurbanik wants to merge 1 commit into
Open
THREESCALE-11887 Add configurable no_match policy option#1605borisurbanik wants to merge 1 commit into
borisurbanik wants to merge 1 commit into
Conversation
borisurbanik
force-pushed
the
bu-THREESCALE-11887
branch
from
September 7, 2026 14:12
dee6dd6 to
df726c7
Compare
borisurbanik
force-pushed
the
bu-THREESCALE-11887
branch
from
September 7, 2026 17:02
df726c7 to
1c1afcc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes:
Verification:
Deploy 3Scale and Keycloak using the operators.
The default 3Scale configuration comes with API Product and Developer account that has an echo backend mapped to /echo path.
Configure 3Scale OIDC integration for the API Product following the documentation:
https://docs.redhat.com/en/documentation/red_hat_3scale_api_management/2.16/html/administering_the_api_gateway/integrating-threescale-with-an-openid-connect-identity-provider#integrating-threescale-with-rhsso-as-the-openid-connect-identity-provider_oidc
Add new application under Developer account, set client id and client password environment variables:
CLIENT_ID='(your client id)'
CLIENT_SECRET='(your client secret)'
ACCESS_TOKEN="$(curl -k -X POST "https://keycloak-3scale-keycloak.apps.burbanik-3scale2.cp.fyre.ibm.com/auth/realms/apicast/protocol/openid-connect/token"
-u "$CLIENT_ID:$CLIENT_SECRET"
-H "Content-Type: application/x-www-form-urlencoded"
-d "grant_type=client_credentials" | jq -r '.access_token')"
Verify that the integration is setup correctly:
curl -k -i -H "Authorization: Bearer $ACCESS_TOKEN" https://api-3scale-apicast-staging.apps.burbanik-3scale2.cp.fyre.ibm.com/echo
To test authorized user, add another application and assign a role "my-role" to the corresponding client (this will work with configuration below).
Scenarios tested
details
Configure a keycloak_role_check policy on a standard apicast deployment:
{ "name": "keycloak_role_check", "version": "builtin", "configuration": { "type": "whitelist", "scopes": [ { "realm_roles": [], "resource": "/echo/protected", "client_roles": [ { "client": "{{ jwt.azp }}", "name": "my-role", "client_type": "liquid", "name_type": "plain" } ], "methods": [ "ANY" ], "resource_type": "plain" } ] } }Build and push new image
Update 3scale deployment to switch to the newly built image
After the apicast-staging pod is re-created by operator, test that the authentication works as expected:
details
One the image is updated, update (and publish) the policy to include "allow" no_match option:
Verify that this works as expected now:
details
One the image is updated, update (and publish) the policy to include "blacklist" type and "deny" no_match option:
Verify that this works as expected now: