GeezerVison is showing github.com — SSO (#9077): stand up minimal devtoday OIDC provider with Drew-only gate · Issue #13409 · developing-today/code
SSO (#9077): stand up minimal devtoday OIDC provider with Drew-only gate #13409DescriptionRefs #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).
{
"direct_parent": null,
"links": [],
"lineage": {
"design": null,
"roadmap_item": null,
"priority": null
},
"pm_meta": 1,
"provenance": {
"queue_id": null,
"scheduled_start": null,
"picked_up_at": null,
"work_started_at": null,
"created_at": "2026-11-23T15:36:18Z",
"session_id": "ses_e5df703b424ffeYiDdwritlbyD",
"lane": null,
"host": "amd",
"worktree": "/home/user/git/code-wt-sso-9077",
"model": null,
"lane_start_issues": [],
"workspace_ref": {
"kind": "worktree",
"id": "/home/user/git/code-wt-sso-9077",
"repo": "developing-today/code",
"branch": "lane/oc-code-05/sso-9077-design",
"sha": "4204df0de25ea49e728773ded1f059cefbed56be"
},
"auth_subject": "oc-code-02",
"stamped_by": "fleet 0.1.0 (native)"
}
}
Related design PR: Refs #13417 (open, NOT closing #9077). Activitydeveloping-today commented on Nov 23, 2026 dezren39 commented on 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 of pkgs/idp-pki. One small binary, laptop-hosted primary.
Keys (Slice 2 outputs, consumed unchanged)
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.
- Short-lived ID + access tokens, RS256, signed with the Slice 2 key. ID token claims carry 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) read from the account row, so consumers check roles server-side.
Accounts, gate, audit
Deployment shape for this slice
- Issuer is a configured value; the stand-up proof runs laptop-local. The public issuer name is fixed at the first-consumer slice (SSO (#9077): first consumer integration proving the full loop (PM stack) #13416) before any relying party depends on it.
- 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.
- The ID token from the loop verifies against JWKS and carries the design(pm-stack): one identity across the stack — SSO propagation from the public entry into every layer, roles replace asserted authorship #1253 role claims.
- The loop's footprint/latency is recorded here (perf doctrine, story: pilot moving mcpx to Rust — what it takes, what it gains, measured #13669) — this is also the evidence the ADR's Keycloak fallback trigger would be judged on, if it ever came to that.
Build order inside the slice
- Scaffold + discovery + JWKS from the published cert (first landed evidence).
- Authorize / token / userinfo + local door + allowlist + audit.
- Test-RP loop proof + the records above, on this issue and story: our own OIDC/SAML/SSO identity provider #13658.
dezren39 commented on Nov 23, 2026 Slice 3, step 1 — LANDED (2026-11-23)
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.
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 kid gcmSpv4Ty2DIGf4oL3F7yENhK6LujlvZi5zs70XKbIQ — the base64url form of the cert's published SHA-256 fingerprint 81:C9:92:A6:…:6C:84.
- 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. dezren39 commented on 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 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. dezren39 commented on Nov 23, 2026 Slice 3, step 3 — PROOF COMPLETE (2026-11-23)
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.)
- ID token verifies against JWKS and carries the role claims — ✅ Every run's ID token was RS256-verified in the RP against the public key taken from the live JWKS (matching
kid, iss/aud/nonce checked), with claims sub=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 same sub and roles.
- 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. dezren39 commented on 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:
- 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.
- Token claims carry 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 — ✅ Proof comment 7114148520, item 4: every proof run's ID token RS256-verified against the live JWKS with
roles=["owner","orchestrator","agent","read-only"]; the flow is also covered by the crate's tests (8 passed, 0 failed, PR #13737).
- 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.
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.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|