GeezerVison is showing github.com — feat(idp-provider): federated doors (GitHub/Google/Microsoft) + runtime identity linking by dezren39 · Pull Request #13782 · developing-today/code
Conversation
dezren39
commented
Nov 23, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Refs #13411, #13412, #13414, #13415 (all four stay open — see "What this does not do" below). Builds on the closed stand-up #13409 under the story #13658.
What lands
Federated doors (src/doors.rs, src/upstream.rs) — GET /door/{name}/start|callback on pkgs/idp-provider:
- Start re-validates the relying party's authorize request with the exact checks
/authorize uses (static client registry, redirect URI, code + PKCE S256, openid scope — the validation is now shared code), parks the request server-side under a random single-use state handle (300 s TTL), and redirects to the upstream.
- Callback consumes the handle, exchanges the upstream code, and verifies the upstream identity. OIDC doors (Google/Microsoft shape): PKCE is sent upstream; the ID token's signature is verified against the upstream JWKS with
iss/aud/exp/nonce checked; the recorded subject is the configured claim (sub; Microsoft oid, falling back to sub). GitHub door: subject is the numeric user id from the user fetch.
- The deny-by-default allowlist is enforced in the provider before any link or code exists; every outcome is audited (allowed and denied). Success mints one of our own codes into the shared code store, so door tokens are indistinguishable from local-door tokens: same account
sub, same design(pm-stack): one identity across the stack — SSO propagation from the public entry into every layer, roles replace asserted authorship #1253 role claims.
- Door client secrets are never in config or repo: each door's config names an environment variable the launcher fills from the vault by name (
idp.github.client-secret → IDP_GITHUB_CLIENT_SECRET, likewise Google/Microsoft). A door whose secret is unset — or an OIDC door missing issuer/JWKS — stays disabled: its start endpoint denies with an audit record; the rest of the provider is unaffected.
Account linking (src/identities.rs) — the #13415 model, refined on the issue before building: link state moves from static config rows to a runtime SQLite store seeded from the config. One row per (provider, subject) (active | unlinked, never hard-deleted) plus an append-only, trigger-protected event history (seed/link/relink/unlink). An allowlisted identity's first door login links it (actor door-login), recorded in the history and the audit record; an operator unlink (new idp-provider link|unlink|links CLI) is never silently undone by a login — that door denies identity_unlinked while the account stays reachable via the others.
The local door now checks the same store for its linked check; its behaviour is otherwise unchanged.
Evidence
Laptop, in the worktree: 15/15 crate tests pass — the 8 pre-existing (endpoints 3, flow 5) plus 7 new door tests (tests/doors.rs) that run the full loop over real HTTP against mock OIDC/GitHub upstreams: both doors reach the same account with role claims; first-login linking + audit; non-allowlisted denial + audit with no store row; unlink → door denied, local door still opens the account, history intact; state-handle replay denied; disabled door denied at start; login form lists enabled doors only. The mock OIDC upstream enforces PKCE and nonce itself, so the provider's upstream behaviour is genuinely exercised.
config.example.json gains the three production-shaped door entries (placeholder client ids; the Microsoft issuer carries the consumers tenant id — flagged in the file's comment to verify against the registration) and the README documents the doors, linking, and the new env surface.
What this does not do
The live "Drew signs in via each door" proofs: no upstream app registrations exist yet (checked the vault by name; creating them is a signed-in console step per door). The exact registration steps and vault names are recorded on #13411 / #13412 / #13414, and the linking acceptance mapping on #13415. Those issues stay open on the registration proof; nothing here closes them.

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Implements the door machinery for #13411 (GitHub), #13412 (Google),
#13414 (Microsoft) and the linking model of #13415 on the minimal
provider (#13409, closed):
- GET /door/{name}/start re-validates the RP authorize request with
the same checks as /authorize, parks it server-side under a
single-use state handle (300 s), and redirects upstream. The
callback consumes the handle, exchanges the upstream code, and
verifies the upstream identity: OIDC doors check the ID token
against the upstream JWKS (iss/aud/exp/nonce, PKCE sent upstream);
the GitHub door takes the numeric user id from the user fetch.
- The deny-by-default allowlist is enforced in the provider before
any link or code exists; success mints one of our own codes into
the shared store, so a door login's tokens carry the same account
sub and #1253 role claims as a local login's.
- Identity store (#13415): SQLite link state seeded from the
provider config, append-only event history (rows never
hard-deleted), first-allowlisted-login linking written to the
history and the audit record, operator link/unlink/links CLI.
An unlinked identity is denied at its door while the account
stays reachable via the others.
- Door client secrets are named env vars only (the launcher fills
them from the vault by name); a door without its secret stays
disabled and denies at start with an audit record.
Tests: 7 new door tests over real HTTP against mock OIDC/GitHub
upstreams (full loops, denial/audit, unlink behaviour, state
replay, disabled door); 15/15 crate tests pass on the laptop.
The live per-door sign-in proofs still need the upstream app
registrations recorded on each issue; the issues stay open for
those.
Warning
Review limit reached
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 20 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
853159b3-b1dc-4b24-8f83-0906083fe8bf
Commits
-
Reviewing files that changed from the base of the PR and between 58c256b and 8170aef.
Files ignored due to path filters: 1
-
pkgs/idp-provider/Cargo.lock is excluded by !**/*.lock
Files selected for processing: 14
-
pkgs/idp-provider/Cargo.toml
pkgs/idp-provider/README.md
pkgs/idp-provider/config.example.json
pkgs/idp-provider/examples/test-rp.rs
pkgs/idp-provider/src/doors.rs
pkgs/idp-provider/src/flow.rs
pkgs/idp-provider/src/identities.rs
pkgs/idp-provider/src/lib.rs
pkgs/idp-provider/src/main.rs
pkgs/idp-provider/src/registry.rs
pkgs/idp-provider/src/upstream.rs
pkgs/idp-provider/tests/doors.rs
pkgs/idp-provider/tests/endpoints.rs
pkgs/idp-provider/tests/flow.rs
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 23, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|