fix(ci): narrow Auth.js subject and extend disposable P05 verification
This commit is contained in:
1 parent
42adaba004
commit
c27fe3d323
23 files changed
+415
-45
No files matched your search
@@ -1,6 +1,6 @@
|
||||
# ZitPlane - Actual feature availability / limitations
|
||||
|
||||
Snapshot: 2026-11-22, P05-CI-01 source preparation based on baseline `7ecf531`. **SOURCE EXISTS != RUNNING != VERIFIED != PRODUCTION**.
|
||||
Snapshot: 2026-11-22, P05-CI-02 source preparation based on baseline `42adaba`. New patch acceptance pending a focused Gitea Actions run. **SOURCE EXISTS != RUNNING != VERIFIED != PRODUCTION**.
|
||||
|
||||
| Feature | Source present | CI/build verified | Live/deployed |
|
||||
| --- | --- | --- | --- |
|
||||
|
||||
@@ -8,6 +8,7 @@ Every file listed below is a direct child of `docs/`. Add/remove rows whenever t
|
||||
| [MINIFEST.md](MINIFEST.md) | Direct-file manifest and phase ownership | DOCS-01 / active |
|
||||
| [USER-GUIDE.md](USER-GUIDE.md) | Source-grounded Account Portal page/button-by-button manual | DOCS-01 / active; runtime pending |
|
||||
| [P05-CI-01.md](P05-CI-01.md) | Gitea Actions manual verification workflow, gates, limitations and real run evidence | P05-CI-01 / Run #81 complete, acceptance blocked |
|
||||
| [P05-CI-02.md](P05-CI-02.md) | TypeScript remediation, Gitea CI verification, dependency risk and isolation evidence | P05-CI-02 / awaiting CI |
|
||||
| [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 |
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
# ZitPlane P05-CI-02 — Targeted CI acceptance
|
||||
|
||||
**Date:** 2026-11-22
|
||||
**Baseline:** `42adaba0044ee5cb86e6e6bcfd4e00e5fe96ad00`
|
||||
**State:** Source prepared; Gitea acceptance run pending.
|
||||
|
||||
## What changed and why
|
||||
|
||||
- Account Portal's Auth.js `session` callback now narrows the JWT's optional identity subject to a real `string` before computing the valid session identity. The previous code's non-null assertion could infer `{}` and failed TypeScript `TS2345` in Run #81. No login provider flow, PKCE/state/nonce, expiry rule, API guard, password or UI changes.
|
||||
- Gitea's existing `p05-ci.yml` remains manual only, builds Account Portal with exact npm lock, runs Login V2 frozen build/1,219 upstream unit regressions, collects npm/pnpm advisory metadata, checks disposable Docker readiness/Postgres restart persistence/OIDC metadata/JWKS and always cleans up.
|
||||
- Source-only/negative contract tests verify untrusted issuer/JWKS rejection; a CI-only started Account Portal checks unauthenticated `/api/account/me` returns 401/no-store and protected `/account` redirects to `/signin`. **No real authenticated user test**.
|
||||
- Security gate still fails for HIGH/CRITICAL advisories. Separate JSON inventory records Moderate IDs, affected package/range and available patches; **no dependency changes**.
|
||||
|
||||
## How to run
|
||||
|
||||
Gitea > `vibtools/ZitPlane` > Actions > `ZitPlane P05 CI Verification` > Run workflow on `main`. This runs only on a Docker-capable, isolated Gitea runner. It never deploys to Coolify or production identity domains.
|
||||
|
||||
## Status and scope of proof
|
||||
|
||||
A green source/typecheck job does not prove an authenticated OIDC callback or MFA. A green Docker job proves **disposable local** backend readiness/discovery and Postgres persistence only, not Admin Console human login. Full OIDC E2E remains a separate planned scope.
|
||||
|
||||
The workflow uses a fixed P02 dev network, so it refuses to start when that network already exists; it must never stop another owner's containers or volumes. Temporary CI credentials must not appear in logs or the repository. When runner/Compose startup is unavailable, mark **BLOCKED**, not PASS.
|
||||
|
||||
## Actual Gitea run evidence
|
||||
|
||||
**PENDING.** Record run ID/SHA, individual terminal job results, real advisory IDs, persistence/cleanup evidence and exact blockers after the single focused CI cycle. See `notes/P05-CI-02.md` for the detailed phase record.
|
||||
@@ -40,6 +40,12 @@ Implement one explicitly approved phase at a time. Keep out-of-scope files, exis
|
||||
- Full OIDC login/session/MFA/Admin Console interactive acceptance is not covered without disposable app/user provisioning; status remains BLOCKED/PENDING, not fabricated PASS.
|
||||
- **Gitea Run #81:** 2 PASS (Login V2 frozen build + 1219/1219 unit tests; high/critical audit) and 2 FAIL (Account Auth.js TypeScript TS2345; Docker Alpine checkout missing Git). 18 moderate advisories unresolved. Pre-checkout Git source fix applied *after* the run, not rerun. See `notes/P05-CI-01.md` and `docs/P05-CI-01.md`. No production deployment/release.
|
||||
|
||||
## P05-CI-02 - Targeted Root-Cause Remediation (APPROVED 2026-11-22)
|
||||
- Baseline `42adaba0044ee5cb86e6e6bcfd4e00e5fe96ad00` (Gitea `main`).
|
||||
- Narrow write scope: `users/ui/src/auth.ts`, optional `src/types/next-auth.d.ts`, `.gitea/workflows/p05-ci.yml`, `tests/ci/**`, `notes/**`, `project/**`, relevant `docs/**`, associated CI README/MINIFEST, root navigation only if required.
|
||||
- B01 Auth.js TypeScript TS2345: real subject string narrowing, preserve PKCE/state/nonce, expiry and protected identity guard. B02: verify in-CI Docker checkout, disposable ZITADEL, PostgreSQL restart persistence and OIDC discovery/JWKS. B03: report real Moderate advisory IDs/package/fix; HIGH+ security threshold remains a failure gate. B04: negative OIDC metadata and anonymous Account Portal checks, with interactive user E2E explicitly deferred.
|
||||
- One focused manually triggered Gitea Actions cycle, no local builds/tests/Docker, no production deployment. Exact result: `notes/P05-CI-02.md`, `docs/P05-CI-02.md`; blocked results remain blocked.
|
||||
|
||||
## P05 - Full Integration (proposed, NOT approved)
|
||||
Shared design system, production-safe Compose topology and verified Login/Account OIDC wiring. No live deployment; separate approval.
|
||||
|
||||
|
||||
@@ -20,6 +20,13 @@
|
||||
|
||||
Include environment (local disposable vs CI vs production), exact phase/commit, which page/action, a **redacted** error and reproduction conditions. Never publish `.env`, client secret, passwords, access tokens, cookies, private keys or user data. Link to relevant phase note; record the fix and updated user guidance together.
|
||||
|
||||
## P05-CI-02 verification and error boundaries
|
||||
|
||||
- Prior Account Portal `TS2345` at `src/auth.ts(14,61)` in Gitea Run #81 was caused by the callback returning a JWT subject not statically narrowed to `string`. P05-CI-02 source narrows it with `typeof`; it is not considered fixed until CI typecheck/build passes.
|
||||
- Previous Alpine backend checkout missed Git; current workflow installs Git before checkout. Docker readiness/persistence must be proved by the new CI run, not inferred from this change.
|
||||
- A green HIGH/CRITICAL advisory audit gate still allows Moderate findings; the P05-CI-02 registry detail report records IDs/package/fix separately, without package upgrades.
|
||||
- CI negative access tests do not simulate real login; actual OIDC app registration/authorized login/MFA must receive separate approval.
|
||||
|
||||
## Known limitations
|
||||
|
||||
No live integration verification, Account Portal lockfile, CI pipeline, Coolify production deployment, tested authentication redirects or production support guarantees exist as of P04. Before adding any diagnostic workaround, consult the Scope Lock in `notes/` and preserve ZITADEL's security boundaries.
|
||||
Reference in new issue
Block a user