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
@@ -17,6 +17,7 @@ This is the **developer-focused implementation history**. `notes/CHANGELOG.md` i
|
||||
| 2026-11-22 | P05-SEC-02-A01 | Verify existing corrected helper, exact seven PNPM scoped overrides, frozen Login Nx build and upstream Vitest; no source/lock changes | **Gitea Run #89 SUCCESS** on `ff4c58e`, 84/84 files, 1219/1219 tests, Login audit 0 Moderate/High/Critical; `notes/P05-SEC-02-A01.md` |
|
||||
| 2026-11-22 | P05-OIDC-01 | Added manual disposable IAM_OWNER/client/human/browser OIDC acceptance harness, secret isolation and cleanup | Run #90 FAIL before provisioning: private loopback forwarder unready; 4 backend services healthy, owned cleanup PASS. `notes/P05-OIDC-01.md` |
|
||||
| 2026-11-22 | P05-OIDC-02 | CI-only prebuilt socat digest startup, private proxy/Host/readiness/exit checks and status-only provisioner | **Run #91 FAILED**: 4 services + private proxy PASS, sidecar exit code 1; no real user/browser test; cleanup PASS. `notes/P05-OIDC-02.md` |
|
||||
| 2026-11-23 | P05-OIDC-03 | Redacted socat startup diagnosis and strictly private/digest-pinned official Python stdlib fallback | Source prepared; one disposable CI pending. `notes/P05-OIDC-03.md` |
|
||||
|
||||
## Required entry for each future change
|
||||
|
||||
|
||||
@@ -142,3 +142,6 @@ New source in `tests/ci/oidc_e2e/run.sh`: test namespace-local Traefik proxy Hos
|
||||
|
||||
|
||||
**P05-OIDC-02 Gitea Run #91 result:** tested `4831165`, job #198 overall FAIL. All 4 services healthy PASS, no runner host port PASS, private Traefik:80 Host-route HTTP 200 PASS, prebuilt socat/digest verification PASS. The run-owned socat sidecar **exited 1** before forwarded 8080 check, so no project/client/user or Chromium/Auth.js checks executed. Mandatory cleanup PASS, no remaining owned resources. Source-only status readiness fix in `provision.py` **was not exercised**. Root cause inside sidecar unproven without redacted startup error diagnostics. Next separately approved P05-OIDC-03 limited to private CI process/diagnostics.
|
||||
|
||||
|
||||
**P05-OIDC-03 approved CI-only source:** The existing manual workflow is unchanged. Run #91's verified socat exit 1 justifies a single-run diagnostic attempt plus a one-time deterministic, digest-pinned `python:3.12-alpine` stdlib private forwarder fallback. Only run-labeled containers, 127.0.0.1:8080 → private Traefik:80, bounded error-class diagnostics and original proxy Host HTTP 200 gate are permitted. The diagnostic/fallback happens before real provisioning; no authentication, browser or cleanup source changed. A new single Gitea run must prove all real client/user/browser/callback/session and mandatory owned cleanup checks or remain BLOCKED.
|
||||
@@ -171,3 +171,6 @@ Official Login V2 user/auth source, user Account Portal, backend Compose and pro
|
||||
|
||||
|
||||
**P05-OIDC-02 updated CI functions only:** `tests/ci/oidc_e2e/run.sh` stage between four-service readiness and provisioning now explicitly validates proxy Host/HTTP status, pulls version-pinned prebuilt socat, checks its entrypoint/immutable image digest and checks the private 8080 listener plus sidecar running/exit state. `tests/ci/oidc_e2e/provision.py::wait_until_ready()` checks HTTP 200 without JSON decoding. `cleanup.sh`, browser scripts and all application/backend/auth source remain read-only.
|
||||
|
||||
|
||||
**P05-OIDC-03:** `tests/ci/oidc_e2e/forwarder.py` new CI-only asyncio stdlib opaque TCP localhost relay. `tests/ci/oidc_e2e/run.sh` now first classifies existing socat startup stderr into fixed safe error classes and, on unhealthy socat, switches only once to immutable-digest official Python within the same run-owned container name/network namespace. `cleanup.sh` and `provision.py` untouched; `browser.cjs`, `users/ui/**`, `auth/ui/v2/**` and the original P02 Compose untouched.
|
||||
@@ -136,3 +136,6 @@ Existing `tests/ci/security_advisory_gate.py` remains the independent **live reg
|
||||
|
||||
|
||||
**P05-OIDC-02 Run #91 actual invocation:** `run.sh` correctly proved the underlying proxy's exact HTTP Host route and pinned image metadata, then observed the forwarder `docker inspect` state `exited`, exit code 1 and **stopped before provisioning**. The updated `provision.py::wait_until_ready()`, official provisioning functions and `browser.cjs` were **not reached** and remain unverified in this phase. Exact owned cleanup completed. Never infer a successful session from source-only logic.
|
||||
|
||||
|
||||
**P05-OIDC-03 narrow new functions:** `run.sh::forwarder_http_ready` makes an actual status-only HTTP probe through private `127.0.0.1:8080` to the original proxy with `Host: localhost:8080`. The socat fallback branch reads *only* its pre-credential startup stderr into an allowlisted Python error classifier, verifies run-owner label before replacement, then resolves official Python by digest. `forwarder.py::copy_bytes` relays opaque 64 KiB TCP chunks without logging payload; `forwarder.py::serve_client` connects only to localhost:80 and transparently relays both directions; `forwarder.py::main` binds IPv4 loopback :8080 and emits fixed safe errno classes. Original IAM/user/PKCE/Auth.js functions unchanged.
|
||||
@@ -64,3 +64,12 @@ The previous Gitea Run #90 verified a healthy, portless P02 stack but did not ca
|
||||
Gitea [Run #91](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/91) on `4831165548feabc2c0a0d39d25c40e0d1bc23bb2`, job #198, overall **FAILURE**. Four official backend services and portless CI Compose PASS. A **direct** `GET /debug/ready` on Traefik private 127.0.0.1:80 with `Host: localhost:8080` **PASS**; the old "maybe proxy Host routing is down" theory is disproven for this run. The versioned prebuilt `alpine/socat:1.8.1.3` image entrypoint and immutable digest verified **PASS**, but when started in the proxy network namespace the sidecar reported `exited`, **exit code 1**. No startup stderr was retained; the specific binary/runtime/bind/flag error remains **unknown**, so no unsupported cause is asserted. The status-only `provision.py::wait_until_ready()`, project/client/human APIs, real browser password flow, PKCE/state/nonce, Auth.js callback, Account session/positive and negative tests were **NOT EXECUTED**.
|
||||
|
||||
`always()` cleanup PASS: both `ZITPLANE_BACKEND_CLEANUP_VERIFIED_PASS` and `ZITPLANE_OIDC_ALL_RESOURCES_CLEANED_PASS`. Original backend, Compose, Login V2, Auth.js source, manifests and security rules unchanged. Next phase should restrict writes to CI-only startup diagnostics/forwarder, verify the new forwarder HTTP 200 **before** provisioning, preserve private network namespace and ownership checks, then exactly one independently authorized real browser CI acceptance. **No application auth bypass or production deployment**.
|
||||
|
||||
|
||||
## P05-OIDC-03 — CI-only exit-class evidence and transparent Python loopback fallback
|
||||
|
||||
Run #91 established an isolated private Traefik:80/Host HTTP 200 and a socat sidecar `exited 1`, but not the internal startup reason. `tests/ci/oidc_e2e/run.sh` now runs a single socat startup probe *before user/client provisioning*, checks container state and private forwarded HTTP 200, classifies only allowlisted error classes from the diagnostic sidecar's own stderr (never prints raw logs), and retains socat when healthy. If unhealthy, it verifies the run ownership label, deletes only that diagnostic container, then resolves the already-used official `python:3.12-alpine` to its registry sha256 digest and starts the `forwarder.py` byte relay in the **same run-owned Docker container name and Traefik network namespace**. No host port, new credentials, tokens or HTTP-body logging. Both paths must pass private `127.0.0.1:8080 /debug/ready` with exact Host before calling official APIs.
|
||||
|
||||
`tests/ci/oidc_e2e/forwarder.py` uses Python stdlib `asyncio.start_server`, binds only IPv4 `127.0.0.1:8080`, proxies to namespace-local `127.0.0.1:80`, relays opaque bounded byte chunks and emits only fixed safe startup/relay status markers. No HTTP inspection, cookie extraction, IdP simulation or login bypass. Original provisioning APIs, Account Portal Auth.js, Chromium tests and owner-labeled `cleanup.sh` unchanged.
|
||||
|
||||
**Only terminal Gitea evidence can confirm** socat failure class and Python fallback compatibility, full real ZITADEL client/user creation, original Login V2 browser callback/subject, negative authorization and teardown. Production TLS/MFA still separate.
|
||||
@@ -90,3 +90,6 @@ CI only: official ZITADEL v4.20.4, official Login V2 v4.20.4, PostgreSQL 17.10/T
|
||||
|
||||
|
||||
**P05-OIDC-02 runtime status:** Gitea Run #91 verified `alpine/socat:1.8.1.3` image metadata and immutable digest selection, but the image process **exited code 1** after start. The underlying private proxy:80/Host route was healthy; no OIDC provisioning or browser E2E executed. There was no local application install/build. All CI-owned resources were cleaned. Image metadata verification **does not prove** the forwarding process works or that authenticated OIDC is ready.
|
||||
|
||||
|
||||
**P05-OIDC-03 CI dependency:** Keep existing pinned `alpine/socat:1.8.1.3` for a single startup/error-class observation. If not healthy, use the already-existing official `python:3.12-alpine` CI image resolved to an immutable registry SHA256 digest, running only the tracked stdlib-only `forwarder.py` (no `pip`, `apk`, extra package manifest or lockfile update). Both run solely inside the disposable proxy network namespace, bind no host port, hold no auth data and are removed by existing always-run ownership cleanup. Source preparation is not successful login proof.
|
||||
+21
-18
@@ -1,25 +1,25 @@
|
||||
# ZitPlane ? exact tracked source inventory
|
||||
|
||||
**Snapshot:** 2026-11-22, P05-OIDC-02 source tested by Gitea Run #91 at `4831165548feabc2c0a0d39d25c40e0d1bc23bb2`: four services and private proxy PASS, socat sidecar exited 1, OIDC provisioning/browser NOT EXECUTED; owned cleanup PASS. Final docs-only commit is not a new CI-verified source.
|
||||
**Snapshot:** 2026-11-23, P05-OIDC-03 focused source candidate on approved baseline `5f542a6`. Run #91 socat startup exited 1 and real browser acceptance is **NOT YET VERIFIED**.
|
||||
|
||||
**Git-tracked file paths: 748.** Untracked `AI_INSTRUCTIONS.md` and ignored local secrets excluded.
|
||||
**Git-tracked paths: 751.** Untracked `AI_INSTRUCTIONS.md` and local secrets excluded.
|
||||
|
||||
This inventory records exact Git paths, not live browser authentication. See `notes/P05-OIDC-02.md` and `project/OIDC-E2E-ARCHITECTURE.md`.
|
||||
This list reflects actual tracked Git files, not proof of authenticated OIDC. See `notes/P05-OIDC-03.md` and `project/OIDC-E2E-ARCHITECTURE.md`.
|
||||
|
||||
| Group | Paths | Responsibility |
|
||||
| --- | ---: | --- |
|
||||
| `(repository root)` | 6 | Tracked repository root |
|
||||
| `.gitea` | 8 | Manual Gitea CI-only verification workflows |
|
||||
| `auth` | 639 | Pinned official Login V2 source and dependency lock |
|
||||
| `core` | 2 | Development backend |
|
||||
| `deployment` | 2 | Read-only developer Compose |
|
||||
| `docs` | 20 | Operator and user guides |
|
||||
| `notes` | 12 | Phase plans and real CI evidence |
|
||||
| `packages` | 1 | First-party placeholder |
|
||||
| `project` | 12 | Architecture, function maps, security and source inventory |
|
||||
| `scripts` | 1 | First-party placeholder |
|
||||
| `tests` | 21 | Gitea CI-only contracts and browser harness |
|
||||
| `users` | 24 | Read-only Account Portal source |
|
||||
| `(repository root)` | 6 | Repository root |
|
||||
| `.gitea` | 8 | Manual Gitea CI verification and manifests |
|
||||
| `auth` | 639 | Pinned official Login V2 source, unmodified |
|
||||
| `core` | 2 | Backend dev helper, unmodified |
|
||||
| `deployment` | 2 | P02 dev Compose, unmodified |
|
||||
| `docs` | 21 | User and operator docs |
|
||||
| `notes` | 13 | Phase plans and CI evidence |
|
||||
| `packages` | 1 | Repository root |
|
||||
| `project` | 12 | Source, functions and architecture inventory |
|
||||
| `scripts` | 1 | Repository root |
|
||||
| `tests` | 22 | CI-only verification and disposable OIDC browser/forwarder |
|
||||
| `users` | 24 | Account Portal source, unmodified |
|
||||
|
||||
## Exact tracked paths
|
||||
|
||||
@@ -695,7 +695,7 @@ This inventory records exact Git paths, not live browser authentication. See `no
|
||||
- `deployment/README.md`
|
||||
- `deployment/docker/compose.backend.dev.yaml`
|
||||
|
||||
### docs ? 20 files
|
||||
### docs ? 21 files
|
||||
|
||||
- `docs/ARCHITECTURE.md`
|
||||
- `docs/DEVELOPMENT.md`
|
||||
@@ -709,6 +709,7 @@ This inventory records exact Git paths, not live browser authentication. See `no
|
||||
- `docs/P05-CI-03.md`
|
||||
- `docs/P05-OIDC-01.md`
|
||||
- `docs/P05-OIDC-02.md`
|
||||
- `docs/P05-OIDC-03.md`
|
||||
- `docs/P05-SEC-01.md`
|
||||
- `docs/P05-SEC-02-A01.md`
|
||||
- `docs/P05-SEC-02.md`
|
||||
@@ -718,7 +719,7 @@ This inventory records exact Git paths, not live browser authentication. See `no
|
||||
- `docs/TROUBLESHOOTING.md`
|
||||
- `docs/USER-GUIDE.md`
|
||||
|
||||
### notes ? 12 files
|
||||
### notes ? 13 files
|
||||
|
||||
- `notes/CHANGELOG.md`
|
||||
- `notes/DOCS-01.md`
|
||||
@@ -728,6 +729,7 @@ This inventory records exact Git paths, not live browser authentication. See `no
|
||||
- `notes/P05-CI-03.md`
|
||||
- `notes/P05-OIDC-01.md`
|
||||
- `notes/P05-OIDC-02.md`
|
||||
- `notes/P05-OIDC-03.md`
|
||||
- `notes/P05-SEC-01.md`
|
||||
- `notes/P05-SEC-02-A01.md`
|
||||
- `notes/P05-SEC-02.md`
|
||||
@@ -756,7 +758,7 @@ This inventory records exact Git paths, not live browser authentication. See `no
|
||||
|
||||
- `scripts/README.md`
|
||||
|
||||
### tests ? 21 files
|
||||
### tests ? 22 files
|
||||
|
||||
- `tests/README.md`
|
||||
- `tests/ci/MINIFEST.md`
|
||||
@@ -773,6 +775,7 @@ This inventory records exact Git paths, not live browser authentication. See `no
|
||||
- `tests/ci/oidc_e2e/browser.sh`
|
||||
- `tests/ci/oidc_e2e/cleanup.sh`
|
||||
- `tests/ci/oidc_e2e/compose.owner.override.yaml`
|
||||
- `tests/ci/oidc_e2e/forwarder.py`
|
||||
- `tests/ci/oidc_e2e/provision.py`
|
||||
- `tests/ci/oidc_e2e/run.sh`
|
||||
- `tests/ci/security_advisory_gate.py`
|
||||
|
||||
Reference in new issue
Block a user