portal: the front door's apex render — panel-bookmark 308, file_server shell, the API allow-list, 404 fall-through (spec #1361 s32–35) #1364

Closed
opened 2026-09-10 00:56:32 +00:00 by ben · 2 comments
Owner

Parent

Spec #1361 (the Portal); program map #1336; design contract DDR 0232 / ADR 0233, flow docs/ux/flows/portal.mermaid, wireframes docs/ux/wireframes/portal/. Slice frontdoor-apex-allow-list in docs/slices/portal.yaml.

What to build

renderPortalRoute (both renders): the @panel 308 for the closed tab list (/overview /fleet /services /members /backups /settings + subpaths → admin.{uri}) on the PUBLIC render only; file_server for the bundle's shell + assets at the apex; the proxied ALLOW-LIST (device enrol/report faces, join, /api/v1/mail/, /api/v1/me, healthz, /authz/, /brand/, /get, /mesh/); every other /api/v1/ answers 404 at the apex. Byte-pinned public + private render tests. The bundle's brand artifacts are compiled in so the shell renders without the control plane.

Acceptance criteria

  • Given the public render, when the front door is rendered, then the apex handle carries one @panel matcher for /overview /fleet /services /members /backups /settings (+ subpaths) answering 308 to https://admin.{uri} BEFORE the proxy; the render test byte-pins it.
  • Given the private render, when the front door is rendered, then there is NO @panel redirect; the render test byte-pins its absence.
  • Given either render, when the apex handle is rendered, then the bundle's shell and assets are served by file_server from the dashboard build directory, and only the allow-list is proxied: /api/v1/enroll/{redeem,pair,requests/}, /api/v1/fleet/report, /api/v1/join/, /haere-mai/, /idip/join/, /api/v1/mail/, /api/v1/me, /api/v1/me/doors, /api/v1/healthz, /authz/, /brand/, /get, /mesh/.
  • Given GET https:///api/v1/members (or any operator family), when it is requested at the apex, then the front door answers 404; the same route on admin. behaves as today.
  • Given https:///anything-else, when it is requested, then the shell is served (the Portal's own PT-S3), never a redirect.
  • Given the control plane is down, when the apex is opened, then the shell still serves (the bundle's compiled brand artifacts render it) — never a 502.

Blocked by

  • #1365 (the faces must exist before the apex stops serving the panel)
  • #1366 (the app must open admin. first)
  • #1367 (the harness must target the panel first)
  • #1368

This is where the one-way door lands (DDR 0232 §9): landing this render on main is what moves the panel off the apex for every reseeded community. Never land it before its blockers close.

Task manifest

task: frontdoor-apex-allow-list
implements_flow: portal
implements_edge: PT-S0→PT-S3 (unknown paths are the Portal's; panel paths 308 first)
wireframe: ''
interface: renderPortalRoute(apex, target) — Caddy text, byte-pinned
seam: clan front-door render tests (public + private)
acceptance:
- given: the public render
  when: the front door is rendered
  then: the apex handle carries one @panel matcher for /overview /fleet /services /members /backups /settings
    (+ subpaths) answering 308 to https://admin.<apex>{uri} BEFORE the proxy; the render test byte-pins
    it
- given: the private render
  when: the front door is rendered
  then: there is NO @panel redirect; the render test byte-pins its absence
- given: either render
  when: the apex handle is rendered
  then: 'the bundle''s shell and assets are served by file_server from the dashboard build directory,
    and only the allow-list is proxied: /api/v1/enroll/{redeem,pair,requests/*}, /api/v1/fleet/report,
    /api/v1/join/*, /haere-mai/*, /idip/join/*, /api/v1/mail/*, /api/v1/me, /api/v1/me/doors, /api/v1/healthz,
    /authz/*, /brand/*, /get, /mesh/*'
- given: GET https://<apex>/api/v1/members (or any operator family)
  when: it is requested at the apex
  then: the front door answers 404; the same route on admin.<apex> behaves as today
- given: https://<apex>/anything-else
  when: it is requested
  then: the shell is served (the Portal's own PT-S3), never a redirect
- given: the control plane is down
  when: the apex is opened
  then: the shell still serves (the bundle's compiled brand artifacts render it) — never a 502
depends_on:
- portal-entry-faces
- seat-dashboard-door
- harness-panel-address
- refusal-brand-and-invite-link
out_of_scope:
- operator truth on the Portal
- operator notices / per-service public switch
- IDIP identity door
- mail on IDIP (stated limit)
- IDIP browser sign-in UX (#1302)
needs_human_decision: []
## Parent Spec **#1361** (the Portal); program map **#1336**; design contract DDR 0232 / ADR 0233, flow `docs/ux/flows/portal.mermaid`, wireframes `docs/ux/wireframes/portal/`. Slice `frontdoor-apex-allow-list` in `docs/slices/portal.yaml`. ## What to build renderPortalRoute (both renders): the @panel 308 for the closed tab list (/overview /fleet /services /members /backups /settings + subpaths → admin.<apex>{uri}) on the PUBLIC render only; file_server for the bundle's shell + assets at the apex; the proxied ALLOW-LIST (device enrol/report faces, join, /api/v1/mail/*, /api/v1/me*, healthz, /authz/*, /brand/*, /get, /mesh/*); every other /api/v1/* answers 404 at the apex. Byte-pinned public + private render tests. The bundle's brand artifacts are compiled in so the shell renders without the control plane. ## Acceptance criteria - [ ] Given the public render, when the front door is rendered, then the apex handle carries one @panel matcher for /overview /fleet /services /members /backups /settings (+ subpaths) answering 308 to https://admin.<apex>{uri} BEFORE the proxy; the render test byte-pins it. - [ ] Given the private render, when the front door is rendered, then there is NO @panel redirect; the render test byte-pins its absence. - [ ] Given either render, when the apex handle is rendered, then the bundle's shell and assets are served by file_server from the dashboard build directory, and only the allow-list is proxied: /api/v1/enroll/{redeem,pair,requests/*}, /api/v1/fleet/report, /api/v1/join/*, /haere-mai/*, /idip/join/*, /api/v1/mail/*, /api/v1/me, /api/v1/me/doors, /api/v1/healthz, /authz/*, /brand/*, /get, /mesh/*. - [ ] Given GET https://<apex>/api/v1/members (or any operator family), when it is requested at the apex, then the front door answers 404; the same route on admin.<apex> behaves as today. - [ ] Given https://<apex>/anything-else, when it is requested, then the shell is served (the Portal's own PT-S3), never a redirect. - [ ] Given the control plane is down, when the apex is opened, then the shell still serves (the bundle's compiled brand artifacts render it) — never a 502. ## Blocked by - #1365 (the faces must exist before the apex stops serving the panel) - #1366 (the app must open admin.<apex> first) - #1367 (the harness must target the panel first) - #1368 **This is where the one-way door lands** (DDR 0232 §9): landing this render on main is what moves the panel off the apex for every reseeded community. Never land it before its blockers close. ## Task manifest ```yaml task: frontdoor-apex-allow-list implements_flow: portal implements_edge: PT-S0→PT-S3 (unknown paths are the Portal's; panel paths 308 first) wireframe: '' interface: renderPortalRoute(apex, target) — Caddy text, byte-pinned seam: clan front-door render tests (public + private) acceptance: - given: the public render when: the front door is rendered then: the apex handle carries one @panel matcher for /overview /fleet /services /members /backups /settings (+ subpaths) answering 308 to https://admin.<apex>{uri} BEFORE the proxy; the render test byte-pins it - given: the private render when: the front door is rendered then: there is NO @panel redirect; the render test byte-pins its absence - given: either render when: the apex handle is rendered then: 'the bundle''s shell and assets are served by file_server from the dashboard build directory, and only the allow-list is proxied: /api/v1/enroll/{redeem,pair,requests/*}, /api/v1/fleet/report, /api/v1/join/*, /haere-mai/*, /idip/join/*, /api/v1/mail/*, /api/v1/me, /api/v1/me/doors, /api/v1/healthz, /authz/*, /brand/*, /get, /mesh/*' - given: GET https://<apex>/api/v1/members (or any operator family) when: it is requested at the apex then: the front door answers 404; the same route on admin.<apex> behaves as today - given: https://<apex>/anything-else when: it is requested then: the shell is served (the Portal's own PT-S3), never a redirect - given: the control plane is down when: the apex is opened then: the shell still serves (the bundle's compiled brand artifacts render it) — never a 502 depends_on: - portal-entry-faces - seat-dashboard-door - harness-panel-address - refusal-brand-and-invite-link out_of_scope: - operator truth on the Portal - operator notices / per-service public switch - IDIP identity door - mail on IDIP (stated limit) - IDIP browser sign-in UX (#1302) needs_human_decision: [] ```

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

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

close-report for #1364 — status success

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

envelope
{
  "issue": 1364,
  "status": "success",
  "commits": [
    "d4136cf472800bdda9d7e921e712ad37a2df238a"
  ],
  "changed_files": [
    "STATUS.md",
    "internal/clan/frontdoor.go",
    "internal/clan/frontdoor_private_test.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 vet ./internal/clan/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "public render: one @panel matcher for the closed tab list (+ subpaths) answers 308 to https://admin.<apex>{uri} BEFORE the proxy; byte-pinned": "frontdoor.go renderPortalRoute renders `@panel path /overview /overview/* /fleet /fleet/* /services /services/* /members /members/* /backups /backups/* /settings /settings/*` then `redir @panel https://admin.<apex>{uri} 308` first in the ordered route (panelRedirect=true, public call site); TestRenderFrontDoor_PublicApexRedirectsPanelBookmarks pins it and asserts redir precedes reverse_proxy @allow",
    "private render: NO @panel redirect; byte-pins its absence": "private call site passes panelRedirect=false so the @panel block is omitted; TestRenderPrivateFrontDoor_ApexHasNoPanelRedirect asserts no @panel / no redir in the private apex section",
    "either render: bundle shell+assets served by file_server from dashboard build dir; only the allow-list proxied": "route ends with `root * /srv/idss/dashboard` + `try_files {path} /index.html` + `file_server`; `@allow path <ADR 0233 §2 list>` reverse-proxies the control plane; pinned by TestRenderFrontDoor_ApexServesTheBundleShellAndProxiesOnlyTheAllowList (public) + the updated private portal test",
    "GET https://<apex>/api/v1/members (or any operator family) answers 404 at the apex; admin.<apex> behaves as today": "`@api path /api/v1/*` + `respond @api 404` after the allow-list reverse_proxy (non-allow-listed /api/v1/* falls to 404); renderAdminRoute (admin.<apex>) is unchanged; pinned in the same public test (`respond @api 404`) and the admin route tests still green",
    "https://<apex>/anything-else serves the shell (PT-S3), never a redirect": "unknown paths match none of @panel/@allow/@api, so try_files falls back to /index.html and file_server serves the shell; no redir on non-panel paths (byte-pinned route order)",
    "control plane down: the shell still serves, never a 502": "file_server over /srv/idss/dashboard is a static server with no upstream, independent of the control plane; dashboardBuildDir constant documents this (ADR 0233 §7)"
  },
  "summary": "Rewrote renderPortalRoute (both renders) so the apex serves the Portal bundle by file_server, 308s panel bookmarks to admin.<apex> on the public render only, proxies just the ADR 0233 §2 allow-list, and 404s every other operator API path — byte-pinned public + private front-door render tests.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1364 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1364, "status": "success", "commits": [ "d4136cf472800bdda9d7e921e712ad37a2df238a" ], "changed_files": [ "STATUS.md", "internal/clan/frontdoor.go", "internal/clan/frontdoor_private_test.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 vet ./internal/clan/", "exit_code": 0 } ], "criteria": { "public render: one @panel matcher for the closed tab list (+ subpaths) answers 308 to https://admin.<apex>{uri} BEFORE the proxy; byte-pinned": "frontdoor.go renderPortalRoute renders `@panel path /overview /overview/* /fleet /fleet/* /services /services/* /members /members/* /backups /backups/* /settings /settings/*` then `redir @panel https://admin.<apex>{uri} 308` first in the ordered route (panelRedirect=true, public call site); TestRenderFrontDoor_PublicApexRedirectsPanelBookmarks pins it and asserts redir precedes reverse_proxy @allow", "private render: NO @panel redirect; byte-pins its absence": "private call site passes panelRedirect=false so the @panel block is omitted; TestRenderPrivateFrontDoor_ApexHasNoPanelRedirect asserts no @panel / no redir in the private apex section", "either render: bundle shell+assets served by file_server from dashboard build dir; only the allow-list proxied": "route ends with `root * /srv/idss/dashboard` + `try_files {path} /index.html` + `file_server`; `@allow path <ADR 0233 §2 list>` reverse-proxies the control plane; pinned by TestRenderFrontDoor_ApexServesTheBundleShellAndProxiesOnlyTheAllowList (public) + the updated private portal test", "GET https://<apex>/api/v1/members (or any operator family) answers 404 at the apex; admin.<apex> behaves as today": "`@api path /api/v1/*` + `respond @api 404` after the allow-list reverse_proxy (non-allow-listed /api/v1/* falls to 404); renderAdminRoute (admin.<apex>) is unchanged; pinned in the same public test (`respond @api 404`) and the admin route tests still green", "https://<apex>/anything-else serves the shell (PT-S3), never a redirect": "unknown paths match none of @panel/@allow/@api, so try_files falls back to /index.html and file_server serves the shell; no redir on non-panel paths (byte-pinned route order)", "control plane down: the shell still serves, never a 502": "file_server over /srv/idss/dashboard is a static server with no upstream, independent of the control plane; dashboardBuildDir constant documents this (ADR 0233 §7)" }, "summary": "Rewrote renderPortalRoute (both renders) so the apex serves the Portal bundle by file_server, 308s panel bookmarks to admin.<apex> on the public render only, proxies just the ADR 0233 §2 allow-list, and 404s every other operator API path — byte-pinned public + private front-door render tests.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#1364
No description provided.