Skip to content
This repository was archived by the owner on Jun 23, 2026. It is now read-only.

feat: add gateway tokenreview rbac initializer#592

Open
philtk79 wants to merge 2 commits into
mainfrom
feat/add-gateway-tokenreview-rbac-initializer
Open

feat: add gateway tokenreview rbac initializer#592
philtk79 wants to merge 2 commits into
mainfrom
feat/add-gateway-tokenreview-rbac-initializer

Conversation

@philtk79

Copy link
Copy Markdown

Summary

This adds the RBAC required for kubernetes-graphql-gateway to validate user bearer tokens with a scoped provider kubeconfig.
The new TokenReviewRBAC subroutine creates the required ClusterRole and ClusterRoleBindings in org/account workspaces, binding the gateway home workspace identity group to tokenreviews:create and system:kcp:workspace:access.

Test Plan

  • Added unit tests for org, account, nested account, parent root:orgs, missing annotation, and retry behavior.
  • Verified on local Kind that real JWT TokenReview succeeds.
  • Verified GraphQL against root:orgs:<org>:<account> returns HTTP 200 after the gateway routing fix is deployed.

Add a TokenReviewRBAC subroutine that grants the GraphQL gateway scoped
identity permission to perform TokenReview in org and account workspaces.
The subroutine resolves the gateway home logical cluster ID and binds
system:cluster:<id> to both tokenreviews:create and
system:kcp:workspace:access in target workspaces, including account
sub-workspaces and parent root:orgs.

Signed-off-by: Till <253026766+philtk79@users.noreply.github.com>
@philtk79 philtk79 force-pushed the feat/add-gateway-tokenreview-rbac-initializer branch from ba0a1d8 to 86559e3 Compare May 29, 2026 09:53
Signed-off-by: Till <253026766+philtk79@users.noreply.github.com>
@philtk79 philtk79 requested a review from a team as a code owner June 5, 2026 10:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant