provision: the files OIDC seed is private-path-only — own-VPS operators bounce to kanidm /ui/apps with no linked applications (deploy.go filesLiveSet's deferred T4 scope, now due; branded-login leg also needs a fresh context) #560

Closed
opened 2026-08-15 03:39:07 +00:00 by ben · 3 comments
Owner

Milestone context

Drive 20260815T032509Z is the deepest run ever: seeded certs (zero LE contact — #559 proven first try), finish green, files-healthy healthy on probe 1 (#557's route proven live), door leg green. Red at branded-login — the first of the four never-run parity legs.

What the red shows

The browser (holding the operator's kanidm session from the ceremony, same context) hit https://files.<apex>, Nextcloud auto-redirected to kanidm — and kanidm bounced to /ui/apps showing "No linked applications available" (DOM snapshot in the run's error-context.md; branded "E2E Drive" nav renders, so the IdP brand is fine). The OIDC authorize never completed because there is nothing to authorize against:

  • grep -c files-oidc droplet-journal.txt → 0. The files OIDC seed (kanidm oauth2 client for Nextcloud + operator access group + Nextcloud user_oidc config) never ran.
  • Known-deferred, now due: internal/provision/deploy.go filesLiveSet sets files.IDPHost/WebPort only under coHosted && o.privateFrontDoor, with the in-code comment ruling "the public gateway's OIDC seed + real :443 ride the public front-door path, out of this arc's scope" (drive-arc T4/ADR 0150). The scope has arrived.

Fix directed

  1. Run the files OIDC seed on the own-VPS co-host path: set files.IDPHost = hostnames.IDP(o.apex) whenever coHosted (the public path needs NO WebPort rewrites — real :443, simpler than private): kanidm oauth2 client (redirect URI https://files.<apex>/…), operator group grant, user_oidc provider config against https://id.<apex> — the same seed the private path proved in drive 17, minus the forwarded-port rewrites. Consent stays disabled (kanidm disable-consent-prompt, prior ruling).
  2. Seam test the gate: an own-VPS co-host files render/deploy MUST carry the OIDC seed — pin it so the next privateFrontDoor-keyed regression breaks a test, not a drive (third instance of this class: #529 port, #557 route, now the OIDC seed).
  3. Fix the leg's warm-session blindness: assertBrandedLogin (provision.ts:480+) expects kanidm's login FORM, but the drive's browser always carries the ceremony's session — once OIDC works, the authorize will skip the form and land straight in Nextcloud. Open the branded-login assertion in a FRESH browser context (incognito) so the form genuinely renders; the existing warm context then serves the oidc-admin leg (session → Nextcloud landing).

Evidence

test-results/drive-droplet/20260815T032509Z/: error-context.md DOM snapshot (/ui/apps, "No linked applications available"), test-failed-*.png, droplet-journal.txt (kanidm oauth2 sync at baseline 03:30:51, nothing after; zero files-oidc lines).

Frontier tooth of #492 (blocks it).

## Milestone context Drive `20260815T032509Z` is the deepest run ever: seeded certs (zero LE contact — #559 proven first try), finish green, files-healthy **healthy on probe 1** (#557's route proven live), door leg green. Red at `branded-login` — the first of the four never-run parity legs. ## What the red shows The browser (holding the operator's kanidm session from the ceremony, same context) hit `https://files.<apex>`, Nextcloud auto-redirected to kanidm — and kanidm bounced to `/ui/apps` showing **"No linked applications available"** (DOM snapshot in the run's error-context.md; branded "E2E Drive" nav renders, so the IdP brand is fine). The OIDC authorize never completed because there is nothing to authorize against: - `grep -c files-oidc droplet-journal.txt` → **0**. The files OIDC seed (kanidm oauth2 client for Nextcloud + operator access group + Nextcloud `user_oidc` config) never ran. - Known-deferred, now due: `internal/provision/deploy.go` `filesLiveSet` sets `files.IDPHost`/`WebPort` only under `coHosted && o.privateFrontDoor`, with the in-code comment ruling "the public gateway's OIDC seed + real :443 ride the public front-door path, out of this arc's scope" (drive-arc T4/ADR 0150). The scope has arrived. ## Fix directed 1. **Run the files OIDC seed on the own-VPS co-host path**: set `files.IDPHost = hostnames.IDP(o.apex)` whenever `coHosted` (the public path needs NO WebPort rewrites — real :443, simpler than private): kanidm oauth2 client (redirect URI `https://files.<apex>/…`), operator group grant, `user_oidc` provider config against `https://id.<apex>` — the same seed the private path proved in drive 17, minus the forwarded-port rewrites. Consent stays disabled (kanidm disable-consent-prompt, prior ruling). 2. **Seam test the gate**: an own-VPS co-host files render/deploy MUST carry the OIDC seed — pin it so the next `privateFrontDoor`-keyed regression breaks a test, not a drive (third instance of this class: #529 port, #557 route, now the OIDC seed). 3. **Fix the leg's warm-session blindness**: `assertBrandedLogin` (provision.ts:480+) expects kanidm's login FORM, but the drive's browser always carries the ceremony's session — once OIDC works, the authorize will skip the form and land straight in Nextcloud. Open the branded-login assertion in a FRESH browser context (incognito) so the form genuinely renders; the existing warm context then serves the oidc-admin leg (session → Nextcloud landing). ## Evidence `test-results/drive-droplet/20260815T032509Z/`: error-context.md DOM snapshot (`/ui/apps`, "No linked applications available"), test-failed-*.png, droplet-journal.txt (kanidm oauth2 sync at baseline 03:30:51, nothing after; zero files-oidc lines). Frontier tooth of #492 (blocks it).
Author
Owner

swarm-claim host=matou-dev-server-01 run=6587
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=6587 (automated multi-host claim — lowest live claim id works this ticket)
Author
Owner

This was generated by AI during triage.

Agent Brief

Category: bug
Summary: The files OIDC seed only runs on the private front-door co-host path — the own-VPS (public front-door) co-host path never provisions it, so operators bounce to kanidm's "No linked applications available" instead of signing into Nextcloud.

Current behavior:
When the files service is co-hosted with the front door, the deploy only provisions the files OIDC seed (kanidm OAuth2 client for Nextcloud, operator access-group grant, Nextcloud OIDC provider config) when the front door is also on the private path. On the own-VPS (public front-door) co-host path, the files service deploys and is reachable, but nothing is registered with kanidm for it. Visiting the files URL redirects through kanidm login and lands on kanidm's app picker showing no linked applications — there is nothing to authorize against. This mirrors a now-fixed class of bug (loopback port, front-door route) where behavior was incorrectly keyed off "private front door" instead of "co-hosted."

Desired behavior:
The files OIDC seed runs whenever the deploy is co-hosted, regardless of which front-door path it's on:

  • On the public (own-VPS) path: seed against the real public IdP host, using the real :443 — no forwarded/loopback web-port rewrite is needed on this path (that rewrite is specific to the private path's forwarded-port browser access).
  • On the private path: unchanged — existing loopback/IdP/web-port behavior stands.
  • The consent-prompt-disabled behavior is unchanged on both paths.

Signing in through the public files URL should complete OIDC authorization and land the operator in Nextcloud, instead of dead-ending at kanidm's app picker.

Key interfaces:

  • The files live-set type's IdP-host field should be populated whenever the deploy is co-hosted — not gated on an additional "private front door" condition. The web-port-rewrite field should stay private-path-only (the public path doesn't need it).
  • The E2E helper that asserts the branded kanidm login page renders currently assumes a login FORM is shown, but a browser session that's already authenticated (e.g. reused from an earlier step in the same test) skips straight past the form once OIDC actually works. That assertion needs to run in a browser context that is guaranteed unauthenticated (a fresh/incognito context), independent of session state used elsewhere in the same test run. Any pre-existing authenticated session should continue to be usable for asserting the authenticated (already-signed-in) OIDC flow.

Acceptance criteria:

  • A co-hosted deploy on the public/own-VPS front-door path provisions the kanidm OAuth2 client, operator group grant, and Nextcloud OIDC provider config against the real public IdP host.
  • The public path's OIDC seed does not require or apply a forwarded web-port rewrite.
  • The private path's existing OIDC seed behavior (loopback port, web-port rewrite, IdP host) is unchanged.
  • Consent-prompt-disabled behavior is unchanged on both paths.
  • A test pins that ANY co-hosted deploy (public or private front door) configures the files OIDC seed, so a future regression that re-gates this on "private front door" fails a test rather than only surfacing on a live drive.
  • The branded-login E2E assertion runs against a browser context with no pre-existing authenticated session, so the kanidm login form is reliably present when asserted against.
  • Any existing E2E coverage that exercises the authenticated/session-carrying OIDC flow into Nextcloud continues to pass using the pre-existing authenticated session.

Out of scope:

  • Changing the private front-door path's loopback-port or web-port-rewrite logic.
  • Any change to the consent-prompt-disabled behavior/ruling.
  • The other never-run parity legs mentioned as still outstanding (oidc-admin, branded-chrome, door) — only the branded-login leg's fresh-context fix is in scope here.

Verification performed during triage: confirmed the current code gates the IdP-host/web-port fields on coHosted && <private-front-door flag> exactly as this issue describes (both conditions currently required; should be coHosted alone for the IdP-host field). Confirmed the branded-login E2E helper referenced exists and matches the described warm-session assumption. Confirmed #492 (the parent drive issue this blocks) is open. No .out-of-scope/ precedent or existing implementation found — this is a genuine, unimplemented gap, not a duplicate.

> *This was generated by AI during triage.* ## Agent Brief **Category:** bug **Summary:** The files OIDC seed only runs on the private front-door co-host path — the own-VPS (public front-door) co-host path never provisions it, so operators bounce to kanidm's "No linked applications available" instead of signing into Nextcloud. **Current behavior:** When the files service is co-hosted with the front door, the deploy only provisions the files OIDC seed (kanidm OAuth2 client for Nextcloud, operator access-group grant, Nextcloud OIDC provider config) when the front door is *also* on the private path. On the own-VPS (public front-door) co-host path, the files service deploys and is reachable, but nothing is registered with kanidm for it. Visiting the files URL redirects through kanidm login and lands on kanidm's app picker showing no linked applications — there is nothing to authorize against. This mirrors a now-fixed class of bug (loopback port, front-door route) where behavior was incorrectly keyed off "private front door" instead of "co-hosted." **Desired behavior:** The files OIDC seed runs whenever the deploy is co-hosted, regardless of which front-door path it's on: - On the public (own-VPS) path: seed against the real public IdP host, using the real `:443` — no forwarded/loopback web-port rewrite is needed on this path (that rewrite is specific to the private path's forwarded-port browser access). - On the private path: unchanged — existing loopback/IdP/web-port behavior stands. - The consent-prompt-disabled behavior is unchanged on both paths. Signing in through the public files URL should complete OIDC authorization and land the operator in Nextcloud, instead of dead-ending at kanidm's app picker. **Key interfaces:** - The files live-set type's IdP-host field should be populated whenever the deploy is co-hosted — not gated on an additional "private front door" condition. The web-port-rewrite field should stay private-path-only (the public path doesn't need it). - The E2E helper that asserts the branded kanidm login page renders currently assumes a login FORM is shown, but a browser session that's already authenticated (e.g. reused from an earlier step in the same test) skips straight past the form once OIDC actually works. That assertion needs to run in a browser context that is guaranteed unauthenticated (a fresh/incognito context), independent of session state used elsewhere in the same test run. Any pre-existing authenticated session should continue to be usable for asserting the *authenticated* (already-signed-in) OIDC flow. **Acceptance criteria:** - [ ] A co-hosted deploy on the public/own-VPS front-door path provisions the kanidm OAuth2 client, operator group grant, and Nextcloud OIDC provider config against the real public IdP host. - [ ] The public path's OIDC seed does not require or apply a forwarded web-port rewrite. - [ ] The private path's existing OIDC seed behavior (loopback port, web-port rewrite, IdP host) is unchanged. - [ ] Consent-prompt-disabled behavior is unchanged on both paths. - [ ] A test pins that ANY co-hosted deploy (public or private front door) configures the files OIDC seed, so a future regression that re-gates this on "private front door" fails a test rather than only surfacing on a live drive. - [ ] The branded-login E2E assertion runs against a browser context with no pre-existing authenticated session, so the kanidm login form is reliably present when asserted against. - [ ] Any existing E2E coverage that exercises the authenticated/session-carrying OIDC flow into Nextcloud continues to pass using the pre-existing authenticated session. **Out of scope:** - Changing the private front-door path's loopback-port or web-port-rewrite logic. - Any change to the consent-prompt-disabled behavior/ruling. - The other never-run parity legs mentioned as still outstanding (oidc-admin, branded-chrome, door) — only the branded-login leg's fresh-context fix is in scope here. --- Verification performed during triage: confirmed the current code gates the IdP-host/web-port fields on `coHosted && <private-front-door flag>` exactly as this issue describes (both conditions currently required; should be `coHosted` alone for the IdP-host field). Confirmed the branded-login E2E helper referenced exists and matches the described warm-session assumption. Confirmed #492 (the parent drive issue this blocks) is open. No `.out-of-scope/` precedent or existing implementation found — this is a genuine, unimplemented gap, not a duplicate.
Author
Owner

close-report for #560 — status success

✅ close-report gates passed — every claim verified against main; closing.

envelope
{
  "issue": 560,
  "status": "success",
  "commits": [
    "7bd98f49c2a43ea18bf0d969426c45485279f365"
  ],
  "changed_files": [
    "internal/provision/deploy.go",
    "internal/provision/deploy_test.go",
    "app/tests/e2e/fixtures/provision.ts",
    "app/tests/e2e/journey.droplet.spec.ts",
    "app/tests/e2e/provision-nextcloud.live.spec.ts",
    "app/tests/e2e/settings-brand-reapply.live.spec.ts",
    "STATUS.md"
  ],
  "tests": [
    {
      "command": "go test ./internal/provision/...",
      "exit_code": 0
    },
    {
      "command": "go build ./... && go vet ./internal/provision/...",
      "exit_code": 0
    },
    {
      "command": "node_modules/.bin/vue-tsc -p tsconfig.json --noEmit",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Run the files OIDC seed on the own-VPS co-host path (IDPHost set whenever coHosted, no WebPort rewrites)": "internal/provision/deploy.go filesLiveSet now sets files.IDPHost=hostnames.IDP(o.apex) under ; WebPort stays under . Render (internal/clan/files.go) already emits the nextcloud-oidc oneshot with portless redirect/discovery/registration when WebPort==0 — untouched.",
    "Seam test the gate: an own-VPS co-host files render/deploy MUST carry the OIDC seed": "internal/provision/deploy_test.go TestDeploy_PublicGatewayFilesAddsTheFrontDoorRoute asserts files[0].IDPHost==hostnames.IDP(testApex) and WebPort==0; TestDeploy_PrivateGatewayFilesAddsTheFrontDoorRoute pins IDPHost too. Red before the deploy.go fix (verified), green after.",
    "Fix the leg's warm-session blindness: open branded-login in a FRESH incognito context": "app/tests/e2e/fixtures/provision.ts assertBrandedLogin now takes a Browser and opens browser.newContext() (cookie-less) before asserting; provision-nextcloud.live.spec.ts + settings-brand-reapply.live.spec.ts pass ceremony.browser, journey.droplet.spec.ts launches a throwaway Chromium (Electron ceremony has no external browser). vue-tsc --noEmit green."
  },
  "summary": "The files OIDC seed now rides the own-VPS co-host path (IDPHost keyed on coHosted, WebPort private-path-only), pinned by a seam test, and branded-login runs in a fresh incognito context so the login form renders past the warm ceremony session.",
  "blockers": []
}
**close-report** for #560 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; closing. <details><summary>envelope</summary> ```json { "issue": 560, "status": "success", "commits": [ "7bd98f49c2a43ea18bf0d969426c45485279f365" ], "changed_files": [ "internal/provision/deploy.go", "internal/provision/deploy_test.go", "app/tests/e2e/fixtures/provision.ts", "app/tests/e2e/journey.droplet.spec.ts", "app/tests/e2e/provision-nextcloud.live.spec.ts", "app/tests/e2e/settings-brand-reapply.live.spec.ts", "STATUS.md" ], "tests": [ { "command": "go test ./internal/provision/...", "exit_code": 0 }, { "command": "go build ./... && go vet ./internal/provision/...", "exit_code": 0 }, { "command": "node_modules/.bin/vue-tsc -p tsconfig.json --noEmit", "exit_code": 0 } ], "criteria": { "Run the files OIDC seed on the own-VPS co-host path (IDPHost set whenever coHosted, no WebPort rewrites)": "internal/provision/deploy.go filesLiveSet now sets files.IDPHost=hostnames.IDP(o.apex) under ; WebPort stays under . Render (internal/clan/files.go) already emits the nextcloud-oidc oneshot with portless redirect/discovery/registration when WebPort==0 — untouched.", "Seam test the gate: an own-VPS co-host files render/deploy MUST carry the OIDC seed": "internal/provision/deploy_test.go TestDeploy_PublicGatewayFilesAddsTheFrontDoorRoute asserts files[0].IDPHost==hostnames.IDP(testApex) and WebPort==0; TestDeploy_PrivateGatewayFilesAddsTheFrontDoorRoute pins IDPHost too. Red before the deploy.go fix (verified), green after.", "Fix the leg's warm-session blindness: open branded-login in a FRESH incognito context": "app/tests/e2e/fixtures/provision.ts assertBrandedLogin now takes a Browser and opens browser.newContext() (cookie-less) before asserting; provision-nextcloud.live.spec.ts + settings-brand-reapply.live.spec.ts pass ceremony.browser, journey.droplet.spec.ts launches a throwaway Chromium (Electron ceremony has no external browser). vue-tsc --noEmit green." }, "summary": "The files OIDC seed now rides the own-VPS co-host path (IDPHost keyed on coHosted, WebPort private-path-only), pinned by a seam test, and branded-login runs in a fresh incognito context so the login form renders past the warm ceremony session.", "blockers": [] } ``` </details>
ben closed this issue 2026-08-15 03:52:40 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#560
No description provided.