own-VPS files door: the browser surface is gated but the gate-session substrate does not exist — ungate it (ADR 0150 parity) until the ADR 0074 flow lands #565

Closed
opened 2026-08-15 04:58:11 +00:00 by ben · 2 comments
Owner

Drive 20260815T043450Z red at oidc-admin — and this one is a REAL product gap, not a drive defect. Third identical red (035509Z/041856Z reproduced it with less evidence); #562's navigation fix is aboard and working.

Evidence (all in test-results/drive-droplet/20260815T043450Z)

  • The ceremony page (live kanidm session) opened https://files.rehearsal-b.idss.nz/login and ended stranded on kanidm /ui/apps (screenshot test-failed-2.png). No #header, no username field → both waiters in oidcSignInAsOperator timed out.
  • kanidm journal, the whole oidc-admin window: 04:47:52 GET /ui/login -> 303, 04:47:52 GET /ui/apps -> 200 — and no discovery fetch, no authorize request, ever. Nextcloud's user_oidc was never consulted.
  • The seed itself is fine: nextcloud-oidc-start finished green 04:47:48 (client + origin + scopemap + claimmaps + user_oidc provider, #559/#560 both held).

Cause

renderRoute (internal/clan/frontdoor.go) puts the public files route behind forward_auth with only the sync exemptions (FilesExemptPaths: DAV + /status.php). /login is not exempt, so the gate intercepts it. The gate 401s (no session), and renderGateRedirect sends the browser to https://id.<apex>/?rd=<original> — but as its own docstring says, the flow that CONSUMES rd (the gate-as-OIDC-client session flow, ADR 0074's named substrate) was never built. The gate's HeaderSessionResolver (internal/controlapi/authgate.go) reads X-Ourcloud-Identity, which nothing establishes: no cookie, no session store, no OIDC client flow. A browser can NEVER pass this gate. kanidm ignores rd; a warm session 303s to /ui/apps; dead end.

The private path never hits this because ADR 0150 ships its service routes UNGATED — "Nextcloud's own OIDC login is the wall; the auth gate's browser redirect is a named follow-up" — and that walk is proven live (Tairea drive 17 green, occ-verified admin).

Fix (this ticket — the interim, a two-way door per ADR 0174)

Bring the PUBLIC files route to the same posture as ADR 0150's private path: drop the forward_auth browser gate from the files route render (keep the route + exempt-path structure so re-gating is a small diff), with a loud comment naming the follow-up ticket that re-gates when the substrate exists. Suspension enforcement stands unchanged where it actually works today: the member-orbit reconciler disables the Nextcloud account (internal/memberorbit) — files.go's own docs already lean on that for the sync-path exemptions.

  • Do NOT try to enumerate Nextcloud's browser paths as exemptions — the OIDC walk spans /login, /index.php/*, /apps/*, /core/*, static assets; an enumerated list is a whack-a-mole regression farm.
  • renderGateRedirect + the admin route stay exactly as they are (admin. gating is DDR 0172's and is not in this ticket's scope).
  • Front-door render tests pin the new shape; note the ADR 0150 parity rationale in the render comment.
  • Expected drive outcome: files.<apex>/login reaches Nextcloud → user_oidc auto-redirect (single backend) → kanidm authorize (warm ceremony session, no consent) → back with code → #header. Exactly the proven private-path walk.

The real substrate (gate-as-OIDC-client session flow: signin endpoint consuming rd, session cookie Domain=.<apex>, a cookie SessionResolver, redirect target moved off the IdP root) is the follow-up ticket filed alongside this one, blocked on this one so the two never collide in the same files.

advances #492

Drive `20260815T043450Z` red at `oidc-admin` — and this one is a REAL product gap, not a drive defect. Third identical red (035509Z/041856Z reproduced it with less evidence); #562's navigation fix is aboard and working. ## Evidence (all in `test-results/drive-droplet/20260815T043450Z`) - The ceremony page (live kanidm session) opened `https://files.rehearsal-b.idss.nz/login` and ended stranded on kanidm `/ui/apps` (screenshot `test-failed-2.png`). No `#header`, no username field → both waiters in `oidcSignInAsOperator` timed out. - kanidm journal, the whole oidc-admin window: `04:47:52 GET /ui/login -> 303`, `04:47:52 GET /ui/apps -> 200` — and **no discovery fetch, no authorize request, ever**. Nextcloud's `user_oidc` was never consulted. - The seed itself is fine: `nextcloud-oidc-start` finished green 04:47:48 (client + origin + scopemap + claimmaps + `user_oidc` provider, #559/#560 both held). ## Cause `renderRoute` (internal/clan/frontdoor.go) puts the public files route behind `forward_auth` with only the sync exemptions (`FilesExemptPaths`: DAV + `/status.php`). `/login` is not exempt, so the gate intercepts it. The gate 401s (no session), and `renderGateRedirect` sends the browser to `https://id.<apex>/?rd=<original>` — but as its own docstring says, the flow that CONSUMES `rd` (the gate-as-OIDC-client session flow, ADR 0074's named substrate) **was never built**. The gate's `HeaderSessionResolver` (internal/controlapi/authgate.go) reads `X-Ourcloud-Identity`, which nothing establishes: no cookie, no session store, no OIDC client flow. A browser can NEVER pass this gate. kanidm ignores `rd`; a warm session 303s to `/ui/apps`; dead end. The private path never hits this because ADR 0150 ships its service routes UNGATED — "Nextcloud's own OIDC login is the wall; the auth gate's browser redirect is a named follow-up" — and that walk is proven live (Tairea drive 17 green, occ-verified admin). ## Fix (this ticket — the interim, a two-way door per ADR 0174) Bring the PUBLIC files route to the same posture as ADR 0150's private path: drop the `forward_auth` browser gate from the files route render (keep the route + exempt-path structure so re-gating is a small diff), with a loud comment naming the follow-up ticket that re-gates when the substrate exists. Suspension enforcement stands unchanged where it actually works today: the member-orbit reconciler disables the Nextcloud account (internal/memberorbit) — files.go's own docs already lean on that for the sync-path exemptions. - Do NOT try to enumerate Nextcloud's browser paths as exemptions — the OIDC walk spans `/login`, `/index.php/*`, `/apps/*`, `/core/*`, static assets; an enumerated list is a whack-a-mole regression farm. - `renderGateRedirect` + the admin route stay exactly as they are (admin.<apex> gating is DDR 0172's and is not in this ticket's scope). - Front-door render tests pin the new shape; note the ADR 0150 parity rationale in the render comment. - Expected drive outcome: `files.<apex>/login` reaches Nextcloud → `user_oidc` auto-redirect (single backend) → kanidm authorize (warm ceremony session, no consent) → back with code → `#header`. Exactly the proven private-path walk. The real substrate (gate-as-OIDC-client session flow: signin endpoint consuming `rd`, session cookie `Domain=.<apex>`, a cookie SessionResolver, redirect target moved off the IdP root) is the follow-up ticket filed alongside this one, blocked on this one so the two never collide in the same files. advances #492
Author
Owner

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

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

close-report for #565 — status success

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

envelope
{
  "issue": 565,
  "status": "success",
  "commits": [
    "a5d0f6d"
  ],
  "changed_files": [
    "STATUS.md",
    "internal/clan/files_frontdoor_test.go",
    "internal/clan/frontdoor.go",
    "internal/clan/frontdoor_test.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go test ./internal/clan/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go build ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go vet ./internal/clan/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Drop the forward_auth browser gate from the public files route render": "internal/clan/frontdoor.go renderRoute now skips the forward_auth block when routeIsUngated(r) (r.Slug == FilesSlug); verified by TestAttachFrontDoor_FilesBrowserRouteIsUngated asserting no /authz/gate, X-Ourcloud-Service files, or handle_response @unauth on the files route",
    "Keep the route + exempt-path structure so re-gating is a small diff": "the @files_exempt path matcher + handle blocks are unchanged; only the forward_auth block is gated behind routeIsUngated, so #566 re-adds one block. Pinned by TestAttachFrontDoor_FilesBrowserRouteIsUngated (@files_exempt path assertion) and TestRenderFrontDoor_ExemptPathsBypassTheGate",
    "Loud comment naming ADR 0150 parity rationale and the follow-up ticket": "renderRoute emits a multi-line render comment naming ADR 0150 parity, the never-built ADR 0074 substrate, and #566; asserted by the test's ADR 0150 + #566 substring check",
    "renderGateRedirect and the admin route stay exactly as they are": "commit a5d0f6d diff touches neither renderGateRedirect nor renderAdminRoute; admin gating tests (TestRenderFrontDoor over admin route) stay green",
    "Front-door render tests pin the new shape": "TestAttachFrontDoor_FilesBrowserRouteIsUngated added; full clan suite green"
  },
  "summary": "Ungated the public own-VPS files route (ADR 0150 parity) so files.<apex>/login reaches Nextcloud's user_oidc wall instead of dead-ending on the never-built ADR 0074 gate substrate, keeping the exempt-path structure for #566's re-gate.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #565 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; closing. <details><summary>envelope</summary> ```json { "issue": 565, "status": "success", "commits": [ "a5d0f6d" ], "changed_files": [ "STATUS.md", "internal/clan/files_frontdoor_test.go", "internal/clan/frontdoor.go", "internal/clan/frontdoor_test.go" ], "tests": [ { "command": "nix develop .#go-ci -c go test ./internal/clan/", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go build ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go vet ./internal/clan/", "exit_code": 0 } ], "criteria": { "Drop the forward_auth browser gate from the public files route render": "internal/clan/frontdoor.go renderRoute now skips the forward_auth block when routeIsUngated(r) (r.Slug == FilesSlug); verified by TestAttachFrontDoor_FilesBrowserRouteIsUngated asserting no /authz/gate, X-Ourcloud-Service files, or handle_response @unauth on the files route", "Keep the route + exempt-path structure so re-gating is a small diff": "the @files_exempt path matcher + handle blocks are unchanged; only the forward_auth block is gated behind routeIsUngated, so #566 re-adds one block. Pinned by TestAttachFrontDoor_FilesBrowserRouteIsUngated (@files_exempt path assertion) and TestRenderFrontDoor_ExemptPathsBypassTheGate", "Loud comment naming ADR 0150 parity rationale and the follow-up ticket": "renderRoute emits a multi-line render comment naming ADR 0150 parity, the never-built ADR 0074 substrate, and #566; asserted by the test's ADR 0150 + #566 substring check", "renderGateRedirect and the admin route stay exactly as they are": "commit a5d0f6d diff touches neither renderGateRedirect nor renderAdminRoute; admin gating tests (TestRenderFrontDoor over admin route) stay green", "Front-door render tests pin the new shape": "TestAttachFrontDoor_FilesBrowserRouteIsUngated added; full clan suite green" }, "summary": "Ungated the public own-VPS files route (ADR 0150 parity) so files.<apex>/login reaches Nextcloud's user_oidc wall instead of dead-ending on the never-built ADR 0074 gate substrate, keeping the exempt-path structure for #566's re-gate.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
ben closed this issue 2026-08-15 05:12:46 +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#565
No description provided.