test(ci): diagnose socat startup and add private Python fallback
This commit is contained in:
1 parent
5f542a6aa3
commit
7b80f411b2
24 files changed
+338
-31
No files matched your search
@@ -39,3 +39,6 @@ Future feature additions need an evidence-backed status update here, an exact de
|
||||
|
||||
|
||||
**P05-OIDC-02 terminal status:** Gitea Run #91 on `4831165` overall FAILURE: official backend four-service startup, no host ports and exact private Traefik routing **PASS**; pinned socat image/digest **PASS**, but forwarder process **exited code 1**, so all user/client provisioning and real Chromium Auth.js callback/session/negative tests **NOT EXECUTED**. `always()` cleanup **PASS**. Real authenticated OIDC remains BLOCKED; production TLS/MFA not evaluated.
|
||||
|
||||
|
||||
**P05-OIDC-03 planned CI acceptance:** A same-run, safe error-class socat diagnosis and digest-verified Python stdlib private TCP fallback is prepared. The prior Run #91 verified private proxy route and cleanup but **not** any client/user/browser login. Full authenticated OIDC positive/negative flow remains **UNVERIFIED** until one actual Gitea run reaches and passes those contracts. MFA/passkeys and production TLS remain out of scope.
|
||||
@@ -15,6 +15,7 @@ Every file listed below is a direct child of `docs/`. Add/remove rows whenever t
|
||||
| [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 #90 BLOCKED before provisioning; cleanup PASS |
|
||||
| [P05-OIDC-02.md](P05-OIDC-02.md) | Pinned prebuilt forwarder, safe private HTTP diagnostics and actual Run #91 evidence | P05-OIDC-02 / real OIDC BLOCKED by forwarder exit 1, cleanup PASS |
|
||||
| [P05-OIDC-03.md](P05-OIDC-03.md) | Same-run allowlisted socat startup evidence, immutable Python TCP fallback and real OIDC acceptance | P05-OIDC-03 / CI 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 |
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
# P05-OIDC-03 — Forwarder Startup Diagnosis & Real OIDC Acceptance
|
||||
|
||||
**Approved baseline:** `5f542a6aa376d06ba2c1fd3d46835baae9b8654e`.
|
||||
**Prior evidence:** [Gitea Run #91](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/91) on `4831165548feabc2c0a0d39d25c40e0d1bc23bb2` — backend/Traefik private route PASS; `socat` exited 1; no client, user or browser created; owned cleanup PASS.
|
||||
**Current phase:** Focused **CI-only source candidate prepared**; one real Gitea acceptance run required. No declaration of authenticated OIDC PASS without terminal evidence.
|
||||
|
||||
## What changed
|
||||
|
||||
The manual `.gitea/workflows/p05-oidc-acceptance.yml` and original backend/Login/Account code are unchanged. Only `tests/ci/oidc_e2e/run.sh` adds bounded, secret-safe pre-provisioning diagnostics and a deterministic fallback:
|
||||
|
||||
- Reproduce the old `alpine/socat:1.8.1.3` process once in the isolated proxy network namespace, with its verified repo sha256 digest. Check its actual running state and `GET /debug/ready` with exact `Host: localhost:8080`.
|
||||
- If socat exits or is unhealthy, classify **only** a known startup error class from the run-owned sidecar's stderr (such as bind/address/permission/argument) without printing any raw logs or HTTP body. The exact socat cause remains **unknown** until this CI evidence exists. Remove only its run-labeled container.
|
||||
- Make at most one **same-run** switch to the official `python:3.12-alpine` image, validate its registry sha256 digest and run `tests/ci/oidc_e2e/forwarder.py` in the **same** run-owned proxy namespace/container name. The Python standard-library code binds only **IPv4 127.0.0.1:8080** and transparently relays opaque TCP bytes to **127.0.0.1:80**; no `pip`, privileged port, host port or secret observation.
|
||||
- Fail closed before provisioning unless private forwarder `/debug/ready` returns HTTP 200 with original Host. The separately approved `provision.py`, Chromium `browser.cjs`, Account Portal Auth.js and all negative authentication tests are unchanged. Existing mandatory `always()` cleanup still checks exact owner labels, Postgres, bootstrap PAT, credential volumes and no leftovers.
|
||||
|
||||
## Exact acceptance
|
||||
|
||||
**Full real-browser acceptance requires one actual successful Gitea CI run** proving the private network, official disposable ZITADEL project/client/verified human provisioning, real original Login V2 password, code + PKCE S256/state/nonce and Auth.js callback, authenticated subject and protected Account pages/API, anonymous/invalid callback rejection, local logout and complete `always()` cleanup. A forwarder-only pass or a mere discovery/JWKS response cannot be called authenticated login.
|
||||
|
||||
**No** local application tests/builds/Docker, real users, production HTTPS, MFA/passkeys, tags or deployment. See `notes/P05-OIDC-03.md` for pre-change scope and exact actual run ledger; `project/OIDC-E2E-ARCHITECTURE.md` for source/network boundaries.
|
||||
@@ -82,6 +82,11 @@ Implement one explicitly approved phase at a time. Keep out-of-scope files, exis
|
||||
- Pre-change `notes/P05-OIDC-02.md`: before provisioning probe private 127.0.0.1:80 proxy/Host HTTP 200; replace runtime `apk add` with published versioned `alpine/socat:1.8.1.3`, verify preinstalled entrypoint + digest and run by immutable digest; inspect sidecar state/exit and require private forwarded 127.0.0.1:8080 HTTP 200; fix only the provisioner's status-only readiness without touching official API/secret checks. Existing owned-only cleanup unmodified.
|
||||
- **Actual single Gitea Run #91:** tested `4831165548feabc2c0a0d39d25c40e0d1bc23bb2`, overall **FAILURE**. 4-service backend health, no-host-ports, private Traefik:80 Host-routing HTTP 200, socat version/entrypoint/digest checks **PASS**. socat sidecar **exited (code 1)** before localhost:8080 readiness; no project/client/human or real Chromium/PKCE/callback/session tests executed. **Always-run owned cleanup PASS**. Root cause inside socat process not proven without safe startup stderr diagnostics. NO rerun, local app tests or production changes. Follow-up P05-OIDC-03 requires separate exact approval, not auth bypass. `notes/P05-OIDC-02.md`, `docs/P05-OIDC-02.md`.
|
||||
|
||||
## P05-OIDC-03 — Forwarder Process Diagnosis and Real OIDC Acceptance (APPROVED 2026-11-23)
|
||||
- Baseline `5f542a6aa376d06ba2c1fd3d46835baae9b8654e`. Gitea Run #91 proved 4 healthy services, private proxy Host route and prebuilt socat digest PASS, but socat exited 1; project/client/human/browser NOT EXECUTED; cleanup PASS. Actual socat stderr root cause unverified.
|
||||
- Exact write scope: `tests/ci/oidc_e2e/run.sh`, optional new `forwarder.py` because Run #91 proved socat unreliable; `provision.py` / `cleanup.sh` ONLY if a separately reproduced narrow defect; `notes/**`, `project/**`, relevant `docs/**` and associated README/MINIFEST navigation. Original backend/Compose, Login V2, Account Portal, browser scripts, manifests/lockfiles and production READ-ONLY. Preserve untracked `AI_INSTRUCTIONS.md`.
|
||||
- Single CI-only run plan: start pinned socat for safe error classification before credentials; only if unhealthy, remove its run-labeled container and use official `python:3.12-alpine` resolved immutable digest, copying a transparent 127.0.0.1:8080 → 127.0.0.1:80 stdlib relay; fail closed on forwarded HTTP/Host readiness. Continue unchanged official provisioning, original Chromium password/PKCE/state/nonce/Auth.js callback/session/negative tests and mandatory owned cleanup. **ONE manual Gitea cycle, no local tests or production deployment; real PASS only on actual browser & cleanup evidence.** `notes/P05-OIDC-03.md`, `docs/P05-OIDC-03.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
@@ -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 the P05-OIDC-02 [Run #91](P05-OIDC-02.md) exact forwarder exit-code blocker and successful cleanup see the operator report. For the previous Run #90 blocker and cleanup 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.
|
||||
For P05-OIDC-03's single-run socat startup classification and private Python fallback acceptance see [P05-OIDC-03.md](P05-OIDC-03.md). Historical Run #91 exit-code blocker and safe cleanup are in [P05-OIDC-02.md](P05-OIDC-02.md). For the previous Run #90 blocker and cleanup 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.
|
||||
@@ -114,3 +114,6 @@ In Gitea `vibtools/ZitPlane` → Actions → **ZitPlane P05-OIDC-01 Disposable R
|
||||
|
||||
|
||||
**P05-OIDC-02 actual Gitea status:** [Run #91](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/91) **FAILED** after original ZITADEL 4-service startup, private proxy Host routing and socat image verification all PASS. The private forwarder container exited with code 1, preventing disposable OIDC client/user and browser login. Every authentication/callback/session assertion remains **NOT EXECUTED**; mandatory cleanup **PASS**. Do not manually add users or open network ports. See `docs/P05-OIDC-02.md`; a separate P05-OIDC-03 approval is required for CI-only forwarder startup diagnostics.
|
||||
|
||||
|
||||
**P05-OIDC-03 acceptance:** The existing manual `p05-oidc-acceptance.yml` on a dedicated Gitea Docker runner will first classify the disposable socat startup and, if unhealthy, start a digest-verified official Python-only `127.0.0.1:8080` loopback forwarder within the same private proxy namespace. It then must prove the original official OIDC client/user + real Chromium Login V2/Account callback/session/negative contracts and owned-resource teardown. This changes no production secrets, identity settings, Login/Auth.js code or published host ports. Actual PASS/BLOCKED status is in `notes/P05-OIDC-03.md`.
|
||||
@@ -66,3 +66,6 @@ Job #197 in [Run #90](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/90) fai
|
||||
|
||||
|
||||
**P05-OIDC-02 Run #91 verified distinction:** a private `Host: localhost:8080` request to Traefik:80 is healthy, but the **version-pinned prebuilt socat sidecar immediately exited code 1**. Image entrypoint/digest check passed; this is a forwarder-process startup blocker, not evidence of an Auth.js/password/PKCE problem. No full 8080 forwarder response or browser flow was attempted after exit. Its exact stderr cause is unknown. The only approved next action is narrowly scoped safe startup diagnosis/forwarder fix in P05-OIDC-03; no open host port or production change. Owned cleanup **PASS**.
|
||||
|
||||
|
||||
**P05-OIDC-03 CI-only follow-up:** Run #91's `socat` process exited code 1 despite healthy Traefik Host route; exact stderr root cause was unknown. New `run.sh` captures only a fixed pre-credential startup error **class** (never raw logs), then can switch once within the same run to the official, SHA256-digest-selected Python stdlib forwarder. If private HTTP 200 still fails, stop before OIDC client/user provisioning and keep the failure marked BLOCKED. No host ports, no PKCE/nonce/state bypass, no local app tests, and mandatory existing cleanup remains unchanged. See `docs/P05-OIDC-03.md` for actual terminal result.
|
||||
Reference in new issue
Block a user