Add system:cluster:... groups to effective users #176
+179
−19
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.
What type of PR is this?
/kind feature
What this PR does / why we need it:
Adds the extra
authentication.kcp.io/scopes
to service accounts similar to per-workspace auth users.Adds the group
system:cluster:...
to effective users based off ofauthentication.kcp.io/scopes
.Needed for github.com/kcp-dev/kcp/pull/3530
Problems
Users that do not originate from per-ws auth and do not have a warrant or scope cannot get a
system:cluster:...
.Originally I had added the group explicitly for APIBinding requests and allowed the group through here. However that pattern would require adding the
system:cluster:
group wherever cross-ws requests can happen.A potential solution could be what this PR proposes with building the groups based off of the scopes as well as allowing
system:clluster:
group through, adding those groups explicitly where necessary (e.g. in APIBinding) request.Since per-ws auth does not allow setting
system:
groups coming from the auth provider that could be reasonably secure. Although it feels very hacky.Alternatively we'd have to update EffectiveUsers/Groups to get the information on the source and target cluster so the correct info can be calculated more accurately.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: