Repository navigation
rpuser: audited claims -> local-user provisioning path - #25
Merged
Merged
Conversation
Extract the post-login user-sync policy every RP site re-implements into an oidclient subpackage, per the revised spec on issue #10: Identity mirrors authz.Identity (no roles -- authorization is never claim-driven), users key strictly on (issuer, subject) and are never matched by email, mutable claims sync at login only, and the per-request middleware is strictly read-only. Hosts keep their schema and SQL behind the three-method UserStore; a PreCreate hook carries host adoption policies (osg's seed accounts) without forking the flow. Issuer comes from the client's configured issuer URL, which oidclient already validates the token's iss against -- the same string authz grants are keyed on. Refs #10 Co-Authored-By: Claude Fable 5 <[email protected]>
govulncheck fails the branch on the ECH privacy leak (GO-2026-5856), reachable from this module's TLS use and fixed in 1.25.12. Co-Authored-By: Claude Fable 5 <[email protected]>
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.
Summary
Implements the extraction agreed on #10 (see the revised spec and decision comments there): a new
rpusersubpackage owning the post-login user-sync policy that OSG and SF currently carry as near-identical copies.Identitymirrorsauthz.Identityfield-for-field -- noRoles; authorization stays claim-free per the authz trust model.UserStoreis the host-implemented boundary (lookup / sync / create); hosts keep their schema and sqlc. The interface docs require (issuer, subject) keying and forbid email matching.Provisioner.Provisionis the login-time flow: lookup -> best-effort sync of email/email_verified on a hit ->PreCreatehook (osg's seed-account adoption) -> create on a miss, withcreatedreported for onboarding routing.Middleware.Optionalis the per-request flow oversession.Manager.Authenticate: strictly read-only (pinned by test), stashes identity/user/claims in context, fail-open anonymous by design with faults logged. Replaces each site's hand-rolledoptionalAuth+ feeds each site's authzIdentitySourcefromIdentityFromContext.Identity.Issueris filled from the client's configured issuer URL, which oidclient already validates the token'sissagainst -- the same string authz grants key on.User.Hostcarries the host's own row through the middleware so per-request resolution stays a single DB query.Testing
TDD: both test files written first and confirmed failing, then the implementation. 18 new tests cover normalization (display-name fallback, issuer injection), the provision flow (create/sync/no-write/adopt/decline/error paths, empty-email non-clobber, best-effort sync), and the middleware (anonymous cases, context population, host-row passthrough, fault logging, and the read-only guarantee).
go test ./...green across all three packages;go vetandgofmtclean.Consumer adoption (OSG, SF -- including the (issuer, subject) schema migrations) follows in separate PRs against those repos once this merges and tags.
Fixes #10
🤖 Generated with Claude Code