spike(idp): Zitadel v4 compose stack — OIDC code+PKCE round trip proven (task 0.1) #49

Merged
amiryahaya merged 1 commit from spike/zitadel-idp into main 2026-11-04 17:33:23 +01:00
Owner

Task 0.1 exit criteria met (dev plan Phase 0): Zitadel v4.16 running on a self-contained compose stack (deploy/idp/, project failsulit-idp, Traefik on localhost:8080, dedicated postgres per OPS-01) with headless bootstrap (FailSulit org, human admin, IAM_OWNER machine SA PAT + JSON key → bootstrap files), an OIDC application (code+PKCE, dev mode) registered, and the full authorization-code + S256 PKCE round trip proven against a scratch .NET endpoint (deploy/idp/roundtrip/) — id_token validated over real HTTP and claims rendered.

Findings recorded in spike-notes.md: FirstInstance time-env-var decode gotcha (use --steps yaml), v4 API paths rooted at / (management/v1 prefix gone — Connect client = Phase 8 open item), Login v2 as a separate container, userinfo claim contract for task 0.5, passkey ceremony deferred to Phase 2 real-browser E2E (support verified present in Console + Login v2 UI).

Closes #9

Task 0.1 exit criteria met (dev plan Phase 0): Zitadel v4.16 running on a self-contained compose stack (`deploy/idp/`, project `failsulit-idp`, Traefik on localhost:8080, dedicated postgres per OPS-01) with headless bootstrap (FailSulit org, human admin, IAM_OWNER machine SA PAT + JSON key → bootstrap files), an OIDC application (code+PKCE, dev mode) registered, and the **full authorization-code + S256 PKCE round trip proven against a scratch .NET endpoint** (`deploy/idp/roundtrip/`) — id_token validated over real HTTP and claims rendered. Findings recorded in `spike-notes.md`: FirstInstance time-env-var decode gotcha (use --steps yaml), v4 API paths rooted at / (management/v1 prefix gone — Connect client = Phase 8 open item), Login v2 as a separate container, userinfo claim contract for task 0.5, passkey ceremony deferred to Phase 2 real-browser E2E (support verified present in Console + Login v2 UI). Closes #9
deploy/idp/: self-contained compose project (failsulit-idp) — Zitadel v4.16
(api + Login v2 + Traefik on localhost:8080) with dedicated postgres
(OPS-01 separation). Headless bootstrap via --steps yaml (FirstInstance):
FailSulit org, human admin, IAM_OWNER machine SA with PAT + JSON key
written to the bootstrap volume.

deploy/idp/roundtrip/: scratch .NET endpoint proving the full
authorization-code + S256 PKCE round trip against the real stack:
authorize → Login v2 → code → token exchange → id_token validated
(iss/aud/RSA-JWKS) → claims rendered (iss/sub/aud/amr/azp/sid/at_hash).

Findings in docs/redesign/2026-11-onboarding-passkey/spike-notes.md:
- FirstInstance time fields break via ZITADEL_FIRSTINSTANCE_* env vars
  (use --steps yaml file)
- v4 API paths rooted at / (proto annotations: /projects/_search etc.);
  /management/v1 prefix removed — Connect client path = Phase 8 open item
- Login v2 is a separate container routed under /ui/v2/login
- id_token carries core claims only; userinfo for profile/email (0.5)
- passkey registration ceremony requires a real browser profile —
  verified present in Console + Login v2 UI; ceremony E2E deferred to
  Phase 2 (documented limitation)

Verified: 4 containers healthy via compose --wait; full round trip
completed in-browser; admin PAT authenticates against the API.

Closes #9 (task 0.1 exit criteria; passkey ceremony E2E deferred to
Phase 2 as documented)

🤖 Generated with [ZCode](https://zcode.ai)

Co-Authored-By: ZCode <noreply@anthropic.com>
Author
Owner

ponytail-review (§2.4 AI first-pass) — Verdict: Ship (spike).

What this change does: adds a self-contained dev-only compose project for Zitadel v4.16 (api + Login v2 + Traefik + dedicated postgres) and a scratch .NET endpoint that proves authorization-code + S256 PKCE end-to-end; findings documented in spike-notes.md.

Checked: compose is project-scoped (name: failsulit-idp) so it cannot collide with the existing local/dev stacks; ports limited to 127.0.0.1:8080 (8080 was free); secrets are spike-local (banner comment; production IdP deployment is a separate runbook per ADR §10); steps.yaml time fields avoid the env-var decode gotcha; diagnostics ([PROBE-*]) reverted from handlers; DEBUG tests removed from OidcFlowTests; roundtrip endpoint binds 127.0.0.1 only and hardcodes spike-local config deliberately.

Notes (not blocking): committed local-only masterkey/PAT values are fine for a spike stack but must not be copied into the production runbook; the passkey ceremony is deferred to Phase 2 with the Console/Login-v2 support verified present; the v4 management-API Connect path remains an open question tracked for Phase 8.

Not checked: upgrade path v4.16 → newer patch versions; Windows compose parity.

**ponytail-review (§2.4 AI first-pass) — Verdict: Ship (spike).** What this change does: adds a self-contained dev-only compose project for Zitadel v4.16 (api + Login v2 + Traefik + dedicated postgres) and a scratch .NET endpoint that proves authorization-code + S256 PKCE end-to-end; findings documented in spike-notes.md. Checked: compose is project-scoped (`name: failsulit-idp`) so it cannot collide with the existing local/dev stacks; ports limited to 127.0.0.1:8080 (8080 was free); secrets are spike-local (banner comment; production IdP deployment is a separate runbook per ADR §10); steps.yaml time fields avoid the env-var decode gotcha; diagnostics ([PROBE-*]) reverted from handlers; DEBUG tests removed from OidcFlowTests; roundtrip endpoint binds 127.0.0.1 only and hardcodes spike-local config deliberately. Notes (not blocking): committed local-only masterkey/PAT values are fine for a spike stack but must not be copied into the production runbook; the passkey ceremony is deferred to Phase 2 with the Console/Login-v2 support verified present; the v4 management-API Connect path remains an open question tracked for Phase 8. Not checked: upgrade path v4.16 → newer patch versions; Windows compose parity.
amiryahaya deleted branch spike/zitadel-idp 2026-11-04 17:33:23 +01:00
Sign in to join this conversation.
No description provided.