You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SSO (#9077): stand up minimal devtoday OIDC provider with Drew-only gate #13409
Refs #9077. Design: doc/2026-11-23_design_fleet_sso_9077.md §3 (on branch lane/oc-code-05/sso-9077-design until merged).
Scope: standard OIDC issuer (code + PKCE), JWKS + key rotation, short-lived ID/access tokens, deny-by-default allowlist holding only Drew's account IDs enforced in the provider with every attempt audited. No id keypair custody in the login path.
Acceptance: issuer metadata + JWKS live; allowlist denies a non-Drew login with an audit record and allows Drew's; token claims carry the #1253 role set for server-side checks. Fold debt recorded: provider accounts must later bind to id accounts via the #2852 ceremony (acceptance debt, not afterthought).
Governed by the reconciliation ADR on #13658 (comment 7113273471) and the settled design §3 (doc/2026-11-23_design_fleet_sso_9077.md). The provider is the minimal build — no adopted core — signing with the PKI-issued keys from Slice 2 (#13686) from its first commit. No provider-local key generation, ever.
Package
New Rust crate pkgs/idp-provider (axum), sibling of pkgs/idp-pki. One small binary, laptop-hosted primary.
Keys (Slice 2 outputs, consumed unchanged)
OIDC signing key: serial 1001, RSA 2048, issued from the IdP issuing CA. Private key on-host under IDP_CA_HOME (~/idp-ca) and escrowed in the vault as idp.oidc-signing.key; the provider loads it from a configured path — it is never copied into the repo or any config file.
Surface (the whole of it — the ADR's minimal shape)
GET /.well-known/openid-configuration, GET /jwks, GET /authorize, POST /token, GET /userinfo, GET /healthz.
Authorization code + PKCE (S256 only). No password grant, no implicit, no dynamic client registration — clients are a static registry in provider config.
One account row (the owner), N linked external identities with full linking history retained (never hard-deleted while the account lives). Roles live on the account, not the door.
Deny-by-default allowlist holding only Drew's account IDs, enforced in the provider. Every authorize/token attempt — allowed and denied — is written to an append-only audit record (SQLite).
The provider stands behind the existing Access/Google doors. This slice changes no door, no DNS, no live surface — Google SSO keeps working untouched. No cutover of anything until the loop proof below exists.
Proof bar (this issue's acceptance, made measurable)
Issuer metadata + JWKS live from the running binary; JWKS verifies as the Slice 2 cert (kid = its SHA-256 thumbprint).
A test relying party completes the full code + PKCE loop against the running provider.
A non-allowlisted login attempt is denied and leaves an audit record; the owner's login succeeds.
PR #13696 merged to main as 6d57532fc2e26513e419a2f14bd1d3b7859692b1. New crate pkgs/idp-provider (7 files, +1406, nothing outside the package touched):
axum + tokio binary with GET /healthz, GET /.well-known/openid-configuration, GET /jwks.
JWKS is built at startup by parsing the published Slice 2 cert (pkgs/idp-pki/trust/oidc-signing.crt.pem, serial 1001) with x509-cert/rsa — no hardcoded key material, no provider-local key generation, per the plan.
Tests (laptop, in the worktree): 3 passed, 0 failed — discovery matches the configured issuer, healthz, and JWKS kid + RSA n/e derived independently from the cert DER in-test.
default.nix follows the repo's small-Rust-package pattern (rustPlatform.buildRustPackage, Cargo.lock committed).
Next in this slice: step 2 — authorize / token / userinfo with RS256 signing from the Slice 2 private key (loaded from its on-host path, never copied), the devtoday-local door on the owner account, the deny-by-default allowlist, and the append-only audit of every attempt; then step 3 — the test-RP full-loop proof with footprint/latency recorded against this issue's proof bar.
PR #13737 merged to main as bf7040df368cb9991c65dd2ffcc96435b7dd233f. The plan's full surface is now live in pkgs/idp-provider:
Endpoints: GET /authorize + POST /authorize (the POST is the login form's submission target), POST /token, GET /userinfo, alongside step 1's discovery/JWKS/healthz. Authorization code + PKCE (S256 only). No password grant, no implicit flow, no dynamic registration — static client registry in provider config (config.example.json registers the test RP + the devtoday local door client).
Signing: RS256 with the Slice 2 OIDC private key (serial 1001), loaded from its on-host path under IDP_CA_HOME (~/idp-ca/issued/oidc-signing/oidc-signing.key) and decrypted in memory only — the passphrase reaches the process via its environment, fetched by the launcher from the vault by name (idp.ca-passphrase); the plaintext key and passphrase are never written to disk, repo, or logs. Startup fails closed unless the loaded key matches the published cert behind the JWKS. No provider-local key generation.
Accounts + door: one account row (the owner) carrying the design(pm-stack): one identity across the stack — SSO propagation from the public entry into every layer, roles replace asserted authorship #1253 role set (owner / orchestrator / agent / read-only) — roles on the account, not the door. Stand-up door is the design's devtoday local identity linked to that row. Recorded choice: design §3 (read from the design branch worktree code-wt-sso-9077, branch lane/oc-code-05/sso-9077-design — the doc is not on main) does not specify the local credential mechanism, so the smallest faithful version is implemented: GET /authorize serves a login form that POSTs back, and the credential is verified against a PBKDF2-HMAC-SHA256 hash held in the on-host provider config (never in the repo; on-host helper idp-provider hash-credential; an empty hash verifies nothing).
Gate + audit: deny-by-default allowlist holding only the owner's identity key, enforced in the provider before the credential check. Every authorize/token attempt — allowed, denied, and login-form challenges — is appended to an append-only SQLite audit (UPDATE/DELETE blocked by triggers; a failed audit write fails the attempt closed).
Tokens: codes live 120 s and are single-use (consumed on first presentation); ID + access tokens live 300 s; the ID token carries the account's role claims.
Standing constraints held: no pkgs/id keypair custody in the login path; SSO never rebinds an id key (#2060).
Tests (laptop, in the worktree): 8 passed, 0 failed — step 1's 3 plus 5 new flow tests: full code+PKCE loop with the ID token verified against the served JWKS key + role claims + userinfo; non-allowlisted attempt denied and audited; bad credential denied and audited; PKCE failure and code reuse denied and audited; login form + unknown client. (Flow tests sign with a throwaway in-test key; the real Slice 2 key is exercised by step 3's live proof.)
Next in this slice: step 3 — the test-RP full-loop proof against the running provider on the laptop, with the five proof-bar items and measured footprint/latency recorded here.
PR #13755 merged to main as 20ceecfa64da12bfa9386e9545e2256b68d13c25 — it lands examples/test-rp.rs, the minimal relying party used for this proof, plus a README section. The proof ran on the laptop against the running release binary (pkgs/idp-provider, PID 457857, issuer http://127.0.0.1:8911), configured with the on-host registry at ~/idp-provider/provider-config.json (0600, credential hash only), signing with the real Slice 2 key loaded from ~/idp-ca/issued/oidc-signing/oidc-signing.key and decrypted in memory (passphrase fetched by name, idp.ca-passphrase, into the process environment only). Startup's fail-closed key↔cert check passed, which is itself evidence the decrypted key is the published cert's key.
The proof bar, item by item
Metadata + JWKS live; JWKS = Slice 2 cert — ✅ Discovery and /jwks served by the running binary. JWKS kid = gcmSpv4Ty2DIGf4oL3F7yENhK6LujlvZi5zs70XKbIQ, independently recomputed from the published cert's SHA-256 fingerprint (openssl x509 -fingerprint -sha256 over pkgs/idp-pki/trust/oidc-signing.crt.pem, serial 1001) → match; x5t#S256 = kid.
Full code + PKCE loop — ✅ test-rp completed discovery → JWKS → authorize (local door) → code → token → userinfo, 10 of 10 runs, against the live provider over real HTTP.
Non-allowlisted attempt denied + audited; owner succeeds — ✅ A mallory authorize attempt returned 403 and sits in the audit record as authorize / denied / not_allowlisted / devtoday-local:mallory; the owner's attempts are recorded allowed / code_issued with matching token / allowed / tokens_issued rows. (The audit table also holds 10 token / denied / unknown_or_expired_code rows from the proof's first run — the RP's own header-parsing bug lowercased the redirect Location and corrupted the case-sensitive codes; the provider correctly denied every one. The RP bug is fixed in test(idp-provider): test-RP example + live loop proof harness (#13409) #13755.)
Footprint / latency recorded — ✅ Method: ps -o rss on the running release binary; latency is the RP's in-process timing (discovery fetch → userinfo response, loopback HTTP, process startup excluded) over the 10 runs above.
Idle RSS: 6,824 KiB (6.7 MiB) after startup; 6,864 KiB after the proof loops.
Release binary size: 5,088,400 bytes (4.9 MiB).
Full-loop latency: mean 69.5 ms, median 69 ms, min 64 ms, max 76 ms (runs: 76, 76, 76, 66, 65, 69, 64, 65, 69, 69). The loop is dominated by the deliberate 210,000-iteration PBKDF2-HMAC-SHA256 credential verification at /authorize — the latency is mostly the credential KDF doing its job.
Recorded choices / deviations
Local-door credential custody: fleet secrets in this build exposes get/list only (no write verb), so the generated owner credential for the stand-up door is held on-host only at ~/idp-provider/owner-credential (0600, outside the repo); the provider config holds only its PBKDF2 hash. Vault escrow of the credential by name remains a follow-up when a secrets write path is used.
The provider process is left running on the laptop (loopback only, no door/DNS/live-surface changes; Google SSO untouched), launched from the step-3 worktree's release build with its log at ~/idp-provider/provider.log and the append-only audit accumulating at ~/idp-provider/audit.sqlite3.
With steps 1–3 landed and the proof bar met item by item, #13409's acceptance is complete. Slice-boundary progress is recorded on #13658.
IDP-BUILD-3 recorded this issue's acceptance as met in full but left it open. I re-verified each item of the issue's own acceptance list against live evidence before closing:
Issuer metadata + JWKS live — ✅ Re-checked today against the running provider on the laptop (issuer http://127.0.0.1:8911): /.well-known/openid-configuration and /jwks served; /healthz returns ok. JWKS kid = gcmSpv4Ty2DIGf4oL3F7yENhK6LujlvZi5zs70XKbIQ = the Slice 2 cert's SHA-256 thumbprint (serial 1001, pkgs/idp-pki/trust/oidc-signing.crt.pem, PR #13690).
Allowlist denies a non-Drew login with an audit record and allows Drew's — ✅ Read directly from the live append-only audit DB (~/idp-provider/audit.sqlite3, UPDATE/DELETE blocked by triggers): authorize | denied | not_allowlisted | 2 rows (the mallory attempts), authorize | allowed | code_issued | 20, token | allowed | tokens_issued | 10. Full narrative proof: comment 7114148520, item 3.
Fold debt recorded — ✅ The id: implement hosted provisioning + SSO→ID binding (from spec #2258) #2852 binding ceremony is recorded as acceptance debt in this issue's body and in the Slice 3 plan (comment 7113410371); provider accounts bind to id accounts via that ceremony, not as an afterthought.
One scope note for the record: this issue's scope line mentions key rotation; rotation is sequenced as its own slice (Slice 5) on the story #13658 and is being executed there — it was not part of this issue's acceptance list or the Slice 3 proof bar. The federated doors (#13411/#13412/#13414), linking (#13415), and first consumer (#13416) likewise continue under the story.
Activity
developing-today commentedon Nov 23, 2026
CODE-4885
dezren39 commentedon Nov 23, 2026
Slice 3 stand-up plan (IDP-BUILD-2, 2026-11-23)
Governed by the reconciliation ADR on #13658 (comment 7113273471) and the settled design §3 (
doc/2026-11-23_design_fleet_sso_9077.md). The provider is the minimal build — no adopted core — signing with the PKI-issued keys from Slice 2 (#13686) from its first commit. No provider-local key generation, ever.Package
New Rust crate
pkgs/idp-provider(axum), sibling ofpkgs/idp-pki. One small binary, laptop-hosted primary.Keys (Slice 2 outputs, consumed unchanged)
IDP_CA_HOME(~/idp-ca) and escrowed in the vault asidp.oidc-signing.key; the provider loads it from a configured path — it is never copied into the repo or any config file.pkgs/idp-pki/trust/oidc-signing.crt.pem(published, PR idp-pki: publish the IdP signing certificates (OIDC + SAML) #13690).kid= the certificate's SHA-256 thumbprint (x5t#S256), per SSO (#13658): Slice 2 — issue OIDC (JWKS) and SAML signing keys from the IdP PKI #13686's recorded convention, so relying parties can pin either form.Surface (the whole of it — the ADR's minimal shape)
GET /.well-known/openid-configuration,GET /jwks,GET /authorize,POST /token,GET /userinfo,GET /healthz.Accounts, gate, audit
Deployment shape for this slice
Proof bar (this issue's acceptance, made measurable)
Build order inside the slice
dezren39 commentedon Nov 23, 2026
Slice 3, step 1 — LANDED (2026-11-23)
PR #13696 merged to main as
6d57532fc2e26513e419a2f14bd1d3b7859692b1. New cratepkgs/idp-provider(7 files, +1406, nothing outside the package touched):GET /healthz,GET /.well-known/openid-configuration,GET /jwks.pkgs/idp-pki/trust/oidc-signing.crt.pem, serial 1001) withx509-cert/rsa— no hardcoded key material, no provider-local key generation, per the plan.kid= base64url(SHA-256 of cert DER) = the x5t#S256 convention from SSO (#13658): Slice 2 — issue OIDC (JWKS) and SAML signing keys from the IdP PKI #13686. Live binary on the laptop returned kidgcmSpv4Ty2DIGf4oL3F7yENhK6LujlvZi5zs70XKbIQ— the base64url form of the cert's published SHA-256 fingerprint81:C9:92:A6:…:6C:84.default.nixfollows the repo's small-Rust-package pattern (rustPlatform.buildRustPackage, Cargo.lock committed).Next in this slice: step 2 — authorize / token / userinfo with RS256 signing from the Slice 2 private key (loaded from its on-host path, never copied), the devtoday-local door on the owner account, the deny-by-default allowlist, and the append-only audit of every attempt; then step 3 — the test-RP full-loop proof with footprint/latency recorded against this issue's proof bar.
Merge pull request #13737 from developing-today/idp-build/13409-step2…
dezren39 commentedon Nov 23, 2026
Slice 3, step 2 — LANDED (2026-11-23)
PR #13737 merged to main as
bf7040df368cb9991c65dd2ffcc96435b7dd233f. The plan's full surface is now live inpkgs/idp-provider:GET /authorize+POST /authorize(the POST is the login form's submission target),POST /token,GET /userinfo, alongside step 1's discovery/JWKS/healthz. Authorization code + PKCE (S256 only). No password grant, no implicit flow, no dynamic registration — static client registry in provider config (config.example.jsonregisters the test RP + the devtoday local door client).IDP_CA_HOME(~/idp-ca/issued/oidc-signing/oidc-signing.key) and decrypted in memory only — the passphrase reaches the process via its environment, fetched by the launcher from the vault by name (idp.ca-passphrase); the plaintext key and passphrase are never written to disk, repo, or logs. Startup fails closed unless the loaded key matches the published cert behind the JWKS. No provider-local key generation.code-wt-sso-9077, branchlane/oc-code-05/sso-9077-design— the doc is not on main) does not specify the local credential mechanism, so the smallest faithful version is implemented:GET /authorizeserves a login form that POSTs back, and the credential is verified against a PBKDF2-HMAC-SHA256 hash held in the on-host provider config (never in the repo; on-host helperidp-provider hash-credential; an empty hash verifies nothing).Standing constraints held: no pkgs/id keypair custody in the login path; SSO never rebinds an id key (#2060).
Tests (laptop, in the worktree): 8 passed, 0 failed — step 1's 3 plus 5 new flow tests: full code+PKCE loop with the ID token verified against the served JWKS key + role claims + userinfo; non-allowlisted attempt denied and audited; bad credential denied and audited; PKCE failure and code reuse denied and audited; login form + unknown client. (Flow tests sign with a throwaway in-test key; the real Slice 2 key is exercised by step 3's live proof.)
Next in this slice: step 3 — the test-RP full-loop proof against the running provider on the laptop, with the five proof-bar items and measured footprint/latency recorded here.
Merge pull request #13755 from developing-today/idp-build/13409-step3…
dezren39 commentedon Nov 23, 2026
Slice 3, step 3 — PROOF COMPLETE (2026-11-23)
PR #13755 merged to main as
20ceecfa64da12bfa9386e9545e2256b68d13c25— it landsexamples/test-rp.rs, the minimal relying party used for this proof, plus a README section. The proof ran on the laptop against the running release binary (pkgs/idp-provider, PID 457857, issuerhttp://127.0.0.1:8911), configured with the on-host registry at~/idp-provider/provider-config.json(0600, credential hash only), signing with the real Slice 2 key loaded from~/idp-ca/issued/oidc-signing/oidc-signing.keyand decrypted in memory (passphrase fetched by name,idp.ca-passphrase, into the process environment only). Startup's fail-closed key↔cert check passed, which is itself evidence the decrypted key is the published cert's key.The proof bar, item by item
/jwksserved by the running binary. JWKSkid=gcmSpv4Ty2DIGf4oL3F7yENhK6LujlvZi5zs70XKbIQ, independently recomputed from the published cert's SHA-256 fingerprint (openssl x509 -fingerprint -sha256overpkgs/idp-pki/trust/oidc-signing.crt.pem, serial 1001) → match;x5t#S256=kid.test-rpcompleted discovery → JWKS → authorize (local door) → code → token → userinfo, 10 of 10 runs, against the live provider over real HTTP.malloryauthorize attempt returned 403 and sits in the audit record asauthorize / denied / not_allowlisted / devtoday-local:mallory; the owner's attempts are recordedallowed / code_issuedwith matchingtoken / allowed / tokens_issuedrows. (The audit table also holds 10token / denied / unknown_or_expired_coderows from the proof's first run — the RP's own header-parsing bug lowercased the redirectLocationand corrupted the case-sensitive codes; the provider correctly denied every one. The RP bug is fixed in test(idp-provider): test-RP example + live loop proof harness (#13409) #13755.)kid, iss/aud/nonce checked), with claimssub=drew,roles=["owner","orchestrator","agent","read-only"](the account's design(pm-stack): one identity across the stack — SSO propagation from the public entry into every layer, roles replace asserted authorship #1253 set),expires_in=300; userinfo returned the samesuband roles.ps -o rsson the running release binary; latency is the RP's in-process timing (discovery fetch → userinfo response, loopback HTTP, process startup excluded) over the 10 runs above./authorize— the latency is mostly the credential KDF doing its job.Recorded choices / deviations
fleet secretsin this build exposes get/list only (no write verb), so the generated owner credential for the stand-up door is held on-host only at~/idp-provider/owner-credential(0600, outside the repo); the provider config holds only its PBKDF2 hash. Vault escrow of the credential by name remains a follow-up when a secrets write path is used.~/idp-provider/provider.logand the append-only audit accumulating at~/idp-provider/audit.sqlite3.With steps 1–3 landed and the proof bar met item by item, #13409's acceptance is complete. Slice-boundary progress is recorded on #13658.
dezren39 commentedon Nov 23, 2026
Closing — acceptance verified first-hand (IDP-BUILD-4, 2026-11-23)
IDP-BUILD-3 recorded this issue's acceptance as met in full but left it open. I re-verified each item of the issue's own acceptance list against live evidence before closing:
http://127.0.0.1:8911):/.well-known/openid-configurationand/jwksserved;/healthzreturns ok. JWKSkid=gcmSpv4Ty2DIGf4oL3F7yENhK6LujlvZi5zs70XKbIQ= the Slice 2 cert's SHA-256 thumbprint (serial 1001,pkgs/idp-pki/trust/oidc-signing.crt.pem, PR #13690).~/idp-provider/audit.sqlite3, UPDATE/DELETE blocked by triggers):authorize | denied | not_allowlisted | 2rows (themalloryattempts),authorize | allowed | code_issued | 20,token | allowed | tokens_issued | 10. Full narrative proof: comment 7114148520, item 3.roles=["owner","orchestrator","agent","read-only"]; the flow is also covered by the crate's tests (8 passed, 0 failed, PR #13737).Landed PRs, all verified merged today: #13696 (step 1, discovery/JWKS), #13737 (step 2, authorize/token/userinfo + gate + audit), #13755 (step 3, test-RP proof). Footprint/latency evidence is on comment 7114148520, item 5.
One scope note for the record: this issue's scope line mentions key rotation; rotation is sequenced as its own slice (Slice 5) on the story #13658 and is being executed there — it was not part of this issue's acceptance list or the Slice 3 proof bar. The federated doors (#13411/#13412/#13414), linking (#13415), and first consumer (#13416) likewise continue under the story.
Closing as complete.