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
@@ -33,3 +33,6 @@ See `notes/P05-CI-01.md` and `tests/ci/`.
|
|||||||
|
|
||||||
|
|
||||||
**P05-OIDC-02 final Gitea acceptance:** Manual Run #91, tested `4831165548feabc2c0a0d39d25c40e0d1bc23bb2`, overall **FAILURE**. Four backend services, no host port, private Traefik:80/Host HTTP routing and versioned prebuilt socat entrypoint/digest checks PASS; run-labeled sidecar `exited` with code **1**, so no OIDC client/user/browser request or Auth.js callback was tested. Always-run exact resource cleanup **PASS**, no second CI run. Next P05-OIDC-03 must safely classify the pre-provisioning forwarder process exit, keeping actual user authentication untouched.
|
**P05-OIDC-02 final Gitea acceptance:** Manual Run #91, tested `4831165548feabc2c0a0d39d25c40e0d1bc23bb2`, overall **FAILURE**. Four backend services, no host port, private Traefik:80/Host HTTP routing and versioned prebuilt socat entrypoint/digest checks PASS; run-labeled sidecar `exited` with code **1**, so no OIDC client/user/browser request or Auth.js callback was tested. Always-run exact resource cleanup **PASS**, no second CI run. Next P05-OIDC-03 must safely classify the pre-provisioning forwarder process exit, keeping actual user authentication untouched.
|
||||||
|
|
||||||
|
|
||||||
|
**P05-OIDC-03:** Existing manual-only `p05-oidc-acceptance.yml` unchanged; only run-owned `tests/ci/oidc_e2e/run.sh` and new `forwarder.py` implement allowlisted socat startup error classification and, when needed, one same-run official Python image sha256-digest private 8080→80 fallback. Always cleanup unchanged. A new Gitea run must actually verify client/user, browser Auth.js callback, protected session, negatives, and teardown before PASS.
|
||||||
@@ -15,6 +15,7 @@ Compact, developer-friendly monorepo for a central identity service, a branded l
|
|||||||
- **P05-SEC-02-A01:** **Gitea Run #89 SUCCESS** on `ff4c58e`: corrected exact override contract PASS, pinned PNPM frozen install PASS, official Login V2 standalone build PASS, upstream Vitest **1219/1219 PASS**, Login production audit **0 Moderate/High/Critical**; Account jobs skipped. **Dependency security/build unit acceptance complete; real user OIDC/MFA E2E and production integration NOT verified**. See `docs/P05-SEC-02-A01.md`.
|
- **P05-SEC-02-A01:** **Gitea Run #89 SUCCESS** on `ff4c58e`: corrected exact override contract PASS, pinned PNPM frozen install PASS, official Login V2 standalone build PASS, upstream Vitest **1219/1219 PASS**, Login production audit **0 Moderate/High/Critical**; Account jobs skipped. **Dependency security/build unit acceptance complete; real user OIDC/MFA E2E and production integration NOT verified**. See `docs/P05-SEC-02-A01.md`.
|
||||||
- **P05-OIDC-01:** Gitea **Run #90 FAILED**: disposable four-service ZITADEL stack healthy and host-portless, but private `localhost:8080` loopback forwarding was not ready. Provisioning aborted before OIDC client/human/browser creation; real callback/session **NOT verified**. Owned database/bootstrap/secret/network cleanup **PASS**. No app/auth source change or deployment. See `docs/P05-OIDC-01.md`.
|
- **P05-OIDC-01:** Gitea **Run #90 FAILED**: disposable four-service ZITADEL stack healthy and host-portless, but private `localhost:8080` loopback forwarding was not ready. Provisioning aborted before OIDC client/human/browser creation; real callback/session **NOT verified**. Owned database/bootstrap/secret/network cleanup **PASS**. No app/auth source change or deployment. See `docs/P05-OIDC-01.md`.
|
||||||
- **P05-OIDC-02:** **Gitea Run #91 FAILURE**: original four backend services and no-host-port private Traefik Host routing PASS, prebuilt socat version/digest PASS; forwarder immediately **exited with code 1**, so client/user/browser/Auth.js callback NOT EXECUTED. Cleanup PASS. No application/auth/backend edits; real OIDC remains BLOCKED. See `docs/P05-OIDC-02.md`.
|
- **P05-OIDC-02:** **Gitea Run #91 FAILURE**: original four backend services and no-host-port private Traefik Host routing PASS, prebuilt socat version/digest PASS; forwarder immediately **exited with code 1**, so client/user/browser/Auth.js callback NOT EXECUTED. Cleanup PASS. No application/auth/backend edits; real OIDC remains BLOCKED. See `docs/P05-OIDC-02.md`.
|
||||||
|
- **P05-OIDC-03:** Approved CI-only real OIDC retry after socat exited 1 in Run #91: safe socat startup error classification and same-run immutable official Python stdlib loopback fallback, with original auth/browser/cleanup unchanged. **Real login acceptance CI pending**. See `docs/P05-OIDC-03.md`.
|
||||||
- **Production / Coolify:** not configured or deployed.
|
- **Production / Coolify:** not configured or deployed.
|
||||||
|
|
||||||
## Documentation and project knowledge
|
## Documentation and project knowledge
|
||||||
|
|||||||
@@ -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-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-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-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-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 |
|
| [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 |
|
| [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 |
|
| [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.
|
- 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`.
|
- **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)
|
## P05 - Full Integration (proposed, NOT approved)
|
||||||
Shared design system, production-safe Compose topology and verified Login/Account OIDC wiring. No live deployment; separate approval.
|
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).
|
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-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-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.
|
||||||
@@ -17,5 +17,6 @@ This is the chronological **index**. Phase-specific scope/implementation evidenc
|
|||||||
| 2026-11-22 | P05-SEC-02-A01 | One-run final acceptance of corrected CI parser and unchanged Login lockfile/seven overrides | **Run #89 SUCCESS** on `ff4c58e`: frozen install, standalone build and upstream 1219/1219 tests PASS; audit 0 Moderate/High/Critical; Account jobs skipped. [Evidence](P05-SEC-02-A01.md) |
|
| 2026-11-22 | P05-SEC-02-A01 | One-run final acceptance of corrected CI parser and unchanged Login lockfile/seven overrides | **Run #89 SUCCESS** on `ff4c58e`: frozen install, standalone build and upstream 1219/1219 tests PASS; audit 0 Moderate/High/Critical; Account jobs skipped. [Evidence](P05-SEC-02-A01.md) |
|
||||||
| 2026-11-22 | P05-OIDC-01 | CI-only official ZITADEL OIDC project/client/user and Chromium original Login V2/Auth.js acceptance harness with owned cleanup | **Run #90 FAILED**: 4 services healthy, no host ports; private localhost:8080 forwarder not ready, no user/client/browser created; cleanup VERIFIED PASS. [Evidence](P05-OIDC-01.md) |
|
| 2026-11-22 | P05-OIDC-01 | CI-only official ZITADEL OIDC project/client/user and Chromium original Login V2/Auth.js acceptance harness with owned cleanup | **Run #90 FAILED**: 4 services healthy, no host ports; private localhost:8080 forwarder not ready, no user/client/browser created; cleanup VERIFIED PASS. [Evidence](P05-OIDC-01.md) |
|
||||||
| 2026-11-22 | P05-OIDC-02 | Prebuilt/digest-verified socat, private proxy/Host/sidecar state probes, status-only readiness | **Run #91 FAILURE**: backend and private Host routing PASS; forwarder exited code 1, no provisioning/browser; owned cleanup PASS. [Evidence](P05-OIDC-02.md) |
|
| 2026-11-22 | P05-OIDC-02 | Prebuilt/digest-verified socat, private proxy/Host/sidecar state probes, status-only readiness | **Run #91 FAILURE**: backend and private Host routing PASS; forwarder exited code 1, no provisioning/browser; owned cleanup PASS. [Evidence](P05-OIDC-02.md) |
|
||||||
|
| 2026-11-23 | P05-OIDC-03 | Safe socat exit diagnostics and one digest-pinned Python stdlib private TCP fallback within the same disposable Gitea cycle | Exact [pre-edit scope/evidence](P05-OIDC-03.md), CI pending |
|
||||||
|
|
||||||
Rules: Append new phases or fixes; never silently rewrite a past result. Separate **implemented**, **verified**, **blocked**, and **proposed**. Never log a user secret or personal data.
|
Rules: Append new phases or fixes; never silently rewrite a past result. Separate **implemented**, **verified**, **blocked**, and **proposed**. Never log a user secret or personal data.
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
| [P05-SEC-02-A01.md](P05-SEC-02-A01.md) | Single-run Login-only final frozen/build/unit/security acceptance, scope lock and evidence | P05-SEC-02-A01 / Run #89 SUCCESS, accepted |
|
| [P05-SEC-02-A01.md](P05-SEC-02-A01.md) | Single-run Login-only final frozen/build/unit/security acceptance, scope lock and evidence | P05-SEC-02-A01 / Run #89 SUCCESS, accepted |
|
||||||
| [P05-OIDC-01.md](P05-OIDC-01.md) | Pre-change real browser OIDC Scope Lock, provision/redirect/session/negative tests and one CI run evidence | P05-OIDC-01 / Run #90 FAILED at forwarder readiness; cleanup PASS; acceptance BLOCKED |
|
| [P05-OIDC-01.md](P05-OIDC-01.md) | Pre-change real browser OIDC Scope Lock, provision/redirect/session/negative tests and one CI run evidence | P05-OIDC-01 / Run #90 FAILED at forwarder readiness; cleanup PASS; acceptance BLOCKED |
|
||||||
| [P05-OIDC-02.md](P05-OIDC-02.md) | Pre-change loopback-forwarder scope, pinned digest/preflight fix and one real Gitea acceptance cycle | P05-OIDC-02 / Run #91: private proxy PASS; socat exit 1, OIDC BLOCKED, cleanup PASS |
|
| [P05-OIDC-02.md](P05-OIDC-02.md) | Pre-change loopback-forwarder scope, pinned digest/preflight fix and one real Gitea acceptance cycle | P05-OIDC-02 / Run #91: private proxy PASS; socat exit 1, OIDC BLOCKED, cleanup PASS |
|
||||||
|
| [P05-OIDC-03.md](P05-OIDC-03.md) | Pre-edit scoped socat exit diagnosis, immutable Python loopback fallback and one real browser CI evidence | P05-OIDC-03 / source prepared, one CI pending |
|
||||||
| [CHANGELOG.md](CHANGELOG.md) | Short append-only chronological phase log and links to detailed reports | DOCS-01 / active |
|
| [CHANGELOG.md](CHANGELOG.md) | Short append-only chronological phase log and links to detailed reports | DOCS-01 / active |
|
||||||
|
|
||||||
Update this manifest whenever any direct child file or directory changes. Use **actual source state**; a planned file must be labeled planned, not present.
|
Update this manifest whenever any direct child file or directory changes. Use **actual source state**; a planned file must be labeled planned, not present.
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
# P05-OIDC-03 — Forwarder Startup Diagnosis & Real OIDC Acceptance
|
||||||
|
|
||||||
|
**Date:** 2026-11-23 (Asia/Dhaka)
|
||||||
|
**User-approved exact baseline:** `5f542a6aa376d06ba2c1fd3d46835baae9b8654e`
|
||||||
|
**Previous tested SHA:** `4831165548feabc2c0a0d39d25c40e0d1bc23bb2`, Gitea [Run #91](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/91).
|
||||||
|
**Pre-edit plan status:** APPROVED / EXACT SCOPE LOCK / no P05-OIDC-03 source edit at time of this record.
|
||||||
|
|
||||||
|
## Run #91 evidence and actual unknown
|
||||||
|
|
||||||
|
- One focused Gitea run #91, job #198, overall **FAILURE**.
|
||||||
|
- Disposable PostgreSQL, ZITADEL API, official Login V2 and Traefik 4/4 healthy **PASS**; zero published host ports **PASS**.
|
||||||
|
- Private Traefik:80 Host `localhost:8080` HTTP 200 **PASS**; `alpine/socat:1.8.1.3` tag, `socat` entrypoint and pulled sha256 image digest **PASS**.
|
||||||
|
- Forwarding sidecar immediately `exited`, `ExitCode=1` before forwarded :8080 check **FAIL**. Its stderr was not captured. Exact cause **UNKNOWN**; could be socat CLI/address parser, bind/socket, image runtime or another error. **Do not claim bind failure or any specific errno without observing it**.
|
||||||
|
- Official project/client/human provisioning, Chromium original Login V2 password, Auth.js PKCE/state/nonce/code callback, authenticated subject/pages, negative tests and logout **NOT EXECUTED**. They were not proven in Runs #90/#91.
|
||||||
|
- `always()` owned cleanup `ZITPLANE_BACKEND_CLEANUP_VERIFIED_PASS` and `ZITPLANE_OIDC_ALL_RESOURCES_CLEANED_PASS` **PASS**, no CI-owned resources persisted.
|
||||||
|
|
||||||
|
## Scope Lock — exact approved writes
|
||||||
|
|
||||||
|
1. `tests/ci/oidc_e2e/run.sh` for narrowly scoped forwarding lifecycle, secret-free socat stderr classification, explicit private proxy/Host/sockets, and optionally switching to a vetted immutable official Python TCP forwarder if socat exits or fails health.
|
||||||
|
2. New `tests/ci/oidc_e2e/forwarder.py` **only because** Run #91 has proved the pinned socat container process exits code 1 despite healthy underlying proxy routing. The implementation must bind IPv4 `127.0.0.1:8080` only and relay bytes to **namespace-local** `127.0.0.1:80`; no auth changes, external requests, secret/cookie/HTTP-body printing or host port publication. Use the official `python:3.12-alpine` image resolved to immutable repo digest at CI runtime (already used by the existing isolated provisioner), and copy only this script into the run-labeled sidecar.
|
||||||
|
3. `tests/ci/oidc_e2e/provision.py` and `cleanup.sh` **only if an exact new defect is reproduced**. Existing run-owned cleanup and official API security must be preserved.
|
||||||
|
4. `notes/**`, `project/**`, relevant `docs/**`, associated `README.md`/`MINIFEST.md` and root navigation if needed.
|
||||||
|
|
||||||
|
**STRICT read-only:** `core/backend/zitadel/**`, `deployment/docker/**`, `auth/ui/v2/**`, `users/ui/**`, existing `tests/ci/oidc_e2e/browser.cjs` and `browser.sh`, package manifests/locks, unrelated tests or production configs and any secrets. Preserve unrelated untracked `AI_INSTRUCTIONS.md`. No local builds/tests/dev servers/Docker, real users, deployment, tags or releases.
|
||||||
|
|
||||||
|
## Implementation plan BEFORE changes
|
||||||
|
|
||||||
|
1. Preserve upstream app/auth/Compose and manual existing Gitea workflow unchanged. Inspect Run #91 and read-only source to establish actual prerequisite: original proxy Host route works, socat process exited with code 1; stderr unknown.
|
||||||
|
2. Within **the single next Gitea cycle**, start one run-labeled socat container with the exact current options and image/digest, check Docker process state and probe private HTTP 200. If exited or unhealthy, collect **only allowlisted error classes** from its startup stderr (e.g. address-in-use, permission, invalid-address/option, binary/runtime) without printing raw logs; record safe state/exit and classifier marker. Remove this run-labeled diagnostic container, then **at most one** deterministic fallback to the official version/digest-resolved `python:3.12-alpine` stdlib TCP forwarder, using the exact same owned container name/label/network namespace; this is not a second Gitea run. If socat works, keep it. No mock IdP or network relaxation.
|
||||||
|
3. New `forwarder.py` implements bounded async transparent bidirectional TCP relay, exclusive IPv4 loopback bind and fixed secret-free log markers. Start in run-owned proxy namespace, verify container running and private forwarded `/debug/ready` HTTP 200 with exact Host **before** creating the CI secret volume or calling official API. Sidecar stderr diagnostic must never include request or credential contents.
|
||||||
|
4. Continue existing untouched `provision.py`, original Account Portal/Chromium browser scripts and `always()` strict run-labeled cleanup. No changes to source auth, TLS or security gates. Real authenticated OIDC cannot PASS without actual official user/client and browser callback/session/negative checks.
|
||||||
|
5. Complete one focused **source/security/manifest/Git diff audit**, document `notes/project/docs`, Git commit, push Gitea main and verify exact remote source SHA.
|
||||||
|
6. Dispatch **ONE** manual `p05-oidc-acceptance.yml` Gitea CI run. Record actual run/job IDs, tested SHA, forwarder classification, provisioning, browser/negative and cleanup stage markers and terminal status. If a new blocker appears, record **BLOCKED/NOT EXECUTED** for downstream phases, no repeated CI loop or false PASS.
|
||||||
|
7. Final documentation-only closure diff audit, commit, main push and exact remote/local SHA verification. Automatically supply remaining work, next exact Scope Lock, compact plan and ready-to-copy approval command.
|
||||||
|
|
||||||
|
## Technical design and safety
|
||||||
|
|
||||||
|
- On socat failure, use one **safe diagnostic classifier**, not raw `docker logs`. The socat diagnostic runs **before any test user/client/secrets are created**; stdout shows only enumerated class and numeric exit code. Unknown logs are classified `UNCLASSIFIED` without their contents.
|
||||||
|
- Python fallback runs image **`python:3.12-alpine`** selected and verified by `RepoDigests`, then invoked as `python -u /tmp/forwarder.py`; no `pip`, apt/apk install or unpinned `latest`. Original proxy namespace isolation, no published ports and run-owned label/teardown remain mandatory.
|
||||||
|
- The fallback does NOT intercept, generate, inspect or log HTTP requests/cookies/auth codes: it is an opaque byte relay to Traefik localhost. Bind only 127.0.0.1:8080. Its server launch errors are classified safely by errno/stage; the browser and official API remain untouched.
|
||||||
|
- Authentication and cleanup gates remain fail-closed and unmodified. No CI success assumption before real completion.
|
||||||
|
|
||||||
|
**Acceptance:** proxy/forwarder readiness + official disposable client/human + real original Login V2 password/PKCE/state/nonce/Auth.js callback + actual protected identity/negative/logout + always verified owned cleanup + no unauthorized source changes. MFA/passkeys, production HTTPS and full Admin Console user flow remain outside this phase.
|
||||||
@@ -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-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-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-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
|
## 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-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-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-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**.
|
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**.
|
`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-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
|
# 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 |
|
| Group | Paths | Responsibility |
|
||||||
| --- | ---: | --- |
|
| --- | ---: | --- |
|
||||||
| `(repository root)` | 6 | Tracked repository root |
|
| `(repository root)` | 6 | Repository root |
|
||||||
| `.gitea` | 8 | Manual Gitea CI-only verification workflows |
|
| `.gitea` | 8 | Manual Gitea CI verification and manifests |
|
||||||
| `auth` | 639 | Pinned official Login V2 source and dependency lock |
|
| `auth` | 639 | Pinned official Login V2 source, unmodified |
|
||||||
| `core` | 2 | Development backend |
|
| `core` | 2 | Backend dev helper, unmodified |
|
||||||
| `deployment` | 2 | Read-only developer Compose |
|
| `deployment` | 2 | P02 dev Compose, unmodified |
|
||||||
| `docs` | 20 | Operator and user guides |
|
| `docs` | 21 | User and operator docs |
|
||||||
| `notes` | 12 | Phase plans and real CI evidence |
|
| `notes` | 13 | Phase plans and CI evidence |
|
||||||
| `packages` | 1 | First-party placeholder |
|
| `packages` | 1 | Repository root |
|
||||||
| `project` | 12 | Architecture, function maps, security and source inventory |
|
| `project` | 12 | Source, functions and architecture inventory |
|
||||||
| `scripts` | 1 | First-party placeholder |
|
| `scripts` | 1 | Repository root |
|
||||||
| `tests` | 21 | Gitea CI-only contracts and browser harness |
|
| `tests` | 22 | CI-only verification and disposable OIDC browser/forwarder |
|
||||||
| `users` | 24 | Read-only Account Portal source |
|
| `users` | 24 | Account Portal source, unmodified |
|
||||||
|
|
||||||
## Exact tracked paths
|
## Exact tracked paths
|
||||||
|
|
||||||
@@ -695,7 +695,7 @@ This inventory records exact Git paths, not live browser authentication. See `no
|
|||||||
- `deployment/README.md`
|
- `deployment/README.md`
|
||||||
- `deployment/docker/compose.backend.dev.yaml`
|
- `deployment/docker/compose.backend.dev.yaml`
|
||||||
|
|
||||||
### docs ? 20 files
|
### docs ? 21 files
|
||||||
|
|
||||||
- `docs/ARCHITECTURE.md`
|
- `docs/ARCHITECTURE.md`
|
||||||
- `docs/DEVELOPMENT.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-CI-03.md`
|
||||||
- `docs/P05-OIDC-01.md`
|
- `docs/P05-OIDC-01.md`
|
||||||
- `docs/P05-OIDC-02.md`
|
- `docs/P05-OIDC-02.md`
|
||||||
|
- `docs/P05-OIDC-03.md`
|
||||||
- `docs/P05-SEC-01.md`
|
- `docs/P05-SEC-01.md`
|
||||||
- `docs/P05-SEC-02-A01.md`
|
- `docs/P05-SEC-02-A01.md`
|
||||||
- `docs/P05-SEC-02.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/TROUBLESHOOTING.md`
|
||||||
- `docs/USER-GUIDE.md`
|
- `docs/USER-GUIDE.md`
|
||||||
|
|
||||||
### notes ? 12 files
|
### notes ? 13 files
|
||||||
|
|
||||||
- `notes/CHANGELOG.md`
|
- `notes/CHANGELOG.md`
|
||||||
- `notes/DOCS-01.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-CI-03.md`
|
||||||
- `notes/P05-OIDC-01.md`
|
- `notes/P05-OIDC-01.md`
|
||||||
- `notes/P05-OIDC-02.md`
|
- `notes/P05-OIDC-02.md`
|
||||||
|
- `notes/P05-OIDC-03.md`
|
||||||
- `notes/P05-SEC-01.md`
|
- `notes/P05-SEC-01.md`
|
||||||
- `notes/P05-SEC-02-A01.md`
|
- `notes/P05-SEC-02-A01.md`
|
||||||
- `notes/P05-SEC-02.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`
|
- `scripts/README.md`
|
||||||
|
|
||||||
### tests ? 21 files
|
### tests ? 22 files
|
||||||
|
|
||||||
- `tests/README.md`
|
- `tests/README.md`
|
||||||
- `tests/ci/MINIFEST.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/browser.sh`
|
||||||
- `tests/ci/oidc_e2e/cleanup.sh`
|
- `tests/ci/oidc_e2e/cleanup.sh`
|
||||||
- `tests/ci/oidc_e2e/compose.owner.override.yaml`
|
- `tests/ci/oidc_e2e/compose.owner.override.yaml`
|
||||||
|
- `tests/ci/oidc_e2e/forwarder.py`
|
||||||
- `tests/ci/oidc_e2e/provision.py`
|
- `tests/ci/oidc_e2e/provision.py`
|
||||||
- `tests/ci/oidc_e2e/run.sh`
|
- `tests/ci/oidc_e2e/run.sh`
|
||||||
- `tests/ci/security_advisory_gate.py`
|
- `tests/ci/security_advisory_gate.py`
|
||||||
|
|||||||
@@ -31,3 +31,6 @@ Add new CI checks and update `MINIFEST.md`, `project/`, `docs/`, and `notes/` in
|
|||||||
|
|
||||||
|
|
||||||
**P05-OIDC-02 Run #91:** Existing manual real-browser workflow with new CI-only forwarder source proved four healthy services, no host-published ports, private Traefik:80 `Host: localhost:8080` HTTP 200 and prebuilt socat version/digest check PASS. But the private forwarding process exited immediately with code **1**; actual client/user setup and browser/callback/session tests **NOT RUN**. `always()` cleanup verified absence of all run-owned state, PASS. No repeated run, no Auth.js or app edits. Preserve this exact evidence for a narrow P05-OIDC-03 startup diagnostic.
|
**P05-OIDC-02 Run #91:** Existing manual real-browser workflow with new CI-only forwarder source proved four healthy services, no host-published ports, private Traefik:80 `Host: localhost:8080` HTTP 200 and prebuilt socat version/digest check PASS. But the private forwarding process exited immediately with code **1**; actual client/user setup and browser/callback/session tests **NOT RUN**. `always()` cleanup verified absence of all run-owned state, PASS. No repeated run, no Auth.js or app edits. Preserve this exact evidence for a narrow P05-OIDC-03 startup diagnostic.
|
||||||
|
|
||||||
|
|
||||||
|
**P05-OIDC-03:** `tests/ci/oidc_e2e/forwarder.py` is an stdlib-only private 127.0.0.1 TCP relay. `run.sh` classifies pre-credential socat startup failures and, if needed, switches to the official Python image pinned by sha256 within a single isolated CI cycle; existing exact-owner cleanup and original OAuth/Browser tests unchanged. Do not treat forwarder readiness alone as real OIDC authentication acceptance.
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
| [MINIFEST.md](MINIFEST.md) | Exact registered files in this new first-party directory |
|
| [MINIFEST.md](MINIFEST.md) | Exact registered files in this new first-party directory |
|
||||||
| [compose.owner.override.yaml](compose.owner.override.yaml) | Disposable first-instance IAM_OWNER PAT bootstrap only; no developer/prod change |
|
| [compose.owner.override.yaml](compose.owner.override.yaml) | Disposable first-instance IAM_OWNER PAT bootstrap only; no developer/prod change |
|
||||||
| [run.sh](run.sh) | Run-ID Docker ownership preflight, portless stack startup, secret volume/provisioning, private browser launch |
|
| [run.sh](run.sh) | Run-ID Docker ownership preflight, portless stack startup, secret volume/provisioning, private browser launch |
|
||||||
|
| [forwarder.py](forwarder.py) | CI-only Python stdlib opaque TCP 127.0.0.1:8080 to :80 fallback for the exit-1 socat process |
|
||||||
| [provision.py](provision.py) | Official ZITADEL project/OIDC client/human creation via ephemeral owner PAT; no secret output |
|
| [provision.py](provision.py) | Official ZITADEL project/OIDC client/human creation via ephemeral owner PAT; no secret output |
|
||||||
| [browser.sh](browser.sh) | Pinned Playwright image CI-only npm installs, isolated Account app dependencies and browser harness |
|
| [browser.sh](browser.sh) | Pinned Playwright image CI-only npm installs, isolated Account app dependencies and browser harness |
|
||||||
| [browser.cjs](browser.cjs) | Real Chromium OIDC PKCE/state/nonce/username/password/callback/session and negative contracts |
|
| [browser.cjs](browser.cjs) | Real Chromium OIDC PKCE/state/nonce/username/password/callback/session and negative contracts |
|
||||||
|
|||||||
@@ -21,3 +21,8 @@ The environment is a temporary `zitplane-p05-{GITHUB_RUN_ID}` Compose stack cont
|
|||||||
|
|
||||||
|
|
||||||
**P05-OIDC-02 single-run evidence:** Gitea Run #91 tested `4831165`: private Traefik:80/Host HTTP 200 and versioned socat/digest verification PASS, then run-owned forwarder process `exited` with code 1. `provision.py` and `browser.cjs` **not run**. Cleanup PASS; no owned containers/network/credentials left. The status-only readiness change exists in source but is not CI-proven because the forwarder failed first. Startup errno/error class requires a new approved CI-only P05-OIDC-03 scope. No reruns under P05-OIDC-02.
|
**P05-OIDC-02 single-run evidence:** Gitea Run #91 tested `4831165`: private Traefik:80/Host HTTP 200 and versioned socat/digest verification PASS, then run-owned forwarder process `exited` with code 1. `provision.py` and `browser.cjs` **not run**. Cleanup PASS; no owned containers/network/credentials left. The status-only readiness change exists in source but is not CI-proven because the forwarder failed first. Startup errno/error class requires a new approved CI-only P05-OIDC-03 scope. No reruns under P05-OIDC-02.
|
||||||
|
|
||||||
|
|
||||||
|
## P05-OIDC-03: forwarder diagnosis and same-run Python fallback
|
||||||
|
|
||||||
|
The official four-service P02 backend, original browser/auth and Gitea workflow remain read-only. Run #91 proved private Traefik/Host route PASS but socat process exited 1. Now a single run-owned socat start checks status/HTTP and classifies only safe startup error classes from **pre-credential** logs. When unhealthy, only the owned diagnostic sidecar is removed; its container name/owner label and private proxy net namespace are reused by official `python:3.12-alpine` pinned to its pulled sha256 registry digest. Only the tracked `forwarder.py` is copied; it transparently relays 127.0.0.1:8080 → 127.0.0.1:80 with no HTTP parsing, storage, external port or token access. Both must satisfy original issuer/Host HTTP 200 before project/client/user creation. The existing `always()` cleanup is unchanged. Full browser login/session acceptance requires actual Gitea result; **source is not CI-verified yet**.
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
"""CI-only, private-network, opaque TCP relay for ZITADEL localhost issuer.
|
||||||
|
|
||||||
|
Run exclusively in the run-owned Traefik proxy network namespace. This code
|
||||||
|
never sees or parses HTTP requests, headers, query strings, credentials or
|
||||||
|
cookies; it forwards bytes from IPv4 127.0.0.1:8080 to 127.0.0.1:80.
|
||||||
|
No public bind, privileged sockets, credentials or filesystem writes.
|
||||||
|
"""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import asyncio
|
||||||
|
import errno
|
||||||
|
import sys
|
||||||
|
|
||||||
|
LISTEN_ADDRESS = "127.0.0.1"
|
||||||
|
LISTEN_PORT = 8080
|
||||||
|
TARGET_ADDRESS = "127.0.0.1"
|
||||||
|
TARGET_PORT = 80
|
||||||
|
CHUNK_SIZE = 65536
|
||||||
|
|
||||||
|
|
||||||
|
async def copy_bytes(reader: asyncio.StreamReader, writer: asyncio.StreamWriter) -> None:
|
||||||
|
"""Opaque, bounded-chunk bidirectional flow; never log payloads."""
|
||||||
|
try:
|
||||||
|
while True:
|
||||||
|
chunk = await reader.read(CHUNK_SIZE)
|
||||||
|
if not chunk:
|
||||||
|
break
|
||||||
|
writer.write(chunk)
|
||||||
|
await writer.drain()
|
||||||
|
except (ConnectionError, BrokenPipeError, OSError):
|
||||||
|
pass
|
||||||
|
finally:
|
||||||
|
try:
|
||||||
|
writer.write_eof()
|
||||||
|
except (AttributeError, ConnectionError, OSError):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
async def serve_client(reader: asyncio.StreamReader, client: asyncio.StreamWriter) -> None:
|
||||||
|
upstream = None
|
||||||
|
try:
|
||||||
|
target_reader, upstream = await asyncio.wait_for(
|
||||||
|
asyncio.open_connection(TARGET_ADDRESS, TARGET_PORT),
|
||||||
|
timeout=7,
|
||||||
|
)
|
||||||
|
await asyncio.gather(
|
||||||
|
copy_bytes(reader, upstream),
|
||||||
|
copy_bytes(target_reader, client),
|
||||||
|
)
|
||||||
|
except (TimeoutError, ConnectionError, OSError):
|
||||||
|
# Only safe stages go to stderr. No raw HTTP, cookies, secrets, URL.
|
||||||
|
print("OIDC_CI_FORWARDER_UPSTREAM_NOT_AVAILABLE", file=sys.stderr, flush=True)
|
||||||
|
finally:
|
||||||
|
if upstream is not None:
|
||||||
|
upstream.close()
|
||||||
|
client.close()
|
||||||
|
if upstream is not None:
|
||||||
|
try:
|
||||||
|
await asyncio.wait_for(upstream.wait_closed(), timeout=2)
|
||||||
|
except (TimeoutError, ConnectionError, OSError):
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
await asyncio.wait_for(client.wait_closed(), timeout=2)
|
||||||
|
except (TimeoutError, ConnectionError, OSError):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
async def main() -> None:
|
||||||
|
# A loopback-only listener: the runner never publishes host ports.
|
||||||
|
try:
|
||||||
|
server = await asyncio.start_server(
|
||||||
|
serve_client,
|
||||||
|
host=LISTEN_ADDRESS,
|
||||||
|
port=LISTEN_PORT,
|
||||||
|
family=2, # AF_INET, never an IPv6 wildcard
|
||||||
|
backlog=64,
|
||||||
|
reuse_address=True,
|
||||||
|
limit=CHUNK_SIZE,
|
||||||
|
)
|
||||||
|
except OSError as exc:
|
||||||
|
if exc.errno == errno.EADDRINUSE:
|
||||||
|
code = "ADDRESS_IN_USE"
|
||||||
|
elif exc.errno == errno.EACCES:
|
||||||
|
code = "PERMISSION_DENIED"
|
||||||
|
elif exc.errno == errno.EADDRNOTAVAIL:
|
||||||
|
code = "ADDRESS_NOT_AVAILABLE"
|
||||||
|
else:
|
||||||
|
code = "SOCKET_STARTUP_UNKNOWN"
|
||||||
|
print("OIDC_CI_PYTHON_FORWARDER_STARTUP_" + code, file=sys.stderr, flush=True)
|
||||||
|
raise SystemExit(1) from None
|
||||||
|
|
||||||
|
print("ZITPLANE_OIDC_PYTHON_FORWARDER_LOOPBACK_LISTENING_PASS", flush=True)
|
||||||
|
async with server:
|
||||||
|
await server.serve_forever()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
try:
|
||||||
|
asyncio.run(main())
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
pass
|
||||||
+100
-12
@@ -114,14 +114,95 @@ case "$forwarder_image" in
|
|||||||
*) echo OIDC_CI_FORWARDER_IMAGE_DIGEST_MISSING >&2; exit 1 ;;
|
*) echo OIDC_CI_FORWARDER_IMAGE_DIGEST_MISSING >&2; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# NetNS-local listener 127.0.0.1:8080 -> netNS-local Traefik 127.0.0.1:80.
|
# First reproduce and classify the previously observed socat startup failure.
|
||||||
# The original P02 external issuer remains exactly http://localhost:8080.
|
# This diagnostic happens BEFORE generating any OIDC client/user credentials.
|
||||||
docker run -d --name "$forwarder" \
|
# Use exactly one run-owned container name; remove it before any fallback.
|
||||||
|
docker create --name "$forwarder" \
|
||||||
--label "zitplane.oidc.run=$GITHUB_RUN_ID" \
|
--label "zitplane.oidc.run=$GITHUB_RUN_ID" \
|
||||||
--network "container:$proxy_id" "$forwarder_image" \
|
--network "container:$proxy_id" "$forwarder_image" \
|
||||||
TCP-LISTEN:8080,bind=127.0.0.1,reuseaddr,fork TCP:127.0.0.1:80 >/dev/null
|
TCP-LISTEN:8080,bind=127.0.0.1,reuseaddr,fork TCP:127.0.0.1:80 >/dev/null
|
||||||
|
docker start "$forwarder" >/dev/null
|
||||||
|
|
||||||
# Bounded socket+exact Host HTTP probe. Container existence is NOT readiness.
|
forwarder_http_ready() {
|
||||||
|
# No private HTTP contents or query parameters are printed.
|
||||||
|
docker run --rm --network "container:$proxy_id" python:3.12-alpine \
|
||||||
|
python -c '
|
||||||
|
import http.client
|
||||||
|
conn = http.client.HTTPConnection("127.0.0.1", 8080, timeout=5)
|
||||||
|
conn.request("GET", "/debug/ready", headers={"Host": "localhost:8080"})
|
||||||
|
assert conn.getresponse().status == 200
|
||||||
|
' >/dev/null 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Bounded socat startup check. If it remains unreliable, switch once to the
|
||||||
|
# official version/digest-pinned Python stdlib forwarder within THIS CI run.
|
||||||
|
socat_ready=0
|
||||||
|
attempt=0
|
||||||
|
while [ "$attempt" -lt 3 ]; do
|
||||||
|
attempt=$((attempt + 1))
|
||||||
|
state="$(docker inspect -f '{{.State.Status}}' "$forwarder")"
|
||||||
|
if [ "$state" != running ]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
if forwarder_http_ready; then
|
||||||
|
socat_ready=1
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$socat_ready" -ne 1 ]; then
|
||||||
|
state="$(docker inspect -f '{{.State.Status}}' "$forwarder")"
|
||||||
|
exitcode="$(docker inspect -f '{{.State.ExitCode}}' "$forwarder")"
|
||||||
|
echo "OIDC_CI_SOCAT_DIAGNOSTIC_STATE=$state EXIT_CODE=$exitcode"
|
||||||
|
|
||||||
|
# Only whitelisted error classifications, never raw docker logs. The
|
||||||
|
# diagnostic container has NO test user/client/password/token access.
|
||||||
|
docker logs "$forwarder" 2>&1 | python3 -c '
|
||||||
|
import sys
|
||||||
|
data = sys.stdin.read(8192).lower()
|
||||||
|
classes = (
|
||||||
|
("ADDRESS_IN_USE", ("address already in use", "eaddrinuse")),
|
||||||
|
("PERMISSION_DENIED", ("permission denied", "eacces")),
|
||||||
|
("ADDRESS_OPTION_INVALID", ("unknown device/address", "unknown option", "wrong number of parameters")),
|
||||||
|
("SOCAT_ARGUMENT_COUNT", ("exactly 2 addresses required", "too many parameters")),
|
||||||
|
("SOCKET_BIND_ERROR", ("bind(", "cannot bind")),
|
||||||
|
("BINARY_RUNTIME_ERROR", ("exec format error", "not found")),
|
||||||
|
)
|
||||||
|
reason = next((name for name, words in classes if any(s in data for s in words)), "UNCLASSIFIED")
|
||||||
|
print("OIDC_CI_SOCAT_STARTUP_ERROR_CLASS=" + reason)
|
||||||
|
' || echo OIDC_CI_SOCAT_ERROR_CLASSIFIER_UNAVAILABLE
|
||||||
|
|
||||||
|
label="$(docker inspect -f '{{ index .Config.Labels "zitplane.oidc.run" }}' "$forwarder")"
|
||||||
|
if [ "$label" != "$GITHUB_RUN_ID" ]; then
|
||||||
|
echo OIDC_CI_UNOWNED_FORWARDER_FALLBACK_REFUSED >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
docker rm -f "$forwarder" >/dev/null
|
||||||
|
|
||||||
|
# Existing official python:3.12-alpine CI image is resolved to an immutable
|
||||||
|
# registry SHA256 digest and runs ONLY the audited stdlib byte relay.
|
||||||
|
python_forwarder_tag="python:3.12-alpine"
|
||||||
|
docker pull "$python_forwarder_tag" >/dev/null
|
||||||
|
python_forwarder_image="$(docker image inspect --format '{{index .RepoDigests 0}}' "$python_forwarder_tag")"
|
||||||
|
case "$python_forwarder_image" in
|
||||||
|
python@sha256:*|docker.io/library/python@sha256:*)
|
||||||
|
echo ZITPLANE_OIDC_PYTHON_FORWARDER_IMAGE_DIGEST_VERIFIED_PASS ;;
|
||||||
|
*) echo OIDC_CI_PYTHON_FORWARDER_DIGEST_MISSING >&2; exit 1 ;;
|
||||||
|
esac
|
||||||
|
docker create --name "$forwarder" \
|
||||||
|
--label "zitplane.oidc.run=$GITHUB_RUN_ID" \
|
||||||
|
--network "container:$proxy_id" "$python_forwarder_image" \
|
||||||
|
python -u /tmp/forwarder.py >/dev/null
|
||||||
|
docker cp tests/ci/oidc_e2e/forwarder.py "$forwarder:/tmp/forwarder.py"
|
||||||
|
docker start "$forwarder" >/dev/null
|
||||||
|
echo ZITPLANE_OIDC_PYTHON_FORWARDER_FALLBACK_STARTED
|
||||||
|
else
|
||||||
|
echo ZITPLANE_OIDC_SOCAT_FORWARDER_READY_PASS
|
||||||
|
fi
|
||||||
|
|
||||||
|
# The SAME no-host-port status/Host contract applies to either forwarding
|
||||||
|
# process. Never provision a client/user unless this proves HTTP 200.
|
||||||
ready=0
|
ready=0
|
||||||
attempt=0
|
attempt=0
|
||||||
while [ "$attempt" -lt 12 ]; do
|
while [ "$attempt" -lt 12 ]; do
|
||||||
@@ -130,15 +211,23 @@ while [ "$attempt" -lt 12 ]; do
|
|||||||
if [ "$state" != running ]; then
|
if [ "$state" != running ]; then
|
||||||
exitcode="$(docker inspect -f '{{.State.ExitCode}}' "$forwarder")"
|
exitcode="$(docker inspect -f '{{.State.ExitCode}}' "$forwarder")"
|
||||||
echo "OIDC_CI_FORWARDER_NOT_RUNNING_STATE=$state EXIT_CODE=$exitcode" >&2
|
echo "OIDC_CI_FORWARDER_NOT_RUNNING_STATE=$state EXIT_CODE=$exitcode" >&2
|
||||||
|
# Python diagnostic emits ONLY fixed error classes; never raw logs.
|
||||||
|
docker logs "$forwarder" 2>&1 | python3 -c '
|
||||||
|
import sys
|
||||||
|
s=sys.stdin.read(4096)
|
||||||
|
for marker in ("OIDC_CI_PYTHON_FORWARDER_STARTUP_ADDRESS_IN_USE",
|
||||||
|
"OIDC_CI_PYTHON_FORWARDER_STARTUP_PERMISSION_DENIED",
|
||||||
|
"OIDC_CI_PYTHON_FORWARDER_STARTUP_ADDRESS_NOT_AVAILABLE",
|
||||||
|
"OIDC_CI_PYTHON_FORWARDER_STARTUP_SOCKET_STARTUP_UNKNOWN"):
|
||||||
|
if marker in s:
|
||||||
|
print(marker)
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
print("OIDC_CI_FORWARDER_EXIT_REASON_UNCLASSIFIED")
|
||||||
|
' || true
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if docker run --rm --network "container:$proxy_id" python:3.12-alpine \
|
if forwarder_http_ready; then
|
||||||
python -c '
|
|
||||||
import http.client
|
|
||||||
conn = http.client.HTTPConnection("127.0.0.1", 8080, timeout=5)
|
|
||||||
conn.request("GET", "/debug/ready", headers={"Host": "localhost:8080"})
|
|
||||||
assert conn.getresponse().status == 200
|
|
||||||
' >/dev/null 2>&1; then
|
|
||||||
ready=1
|
ready=1
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
@@ -148,7 +237,6 @@ if [ "$ready" -ne 1 ]; then
|
|||||||
state="$(docker inspect -f '{{.State.Status}}' "$forwarder")"
|
state="$(docker inspect -f '{{.State.Status}}' "$forwarder")"
|
||||||
exitcode="$(docker inspect -f '{{.State.ExitCode}}' "$forwarder")"
|
exitcode="$(docker inspect -f '{{.State.ExitCode}}' "$forwarder")"
|
||||||
echo "OIDC_CI_FORWARDER_HTTP_NOT_READY_STATE=$state EXIT_CODE=$exitcode" >&2
|
echo "OIDC_CI_FORWARDER_HTTP_NOT_READY_STATE=$state EXIT_CODE=$exitcode" >&2
|
||||||
# One redacted diagnostic: print only an HTTP status or a fixed socket marker.
|
|
||||||
docker run --rm --network "container:$proxy_id" python:3.12-alpine \
|
docker run --rm --network "container:$proxy_id" python:3.12-alpine \
|
||||||
python -c '
|
python -c '
|
||||||
import http.client, sys
|
import http.client, sys
|
||||||
|
|||||||
Reference in new issue
Block a user