test(ci): add disposable real ZITADEL browser OIDC acceptance

This commit is contained in:
Vib Tools committed 2026-11-22 09:16:53 -08:00
1 parent f423c69654
commit cbcd60e76e
32 files changed
+875 -22

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
# P05-OIDC-01 — Disposable Real OIDC Browser Acceptance
**Approved baseline:** `f423c696544f28a42d6a5d1ad0acfd88a3b6f56d`
**Planned verification:** manual Gitea Actions `.gitea/workflows/p05-oidc-acceptance.yml`
**Status:** CI-only implementation prepared; **NO real browser login or cleanup accepted until the focused Gitea run completes**.
## What this phase actually tests
- A completely disposable instance of the existing official **ZITADEL v4.20.4**, PostgreSQL, prebuilt **Login V2** and Traefik, with *no published runner host port*.
- An IAM_OWNER PAT for CI-only official provisioning. The token expires quickly, is never printed and is never mounted into the Account Portal/browser. Separate login-client PAT from the unchanged P02 Compose remains limited to Login V2.
- An actual project, OIDC Web authorization-code client with redirect `http://localhost:3000/api/auth/callback/zitadel`, and an actual **new CI-only human account**, with a random password and verified `.invalid` email. All data are within the disposable PostgreSQL volumes.
- A real Chromium browser follows **Continue with ZITADEL** → unmodified ZITADEL Login V2 username/password → genuine Auth.js authorization-code callback. PKCE S256, state and nonce are checked from actual outgoing browser authorization navigation; no sessions are mocked or injected.
- Success requires authenticated `GET /api/account/me` returning the **exact** provisioned user's ID, HttpOnly Auth.js session cookie, allowed protected Account page; rejection of anonymous/invalid callback, and local Account Portal sign-out returning 401.
- `always()` resource cleanup removes only CI-owned containers, the temporary secret volume, the IAM_OWNER bootstrap and PostgreSQL data, with explicit absence verification. A cleanup failure blocks acceptance.
## CI network and security boundary
The existing P02 Compose external issuer is `http://localhost:8080`. Account Portal `users/ui/src/lib/env.ts` allows HTTP localhost only when **not** running as production, and correctly requires HTTPS for production. Rather than altering authentication source or falsely claiming a production TLS test, this phase runs the unchanged Account Portal with **`next dev` only within a disposable Gitea Chromium container**, co-located on the private Docker proxy network namespace. A run-scoped localhost:8080 → proxy:80 TCP forward preserves exact discovery issuer and browser redirects **without publishing any host port**. The official ZITADEL backend, existing development Compose, original Login V2, Auth.js, Account UI, package manifests and lockfiles remain READ ONLY.
The user test credentials, admin PAT, OAuth codes, cookies and browser URLs with query strings are never printed, committed or uploaded. No production or real human account is touched.
## Running / interpretation
Authorize and dispatch the **one** manual workflow under Gitea [ZitPlane Actions](https://dev.ivib.cc/vibtools/ZitPlane/actions). Do not trigger it outside a dedicated Docker runner. A full PASS needs **all** official client/user creation, real browser password/callback/positive and negative identity evidence and complete owned resource teardown, verified by named CI markers and final job SUCCESS. If the runner lacks Docker, a provisioning API is incompatible, real authorization cannot complete, or cleanup fails, the phase remains **BLOCKED** with the exact verified point of failure; it is not silently downgraded into metadata/JWKS smoke.
**Not covered:** human MFA/passkeys, Admin Console human E2E, production HTTPS/TLS issuer, source-built Login V2 runtime wiring, real global SSO logout and production Coolify deployment. These are separate explicit Scope Locks. The final actual Gitea results are recorded in `notes/P05-OIDC-01.md`.