fix(authz-keycloak): copy permissions before appending http_method_as_scope#13410
Open
shreemaan-abhishek wants to merge 1 commit into
Open
Conversation
…_scope When http_method_as_scope is enabled together with a static permissions list, the request method was appended onto conf.permissions in place. Because the plugin configuration is reused across requests, the appended method scope accumulated on each subsequent request. This copies the permissions list before deriving the per-request method scope, so the shared config is left untouched. A regression test is added.
5 tasks
membphis
approved these changes
May 21, 2026
nic-6443
approved these changes
May 22, 2026
AlinsRan
approved these changes
May 22, 2026
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.
Description
When the
authz-keycloakplugin is configured withhttp_method_as_scopeenabled together with a staticpermissionslist, the request method was appended ontoconf.permissionsin place.Because the plugin configuration object is reused across requests, the appended method scope accumulated on each subsequent request (e.g.
course_resource#GETbecamecourse_resource#GET, GET, thencourse_resource#GET, GET, GET, and so on).This change copies the permissions list with
core.table.clonebefore deriving the per-request method scope, so the shared plugin config is left untouched. Theelsebranch (permission = conf.permissions) is unchanged. A regression test (t/plugin/authz-keycloak5.t) is added that sends two requests through the same configured route and asserts the derived scope does not accumulate.Which issue(s) this PR fixes:
Fixes #
Checklist