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

+3
View File
@@ -27,3 +27,6 @@ Snapshot: 2026-11-22. **Run #86** accepted isolated ZITADEL backend; **Run #89**
Prior historical **P02 source-only Python static tests** passed 3/3 in earlier work, and P03 upstream imported Git blobs matched 638/638. These are **not equivalent** to a running authentication system.
Future feature additions need an evidence-backed status update here, an exact developer implementation record in `project/`, a pre-change scope entry in `notes/`, and corresponding user guide updates.
**P05-OIDC-01 source status (pre-run):** The new Gitea-only disposable IAM_OWNER → official OIDC project/client/human → real Chromium original Login V2/Auth.js positive callback/session/negative checks and strict cleanup harness is **IMPLEMENTED IN SOURCE**, **RUNTIME NOT YET VERIFIED**. Do not mark real login, production TLS, Admin Console or MFA as verified unless one actual CI run executes those exact assertions and succeeds.
+1
View File
@@ -13,6 +13,7 @@ Every file listed below is a direct child of `docs/`. Add/remove rows whenever t
| [P05-SEC-01.md](P05-SEC-01.md) | Source-grounded dependency security patches, advisory blockers and CI verification | P05-SEC-01 / Run #87 3 PASS/1 FAIL, 2 Moderate open |
| [P05-SEC-02.md](P05-SEC-02.md) | Seven scoped PNPM parent overrides, patched lock and manual Login-only security CI evidence | P05-SEC-02 / Run #88 partial: security zero, build unverified |
| [P05-SEC-02-A01.md](P05-SEC-02-A01.md) | Gitea-only Login V2 full frozen-install/build/units/zero-advisory acceptance and status | P05-SEC-02-A01 / Run #89 SUCCESS |
| [P05-OIDC-01.md](P05-OIDC-01.md) | How isolated real OIDC Login V2 browser/session checks work; real CI status/limitations | P05-OIDC-01 / run pending |
| [SETUP-GUIDE.md](SETUP-GUIDE.md) | Operator/developer prerequisites, configs, activation and safety | DOCS-01 / active; runtime pending |
| [FEATURES-STATUS.md](FEATURES-STATUS.md) | Exact implemented/unavailable/unverified feature matrix | DOCS-01 / active |
| [TROUBLESHOOTING.md](TROUBLESHOOTING.md) | Known blockers and safe diagnosis based on source status | DOCS-01 / active |
+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`.
+6
View File
@@ -70,6 +70,12 @@ Implement one explicitly approved phase at a time. Keep out-of-scope files, exis
- **Exact Scope Lock:** `tests/ci/transitive_override_contract.py` and `.gitea/workflows/p05-security-acceptance.yml` only if a NEW exact validator/CI defect is reproduced; `notes/**`, `project/**`, relevant `docs/**`, associated README/MINIFEST for evidence. All PNPM lock/config/manifests, original Login/UI/auth, Account Portal, ZITADEL backend, Compose, production and unrelated files read-only. Preserve untracked `AI_INSTRUCTIONS.md`.
- **Run #89 ACCEPTED/SUCCESS**: tested SHA `ff4c58ed861474061c8f045be3a9f0752caf6ca0`. Existing corrected override validator PASS, seven parent pins + patched lock contract PASS; PNPM `10.30.3` frozen install PASS; Nx proto/client/Login 16.4.6 standalone production build PASS; upstream Vitest **84/84 files and 1219/1219 tests PASS**. Live production `pnpm audit --prod`: **0 Moderate/High/Critical**. Login jobs #194/#196 SUCCESS; Account jobs #193/#195 SKIPPED intentionally. One CI run, no local app test/build, no source/lock/deploy changes. Interactive OIDC/MFA/Admin Console login still unverified. Exact evidence: `notes/P05-SEC-02-A01.md`, `docs/P05-SEC-02-A01.md`.
## P05-OIDC-01 — Disposable Real OIDC Login/Session Acceptance (APPROVED 2026-11-22)
- Baseline `f423c696544f28a42d6a5d1ad0acfd88a3b6f56d`, prior Run #86 disposable backend, Run #87 Account and Run #89 Login build/security PASS. **Real OIDC positive callback/session still unverified**.
- Exact Write Scope: new `.gitea/workflows/p05-oidc-acceptance.yml`, focused `tests/ci/oidc_e2e/**` and narrow CI-only helpers, `notes/**`, `project/**`, relevant `docs/**`, associated README/MINIFEST and root navigation. Original P02 Compose/backend, original Login V2/auth UI, Account Portal Auth.js/UI, all package manifests/locks, production and unrelated files READ ONLY. Preserve untracked `AI_INSTRUCTIONS.md`.
- Pre-change plan `notes/P05-OIDC-01.md` documents official IAM_OWNER bootstrap PAT (not the Login-client PAT), disposable project/real OIDC Web client and human, original Login V2 Chromium password flow, Auth.js PKCE/state/nonce, positive Account API/session and anonymous/invalid negatives, and mandatory run-owned secret/Compose cleanup. No public host ports. Existing HTTP localhost issuer requires development **only in the disposable CI container**, not a production TLS acceptance.
- One manual Gitea Actions CI cycle; **no local app installs/builds/tests/dev servers or production deployment**, no fake login/session or identity bypass. Exact real job results required for PASS. `docs/P05-OIDC-01.md`, `project/OIDC-E2E-ARCHITECTURE.md`.
## P05 - Full Integration (proposed, NOT approved)
Shared design system, production-safe Compose topology and verified Login/Account OIDC wiring. No live deployment; separate approval.
+1 -1
View File
@@ -26,4 +26,4 @@
Full update policy is in root [AGENTS.md](../AGENTS.md). A list of available docs is in [MINIFEST.md](MINIFEST.md).
For Gitea Run #89 final Login frozen build/unit/zero-advisory acceptance and the remaining interactive identity gaps see [P05-SEC-02-A01.md](P05-SEC-02-A01.md). For Run #88 historical blocker and corrected helper see [P05-SEC-02.md](P05-SEC-02.md). For Gitea Run #87 findings see [P05-SEC-01.md](P05-SEC-01.md). For backend-only isolated runtime verification see [P05-CI-03.md](P05-CI-03.md); for initial full workflow and its limitations see [P05-CI-01.md](P05-CI-01.md). A green backend discovery smoke is not an authenticated user-login result.
For the P05-OIDC-01 isolated real-user/Chromium login callback acceptance harness, actual CI outcome and safety boundaries see [P05-OIDC-01.md](P05-OIDC-01.md). For Gitea Run #89 final Login frozen build/unit/zero-advisory acceptance see [P05-SEC-02-A01.md](P05-SEC-02-A01.md). For Run #88 historical blocker and corrected helper see [P05-SEC-02.md](P05-SEC-02.md). For Gitea Run #87 findings see [P05-SEC-01.md](P05-SEC-01.md). For backend-only isolated runtime verification see [P05-CI-03.md](P05-CI-03.md); for initial full workflow and its limitations see [P05-CI-01.md](P05-CI-01.md). A green backend discovery smoke is not an authenticated user-login result.
+5
View File
@@ -100,3 +100,8 @@ Use Gitea Actions → **ZitPlane P05 Dependency Security Acceptance (SEC-01/02)*
**P05-SEC-02-A01 VERIFIED:** Gitea [Run #89](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/89) succeeded with manual `login_only=true`: patched seven-parent dependency contract, pinned frozen PNPM install, proto/client/Login standalone production build, **1219/1219** upstream tests and production registry audit **0 Moderate/High/Critical**. Account jobs were intentionally skipped. No user credential, interactive OIDC login, MFA, production TLS or deployment was tested; do not treat this as a deployed service.
## P05-OIDC-01 — isolated real-user OIDC verification, Gitea only
In Gitea `vibtools/ZitPlane` → Actions → **ZitPlane P05-OIDC-01 Disposable Real Browser Acceptance** → manual Run workflow on `main` only when explicitly approved. The workflow provisions its own short-lived IAM_OWNER PAT, isolated ZITADEL project/client/verified test human, then tests the actual ZITADEL Login V2 username/password and Auth.js Account callback in Chromium. It does **not** use your real users, public domain, production secrets or host-published HTTP ports. It removes its test credentials, browser and isolated database/volumes via an `always()` step; any cleanup failure prevents phase acceptance. See `docs/P05-OIDC-01.md` for the expected checks and current real run result. This test uses CI-only HTTP loopback (Account development mode), **not** the actual production HTTPS issuer.
+5
View File
@@ -50,3 +50,8 @@ Run #88 Login build job #190 stopped before `pnpm install --frozen-lockfile` whe
## P05-SEC-02-A01 — Run #88 validator false-positive closed in Run #89
The earlier Run #88 CI helper misread `axios@>=` and similar version-range keys as parent overrides. The already-committed suffix-only `>glob` / `>minimatch` correction **passed** in Gitea [Run #89](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/89), followed by successful frozen PNPM install, original Login Nx production build and **1219/1219** unit tests. The production registry vulnerability audit also passed with **0 Moderate/High/Critical**. The prior false-positive is now **CI-verified resolved**; no repeat local test or production deployment. If future login failures occur, distinguish CI build/unit success from still-untested authenticated OIDC/callback/MFA integration.
## P05-OIDC-01 — isolated real OIDC browser acceptance troubleshooting
The new manual Gitea `p05-oidc-acceptance.yml` is **not a production deployment**. If runner Docker ownership preflight fails, do not delete an existing network/volume or reuse secrets; use a clean runner. If IAM_OWNER PAT or API client/user creation fails, do not use P02's restricted `IAM_LOGIN_CLIENT` PAT as a substitute. If the original Login V2 browser or Auth.js callback fails, report only the safe blocker marker and do **not** mock tokens, disable PKCE/state/nonce or alter production auth source. If cleanup cannot prove empty run-owned Docker resources, the job must remain FAILED. The HTTP localhost issuer works only in the private Gitea CI development environment; production HTTPS requires a separate Scope Lock. Exact current evidence: `notes/P05-OIDC-01.md`.