Repository navigation
feat(ogar-auth): issuer-qualified external identities and a verified-login boundary (PR-00) - #366
Merged
Merged
Conversation
…login boundary (PR-00) - identity: Issuer (byte-exact OIDC iss, no normalisation), ExternalSubject, ExternalIdentity keyed by (issuer, subject). - user: LocalUserStore keeps external identities in a unique index; try_insert / bind_external refuse duplicate user ids, subjects, bindings held by another user and duplicate identities; insert keeps its signature and panics on conflicting input; UserStore::resolve_external defaults to None (fail closed). AuthContext::federated and AuthenticatedUser are documented as descriptive, not proof. - federation: TrustedIssuers registry, AssertionVerifier seam for the provider-agnostic OIDC adapter (PR-01), establish() -> VerifiedLogin with private fields and no public constructor; resolution is (iss, sub) only, never email; the provider label comes from the registry. - Tests F1-F5 (ogar-auth integration tests + ogar-rbac federated module), compile_fail doctests for VerifiedLogin. Disable runs: subject-only lookup, dropped holder check, email fallback, public VerifiedLogin fields, provider in the identity envelope — each turns its test red. - docs/AUTH-EXTERNAL-IDENTITY.md (rules, compatibility, migration, trust boundary), docs/UPSTREAM-DEPS.md row with dependency SHAs. No class id, ActorContext, kiosk or local-auth behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XAqKMQJzQD5KvNm8BtbsWG
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
AdaWorldAPI
marked this pull request as ready for review
November 4, 2026 22:28
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
What
PR-00 adds the identity contract that an external OIDC provider such as ZITADEL plugs into. It adds no OIDC client.
identityIssueris the byte-exact OIDCiss. The value is not normalised. It is accepted over https, and over http for localhost only.ExternalSubjectholds the OIDCsub.ExternalIdentityis the pair(issuer, subject).userLocalUserStorekeeps external identities in a unique index.try_insertandbind_externalreject each of the following with aStoreConflict:insertkeeps its signature and panics (#[track_caller]) on conflicting input.UserStore::resolve_externaldefaults toNone, so a store that does not implement it fails closed.federationTrustedIssuersis the registry of trusted issuers. It maps an issuer to its provider label and refuses a second, conflicting registration.AssertionVerifieris the interface the OIDC adapter in PR-01 implements.establish()returns aVerifiedLogin. It runs: verify the assertion → check the issuer is trusted → resolve(iss, sub)→AuthContext::federated, with the provider label taken from the registry.VerifiedLoginhas private fields and no public constructor (pinned bycompile_faildoctests). A hand-builtAuthContext::federatedyields anAuthenticatedUserbut never aVerifiedLogin.Falsifiers
subunder two issuers names two different usersfederation_boundary::same_subject_different_issuer_*user::tests::*duplicate*,bind_external_rejects_*federation_boundary::email_is_never_a_linkAuthContext::federatedis not proof of a loginhand_built_context_gives_a_user_but_no_login,compile_faildoctestsogar-rbac tests::federated::provider_switch_keeps_decision_for_explicitly_bound_actor(+ two companion tests)Disable runs (each turned red, then the tree was restored)
bind_external→ the duplicate-external test red.establish→ F3 red.VerifiedLoginfields madepub→compile_faildoctest red.two_bindings_resolve_to_one_canonical_userand the F5 rbac test red.Gates
cargo test -p ogar-auth -p ogar-rbac: green (26 + 13 + 25 tests, 2 doctests).cargo clippy -p ogar-auth -p ogar-rbac --all-targets -- -D warnings: clean.cargo fmt --check: clean.Compatibility
ActorContext, kiosk, local auth orUserStoresemantics.LocalUserStore::insertnow panics on conflicting input (a duplicate id or subject). Before, the second insert silently overwrote the first. Callers that need to handle a conflict usetry_insert.bind_external. A provider-scoped identity never links by email or by subject alone.docs/AUTH-EXTERNAL-IDENTITY.md.Dependency SHAs
5b82ae0fc26e4442e1a6814ad48ea4444fac6356.lance-graph-contract: as resolved by the workspace at that base,f859d484…, on branchmain, unpinned. Recorded indocs/UPSTREAM-DEPS.md.Not in scope
AssertionVerifier).Generated by Claude Code