Repository navigation
feat: stamp strategy and groups on every <user>-clientconfig Secret (#42) - #44
Merged
Merged
Conversation
) 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
1 task
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TLFnUe4HXFphxQNAfqFawZ
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. This replaces #43, which GitHub closed when its stacked base (#41's branch) was deleted on merge. The branch, now rebased onto
main, is unchanged, and its tree is byte-identical to the commit the e2e below tested.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