-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
feat(acl): added a config always_use_authenticated_groups
to support using authenticated groups even when an authenticated consumer exists.
#13184
Conversation
d5f6aaa
to
66e51d0
Compare
66e51d0
to
eef8f21
Compare
eef8f21
to
3056a31
Compare
3056a31
to
3b10c9e
Compare
Please resolve the conflict. |
3b10c9e
to
ac6d84c
Compare
…t using authenticated groups even when an authenticated consumer exists. Currently, authenticated groups will only be used when there is no consumer or the consumer is anonymous. When there is an authenticated consumer, there is no way to use authenticated groups, only the groups associated with the consumer will be used. This PR adds a config `always_use_authenticated_groups` to support using authenticated groups even when an authenticated consumer exists. If enabled, it will first try to use authenticated groups and will fallback to use the groups associated with the consumer if authenticated groups don't exist, which is consistent with the logic in the anonymous consumer case. https://konghq.atlassian.net/browse/FTI-5945
ac6d84c
to
441dc7b
Compare
@@ -16,6 +16,7 @@ return { | |||
type = "array", | |||
elements = { type = "string" }, }, }, | |||
{ hide_groups_header = { type = "boolean", required = true, default = false, description = "If enabled (`true`), prevents the `X-Consumer-Groups` header from being sent in the request to the upstream service." }, }, | |||
{ always_use_authenticated_groups = { type = "boolean", required = true, default = false, description = "If enabled (`true`), the authenticated groups will always be used even when an authenticated consumer already exists. If the authenticated groups don't exist, it will fallback to use the groups associated with the consumer. By default the authenticated groups will only be used when there is no consumer or the consumer is anonymous." } }, |
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.
Which part of the code implements the logic of:
it will fallback to use the groups associated with the consumer
and is it covered in the test?
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.
Yes. The part of the else block. https://github.com/Kong/kong/pull/13184/files#diff-6a2485484a2746e4da00c5a27533d8d45662e48bdf453dd7e596ae5e53e4854dR94
Co-authored-by: Xumin <[email protected]>
Cherry-pick failed for Please cherry-pick the changes locally. git remote add upstream https://github.com/kong/kong-ee
git fetch upstream master
git worktree add -d .worktree/cherry-pick-13184-to-master-to-upstream upstream/master
cd .worktree/cherry-pick-13184-to-master-to-upstream
git checkout -b cherry-pick-13184-to-master-to-upstream
ancref=$(git merge-base 3a1eeed4a7011259b845cc51b9585e1e1c54de76 6f24d0413fc4b0ce99103ba75595f7c08892464f)
git cherry-pick -x $ancref..6f24d0413fc4b0ce99103ba75595f7c08892464f |
…t using authenticated groups even when an authenticated consumer exists. (#13184) * feat(acl): added a config `always_use_authenticated_groups` to support using authenticated groups even when an authenticated consumer exists. Currently, authenticated groups will only be used when there is no consumer or the consumer is anonymous. When there is an authenticated consumer, there is no way to use authenticated groups, only the groups associated with the consumer will be used. This PR adds a config `always_use_authenticated_groups` to support using authenticated groups even when an authenticated consumer exists. If enabled, it will first try to use authenticated groups and will fallback to use the groups associated with the consumer if authenticated groups don't exist, which is consistent with the logic in the anonymous consumer case. https://konghq.atlassian.net/browse/FTI-5945 --------- Co-authored-by: Xumin <[email protected]>
Summary
Currently, authenticated groups will only be used when there is no consumer or the consumer is anonymous. When there is an authenticated consumer, there is no way to use authenticated groups, only the groups associated with the consumer will be used.
This PR adds a config
always_use_authenticated_groups
to support using authenticated groups even when an authenticated consumer exists. If enabled, it will first try to use authenticated groups and will fallback to use the groups associated with the consumer if authenticated groups don't exist, which is consistent with the logic in the anonymous consumer case.Checklist
changelog/unreleased/kong
orskip-changelog
label added on PR if changelog is unnecessary. README.mdIssue reference
https://konghq.atlassian.net/browse/FTI-5945