Add system:cluster:<logical-cluster> group to effective users to enhance cross-workspace authz#3530
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for cross-workspace authorization by adding the system:cluster:<cluster> group to bind requests, allowing users from one workspace to access resources in another workspace when explicitly authorized. This is part of implementing cross-workspace request authorization through group membership.
- Adds test coverage for various user types (OIDC, service accounts, scoped users, warranted users) binding APIExports across workspaces
- Introduces a utility function for creating service accounts with tokens in test fixtures
- Updates documentation to clarify how scoped users and warrants work with the new cluster group system
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| test/e2e/fixtures/authfixtures/serviceAccount.go | New utility function for creating service accounts with tokens for testing |
| test/e2e/authorizer/scopes_test.go | Updates existing authorization tests with warrant user case and formatting improvements |
| test/e2e/apibinding/cross_workspace_auth_test.go | Comprehensive test suite for cross-workspace APIBinding authorization scenarios |
| pkg/server/server.go | Debug logging import addition (should be removed) |
| go.mod | Removed Kubernetes dependency replacements and updated Go version |
| docs/content/concepts/authorization/authorizers.md | Updated documentation to explain cluster group behavior for scoped users and warrants |
Comments suppressed due to low confidence (1)
go.mod:10
- Go version 1.24.0 does not exist. The latest stable Go version as of my knowledge cutoff is 1.23.x. This appears to be an invalid version number.
go 1.24.0
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
/retest |
|
/test pull-kcp-test-e2e-multiple-runs |
Signed-off-by: Nelo-T. Wallus <red.brush9525@fastmail.com> Signed-off-by: Nelo-T. Wallus <n.wallus@sap.com>
Signed-off-by: Nelo-T. Wallus <red.brush9525@fastmail.com> Signed-off-by: Nelo-T. Wallus <n.wallus@sap.com>
Signed-off-by: Nelo-T. Wallus <red.brush9525@fastmail.com> Signed-off-by: Nelo-T. Wallus <n.wallus@sap.com>
Signed-off-by: Nelo-T. Wallus <red.brush9525@fastmail.com> Signed-off-by: Nelo-T. Wallus <n.wallus@sap.com>
|
/test pull-kcp-test-e2e-sharded |
1 similar comment
|
/test pull-kcp-test-e2e-sharded |
|
/test pull-kcp-test-e2e-multiple-runs |
1 similar comment
|
/test pull-kcp-test-e2e-multiple-runs |
|
/test pull-kcp-test-e2e-multiple-runs |
Co-authored-by: Nelo-T. Wallus <10514301+ntnn@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mjudeikis The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
LGTM label has been added. DetailsGit tree hash: d06ef4ddc040a14bc1e9cdee7edaf38bec6ed74e |
|
/test pull-kcp-test-e2e-shared |
|
/test pull-kcp-test-e2e-sharded |
Summary
Needs kcp-dev/kubernetes#176
This adds tests ensuring that global users (with scopes and with warrants), service accounts and per-workspace users can bind APIExports of another workspace when said workspace allows binding from the source workspace through the
system:cluster:<logical-cluster>group, where<logical-cluster>is the name of the logical cluster backing the source workspace.This is representative of other cross-workspace requests and should work for any cross-workspace authorization check.
Caveat:
Global users without scopes or warrants are not considered at the moment (though could be covered by simply adding the
system:cluster:..group to the request when creating an APIBinding - but that would only work for APIBinding/-Exports). They will still be bound by the usual authorization methods.What Type of PR Is This?
/kind feature
Related Issue(s)
Fixes #3513
Release Notes