Files
ZitPlane/docs/P05-OIDC-02.md
T

24 lines
3.4 KiB
Markdown
Raw Normal View History

# P05-OIDC-02 — Private Loopback Forwarder & Real OIDC Acceptance
**Date:** 2026-11-22
**Baseline:** `b78270e9d45c1764c5642024b8147885deaacde3`
**Gitea Run #90:** overall **FAILURE** on `cbcd60e76ec909df4f9c5826adf7a3e2a899c73e`: four disposable services healthy, no host ports; private loopback localhost:8080 not ready; no client/user/browser test executed. **Owned cleanup PASS.**
**P05-OIDC-02 status:** narrow CI-only source remediation implemented; **actual new Gitea run pending**. No claim of fixed runtime or authenticated OIDC prior to terminal evidence.
## Source changes
The existing manual Gitea workflow `.gitea/workflows/p05-oidc-acceptance.yml` is reused; original backend, P02 developer Compose, official Login V2 application, Account Portal Auth.js/source, and all manifests/lockfiles stay unchanged.
In `tests/ci/oidc_e2e/run.sh` only, the runner now distinguishes:
1. **Private proxy/Host readiness**: a disposable Python container sharing Traefik's isolated network namespace makes `GET /debug/ready` on `127.0.0.1:80` with the exact `Host: localhost:8080`; HTTP 200 required before the forwarder.
2. **Verified prebuilt forwarding binary**: Docker Hub versioned `alpine/socat:1.8.1.3` (preinstalled `socat`; no runtime `apk add`). The CI runner verifies the `socat` entrypoint, resolves the pulled version to its immutable registry `sha256` image digest and starts the run-owned sidecar **by digest**; no `latest` image. This image is published by the `alpine/socat` project; see [Docker Hub repository](https://hub.docker.com/r/alpine/socat), [exact versioned tags](https://hub.docker.com/r/alpine/socat/tags).
3. **Private forwarder readiness and failure evidence**: the sidecar shares only the CI proxy network namespace and binds **127.0.0.1:8080**, forwarding to namespace-local Traefik:80. The runner checks exact labeled Docker sidecar state/exit code and makes a bounded no-secret `/debug/ready` HTTP 200 probe on forwarded port 8080 using `Host: localhost:8080`. A failed probe stops **before** provisioning and prints only safe stage/status, not token/cookie/query/sensitive HTTP bodies.
4. **Provisioner status-only readiness**: `tests/ci/oidc_e2e/provision.py::wait_until_ready()` checks HTTP 200 from the private issuer. It no longer attempts to parse the readiness body as JSON. Actual official API project/client/human creation continues to parse validated JSON and must not bypass authentication.
5. **Cleanup**: unchanged existing `tests/ci/oidc_e2e/cleanup.sh` still enforces numeric Gitea run ownership, exact sidecar/secret labels, backend Compose cleanup, and complete absence verification. No host published ports.
## How acceptance is determined
The single already-approved manual Gitea workflow `p05-oidc-acceptance.yml` must prove private proxy/forwarder readiness **and then** actual official client/user provisioning, original Login V2 Chromium password flow, genuine Auth.js authorization-code PKCE/state/nonce callback, protected Account session and API user ID, anonymous and invalid callback rejection, local sign-out, and successful mandatory owned cleanup.
If any check is blocked, document exact job/run/stage and **do not claim PASS for unexecuted steps**. One Gitea cycle only; no repeat or local tests. No screenshots, real accounts, private secrets, production deployment, MFA/passkey or production HTTPS acceptance. Detailed plan/evidence: `notes/P05-OIDC-02.md`. Developer design: `project/OIDC-E2E-ARCHITECTURE.md`.