Repository navigation
feat: stamp strategy and groups on every <user>-clientconfig Secret (#42) - #43
Closed
braghettos wants to merge 2 commits into
Closed
braghettos wants to merge 2 commits into
braghettos wants to merge 2 commits into
Conversation
…nt/login (#36) The response's `data` carried the issued identity's full kubeconfig, including client-key-data (a private key), so printing a success response leaked it. The response now carries only accessToken, user and groups. The generator still mints the identity and persists <username>-clientconfig, which plumbing endpoints, snowplow and bff read from the Secret. Before the change, a grep across 56 repos found four clients of the endpoint, all decoding accessToken only: core-provider, its cdc, rest-dynamic-controller and snowplow. The human strategies are unchanged. Adds a handler test against a fake apiserver. It asserts that the response has no data and no client-key-data and that the clientconfig is still minted; it fails on the previous handler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TLFnUe4HXFphxQNAfqFawZ
) Tenant onboarding fires on every clientconfig Secret, but nothing on them told a tenant from a platform admin or from authn's own identity. Every clientconfig authn writes now carries: - authn.krateo.io/strategy: basic|ldap|oauth|oidc|serviceaccount, or self for authn's own identity (via the certificate renewer) - authn.krateo.io/groups: the certificate's O=, newline-separated, because group names can contain commas. A group containing a newline is refused before anything is minted. Generator.Generate now takes the issuing strategy, and every login route passes its own. A startup backfill (internal/identitybackfill) stamps Secrets that predate the annotations and never overwrites existing ones. Groups come from the stored certificate. Strategy is self, serviceaccount (a mapping with that username exists) or basic (a basic User exists); otherwise unknown, including when both exist. A Secret whose certificate or lookup fails is skipped, never stamped with a guess. No new RBAC: authn already holds list/update on Secrets in its namespace. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TLFnUe4HXFphxQNAfqFawZ
Collaborator
Author
Pre-release e2e of #40 + #41 + #42: pass (18/18)Setup: kind v1.36 with the signer capped at 20m. The cluster first ran the #40 image and was then upgraded to this branch's tip, so the backfill ran against Secrets the previous image wrote. A legacy fixture (
( |
Base automatically changed from
fix/serviceaccount-login-omit-kubeconfig
to
main
October 29, 2026 14:48
1 task done
Collaborator
Author
|
Superseded by #44, the same branch rebased onto |
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.
Closes #42. Stacked on #41. I'll retarget it to
mainonce #41 merges.Why
Tenant onboarding (a Kyverno GeneratingPolicy in saas) fires on every
<user>-clientconfigSecret, but nothing on them identified the credential. The decision is that authn stamps the identity facts it already knows, and the policy decides from them.What
Every clientconfig authn writes now carries two annotations, alongside #40's
certificate-not-{before,after}:authn.krateo.io/strategybasic/ldap/oauth/oidc/serviceaccount;selfforauthn-clientconfig;unknownonly from the backfillauthn.krateo.io/groupsO=, newline-separatedstorage.ValidateGroups).Generator.Generatenow takes the issuing strategy, and every route passes its own. authn's own identity getsselffrom the certificate renewer's annotation sync.internal/identitybackfill): stamps Secrets that predate these annotations, and never overwrites existing ones.self,serviceaccount(a mapping with that username exists) orbasic(a basicUserexists); otherwiseunknown. "Both a mapping and a basic User exist" is alsounknown.Consumer
acmp's onboarding selects positively: it creates a tenant only when the groups contain
tenants, and a missing annotation means no onboarding. So the backfill must run (authn 0.28.0) before the demo cutover.Tests
storage: comma-containing groups round-trip; no-groups gives an empty value; an empty strategy, an unreadable certificate or a newline group are refused.identitybackfill: a fake apiserver plus a fake lookup cover:serviceaccounthandler: issued asStrategyServiceAccount.🤖 Generated with Claude Code
https://claude.ai/code/session_01TLFnUe4HXFphxQNAfqFawZ