6.6 KiB
6.6 KiB
P05-OIDC-06 — Imported Login V2 Disposable Image & Runtime Acceptance
Date: 2026-11-23 (Asia/Dhaka)
Approved baseline: e801318f0126e433f71a3b1f8bb4c6f83aec6611
Prior accepted source: 670e225db477f180ff14ffa62e6654860a166f17 — Gitea Run #96 / Job #210, official prebuilt Login V2 real browser OIDC SUCCESS and owned cleanup SUCCESS.
Imported source verification: Gitea Run #89, frozen pnpm / standalone Login build, 1,219/1,219 upstream units and then-current zero Moderate/High/Critical dependency report PASS. Build source alone is not runtime image acceptance.
Pre-source-change exact Scope Lock
This Scope Lock note MUST be committed before implementing the CI-only image/runtime integration.
- SOURCE WRITE only: new
.gitea/workflows/p05-custom-login-acceptance.yml; newdeployment/docker/compose.login-ci.override.yaml; new focusedtests/ci/login_image/**(build/cleanup/helpers and mandatory new-folder README/MINIFEST);tests/ci/oidc_e2e/run.shonly if a minimal, backwards-compatible opt-in Compose override is necessary. - DOCUMENTATION WRITE:
notes/**; relevantproject/**,docs/**; associated.gitea/workflowsandtests/ciREADME/MINIFEST documentation, root README if necessary. No other first-party or upstream writes. - STRICT READ-ONLY:
auth/ui/v2/**including upstream Dockerfile, original Login source and package/lock;users/ui/**,core/**,deployment/docker/compose.backend.dev.yaml; all existing workflows; all existing OIDC browser/provision/cleanup/forwarder files other than the optional narrow run.sh hook; package manifests/locks; runner, production/infra/secrets and unrelated files. - Preserve untracked root
AI_INSTRUCTIONS.mduntouched. No local builds/tests, live users, production, public ports, branding, registry pushes, tags or releases. Exactly one separately approved disposable Gitea CI run; no rerun or repeated CI loops.
Focused read-only findings before modifications
- The imported
auth/ui/v2/apps/login/package.jsonbuildscript makes.next/standaloneusing Next/Nx and copiespublic/entrypoint/healthcheck/loader into the standalone output; the untouched upstreamauth/ui/v2/apps/login/Dockerfileexpects Docker build-context-relative.next/standalone, usesnode:24-alpine, an unprivileged default user and/app/entrypoint.sh. Itsnext.config.mjscompilesbasePathfromNEXT_PUBLIC_BASE_PATH; CI builder must set/ui/v2/loginat build time to match reverse proxy routing. - Existing
deployment/docker/compose.backend.dev.yamluses the official prebuiltghcr.io/zitadel/zitadel-login:v4.20.4, bootstrap token file and dev-only localhost HTTP, and itszitadel-loginlabels/proxy/healthcheck are the accepted baseline. New override may replace only the image of this service, preserving network, health, labels, secrets and routing.tests/ci/compose.portless.override.yamlclears inherited proxy host port. - Existing
tests/ci/oidc_e2e/run.shenumerates exactly four services, has an internaldc()composed from base + portless + IAM_OWNER override, validates Docker resource ownership, creates ephemeral client/human, reuses the original Chromiumbrowser.cjs, and marks owned resources.tests/ci/oidc_e2e/cleanup.shandtests/ci/backend_cleanup.shremove run-owned containers, secrets, volumes and Compose network. They MUST remain unchanged. A validated opt-in fourth Compose file and image ID provenance check inrun.shis the minimal necessary exception. - Existing manual Gitea workflows use
ubuntu-latestDocker-capable runner, container checkout, CLI+Compose; imported Login CI build used Node 22/bookworm,corepack prepare pnpm@10.30.3,pnpm install --frozen-lockfile,pnpm exec nx run @zitadel/login:build --skip-nx-cache. Browser E2E uses a fresh runner namespace and default official image; preserve its default behavior exactly when opt-in is absent. - Docker builds run only in CI: use isolated run-labeled Node 22/bookworm builder container,
docker cpa fresh checkout workspace into that container; keep all Next/Nx generated files outside the Git checkout, copy only standalone artifacts plus the original untouched Dockerfile to a temporary run-owned Docker build context, build localzitplane-login-ci:$GITHUB_RUN_IDand verify image ID/labels. No registry push or real environment. Do not print credential/PAT files, browser URLs, logs or secrets. - The current Dockerfile pins its base by tag (
node:24-alpine), not by digest. Record immutable built image ID in CI; a later production supply-chain release must address digest-pinned base, SBOM/signing and current vulnerability audit. Do not modify the upstream Dockerfile under this scope.
Locked implementation and one-run acceptance
- Create this note before all source edits, then add a new manual-only Gitea workflow with exactly one job: fresh checkout; ephemeral imported source frozen build in run-labeled Node/bookworm builder; temporary local image build using the untouched Dockerfile; original OIDC run.sh with opt-in image override; mandatory always() two-part cleanup (existing OIDC resources plus new run-owned builder/image/context). A build failure must not leave resources behind or claim source acceptance.
- New CI Compose override changes only
zitadel-login.imageplus safepull_policy: never; no host ports, custom browser logic or auth bypass.run.shonly accepts a hardcoded opt-inZITPLANE_OIDC_CUSTOM_LOGIN_CI=1and exact run-derived local image; validates image ID/digest, verifies Compose selected it, and after startup checks running login container image ID equals the constructed image ID. When disabled, byte-for-byte identical execution behavior remains outside necessary helper declaration. - Focused source/security/diff audit once, commit source then Gitea main SHA verification; dispatch one authorized CI run with tested SHA. Verify original imported Login build, temporary image, actual service container image, health/private Host/issuer, real disposable project/client/human + Chromium original Login V2 OIDC/PKCE/state/nonce/Auth.js callback/session/protected Account page+API/negative/logout, mandatory old+new owned cleanup. No image registry release.
- Record exact PASS/FAIL/NOT EXECUTED of every gate, including image-builder cleanup. No scope expansion or retry if blocked; docs synchronization, docs-only commit, final remote HEAD and exact diff verification; distinguish source-tested SHA from docs SHA.
Initial outcome: NOT EXECUTED. Production HTTPS/MFA/passkey/Console/two-app SSO remain out of scope, regardless of this disposable image result.