IDIP dashboard: the operator's browser session never reaches the identity-gated control-API routes — /idip/credentials and /idip/stewards/rotation answer 401 on the droplet #1094

Closed
opened 2026-09-01 02:36:30 +00:00 by matou-build-agent · 2 comments

Failure

On the standing rehearsal droplet (rehearsal-b.idss.nz, drive 20260901T021405Z), the operator's own dashboard browser gets 401 from every control-API route gated on the operator SSO session, while the ungated roster routes answer 200 in the same page load.

From the drive's Playwright trace (artifacts/journey.idip-*/trace.zip, 3-trace.network / 4-trace.network):

GET /api/v1/idip/roster            -> 200
GET /api/v1/idip/credentials       -> 401
GET /api/v1/idip/stewards/rotation -> 401
GET /api/v1/idip/invites           -> 200
POST /api/v1/idip/invites          -> 201
POST /api/v1/idip/roster/anchor-issuance -> 204
POST /api/v1/idip/roster/confirm-receipt -> 204
GET /api/v1/idip/stewards/rotation -> 401

The split is exact and reproducible across both browser contexts in the run.

Evidence — the seam

The two groups are mounted side by side on the same mux with different auth:

  • control-plane/cmd/control-plane/main.go:1063 — WithIdipRoster(..., gateSecret): registerIdipRoster's steward-facing list route (internal/controlapi/idip_roster.go:117) runs no gate at all (only the two bridge loopback reads at :88/:103 take the bearer via bearerOK, idip_roster.go:74). Hence 200.
  • control-plane/cmd/control-plane/main.go:1068 — WithIdipCredentials(..., nil) and main.go:1075 — WithIdipStewards(..., nil): a nil resolver falls back to HeaderSessionResolver{} (internal/controlapi/idip_stewards.go:64-66, idip_credentials.go:75-77), which reads the identity from the trusted X-Idss-Identity header (internal/controlapi/authgate.go:49, :110). No header → stewardIdentity writes the 401 at internal/controlapi/idip_stewards.go:82-83. Hence 401.

So nothing is injecting X-Idss-Identity onto the dashboard's /api/v1/idip/* XHRs on this droplet. On the IDIP path the front door is the idss-idp bridge, not kanidm (ADR 0212) — the comment at main.go:1066-1067 assumes "the front door feeds on X-Idss-Identity", and on this path it evidently does not for the dashboard's own API calls.

WithIdipStanding (main.go, just below :1075) sits behind the same gate (internal/controlapi/idip_standing.go:63-67), so suspend / re-admit are refused the same way.

Blast radius

  • loadDefinitions (dashboard/src/components/members/IdipRosterPanel.vue:731) gets nothing, so issuableDefs (:397) is empty: the merged approve form can offer no preset credentials, and mint's preset picker is empty. The approve still issues Membership, which is why the drive's approve leg reached the wire at all.
  • The whole steward-set rotation surface (S1i strip, S4i "Make a steward", S9i co-sign — DDR 0217 ruling 7) is unreachable from the dashboard.
  • The credentials-tail legs of the #1087 drive run straight into this.

Note: commit adef99e8 fixed only how this presented — the rotation strip's 401 was being written into the approve ceremony's own error line, reddening a landed approval. The 401 itself is untouched and is this issue.

What plugging it needs

A ruling between two seams, then the wiring:

  1. Front door — have the gateway's Caddy config run forward_auth on the dashboard's /api/v1/idip/* requests and inject X-Idss-Identity, matching what the logstream/mail steward routes already assume. This touches the deployed droplet's Caddy config, not just this checkout.
  2. Route auth — give these routes a resolver that accepts whatever the dashboard's operator session actually carries on the IDIP/bridge path, rather than the kanidm-path header trust.

Option 1 keeps one identity posture across all steward routes; option 2 admits the bridge path is different. Needs a human call (ADR 0212 territory) before a worker acts. Whichever lands, pin it with a seam test that drives GET /api/v1/idip/stewards/rotation and GET /api/v1/idip/credentials through the same auth path the dashboard's browser uses, so the 200/401 split cannot silently return.

drive 20260901T021405Z red at approve: approval failed: sign in at the community front door to act on the steward set
evidence: /home/dev/swarm/Matou/idss/test-results/drive-idip/20260901T021405Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

## Failure On the standing rehearsal droplet (`rehearsal-b.idss.nz`, drive `20260901T021405Z`), the operator's own dashboard browser gets **401** from every control-API route gated on the operator SSO session, while the ungated roster routes answer 200 in the same page load. From the drive's Playwright trace (`artifacts/journey.idip-*/trace.zip`, `3-trace.network` / `4-trace.network`): ``` GET /api/v1/idip/roster -> 200 GET /api/v1/idip/credentials -> 401 GET /api/v1/idip/stewards/rotation -> 401 GET /api/v1/idip/invites -> 200 POST /api/v1/idip/invites -> 201 POST /api/v1/idip/roster/anchor-issuance -> 204 POST /api/v1/idip/roster/confirm-receipt -> 204 GET /api/v1/idip/stewards/rotation -> 401 ``` The split is exact and reproducible across both browser contexts in the run. ## Evidence — the seam The two groups are mounted side by side on the same mux with **different** auth: - `control-plane/cmd/control-plane/main.go:1063` — `WithIdipRoster(..., gateSecret)`: `registerIdipRoster`'s steward-facing list route (`internal/controlapi/idip_roster.go:117`) runs **no** gate at all (only the two bridge loopback reads at `:88`/`:103` take the bearer via `bearerOK`, `idip_roster.go:74`). Hence 200. - `control-plane/cmd/control-plane/main.go:1068` — `WithIdipCredentials(..., nil)` and `main.go:1075` — `WithIdipStewards(..., nil)`: a nil resolver falls back to `HeaderSessionResolver{}` (`internal/controlapi/idip_stewards.go:64-66`, `idip_credentials.go:75-77`), which reads the identity from the trusted `X-Idss-Identity` header (`internal/controlapi/authgate.go:49`, `:110`). No header → `stewardIdentity` writes the 401 at `internal/controlapi/idip_stewards.go:82-83`. Hence 401. So nothing is injecting `X-Idss-Identity` onto the dashboard's `/api/v1/idip/*` XHRs on this droplet. On the IDIP path the front door is the **idss-idp bridge**, not kanidm (ADR 0212) — the comment at `main.go:1066-1067` assumes "the front door feeds on X-Idss-Identity", and on this path it evidently does not for the dashboard's own API calls. `WithIdipStanding` (`main.go`, just below `:1075`) sits behind the same gate (`internal/controlapi/idip_standing.go:63-67`), so suspend / re-admit are refused the same way. ## Blast radius - `loadDefinitions` (`dashboard/src/components/members/IdipRosterPanel.vue:731`) gets nothing, so `issuableDefs` (`:397`) is empty: the merged approve form can offer **no** preset credentials, and mint's preset picker is empty. The approve still issues Membership, which is why the drive's `approve` leg reached the wire at all. - The whole steward-set rotation surface (S1i strip, S4i "Make a steward", S9i co-sign — DDR 0217 ruling 7) is unreachable from the dashboard. - The credentials-tail legs of the `#1087` drive run straight into this. Note: commit `adef99e8` fixed only how this **presented** — the rotation strip's 401 was being written into the approve ceremony's own error line, reddening a landed approval. The 401 itself is untouched and is this issue. ## What plugging it needs A ruling between two seams, then the wiring: 1. **Front door** — have the gateway's Caddy config run `forward_auth` on the dashboard's `/api/v1/idip/*` requests and inject `X-Idss-Identity`, matching what the logstream/mail steward routes already assume. This touches the deployed droplet's Caddy config, not just this checkout. 2. **Route auth** — give these routes a resolver that accepts whatever the dashboard's operator session actually carries on the IDIP/bridge path, rather than the kanidm-path header trust. Option 1 keeps one identity posture across all steward routes; option 2 admits the bridge path is different. Needs a human call (ADR 0212 territory) before a worker acts. Whichever lands, pin it with a seam test that drives `GET /api/v1/idip/stewards/rotation` and `GET /api/v1/idip/credentials` through the same auth path the dashboard's browser uses, so the 200/401 split cannot silently return. drive `20260901T021405Z` red at `approve`: `approval failed: sign in at the community front door to act on the steward set` evidence: `/home/dev/swarm/Matou/idss/test-results/drive-idip/20260901T021405Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: c1ac37bc5a0d -->
Author
Member

Ruled by agent under ADR 0174 — veto anytime

Ruling: this is a one-way door → routed ready-for-human with a proposed default below. The two-way residue (a green seam test, the Caddy wiring) cannot be landed before the ruling, because its very shape depends on which option is chosen and there is nothing on the IDIP path yet to test against (see the "deeper finding" below).

The seam confirmed (paths are repo-root; the ticket cites the control-plane/-prefixed copies)

  • Steward roster list route runs no gate — internal/controlapi/idip_roster.go registerIdipRoster mounts GET idipRosterListPath with no auth (only the two 127.0.0.1 bridge reads take the gate-secret bearer via bearerOK). → 200.
  • WithIdipCredentials(..., nil) / WithIdipStewards(..., nil) / WithIdipStanding(..., nil) / WithIdipRemoval(..., nil) (cmd/control-plane/main.go:1068–1096) each fall a nil resolver back to HeaderSessionResolver{} (idip_credentials.go:75–77, idip_stewards.go:64–66), which reads the identity off the trusted X-Idss-Identity header (authgate.go:110–116). No header → operatorAuthed/stewardIdentity write the 401 (idip_stewards.go:82–83). Exactly the ticket's split.

Deeper finding — why neither option is a mechanical wiring

On the kanidm path, X-Idss-Identity is injected by Caddy's admin.<apex> route: forward_auth /authz/gate resolves the community SSO session cookie and copy_headers X-Idss-Identity (internal/clan/frontdoor.go renderAdminRoute, renderRoute). That SSO cookie is minted by the gate's own OIDC client — GET /authz/signin runs the authorization-code flow against kanidm and sets the Domain=<apex> cookie (internal/controlapi/signin.go:27–44).

On the IDIP path there is no such mechanism:

  • No kanidm (frontdoor.go: IdentityIDIP declares no services.kanidm; id.<apex> proxies the idss-idp bridge). So /authz/signin's OIDC-against-kanidm substrate does not apply.
  • The operator's bridge sign-in (signify challenge, ADR 0212 dec. 1) lands a session on id.<apex> — a different origin from the apex dashboard, and DDR 0217 ruling 9 records that origin is unreachable from the dashboard by construction.
  • The dashboard's /api/v1/idip/* XHRs reach the control plane through the ungated portal apex route (renderPortalRoute), carrying no X-Idss-Identity. Hence the 200s (ungated routes) sit beside the 401s (header-gated routes) in one page load.

So both ticket options share an unbuilt prerequisite: the operator's bridge-verified identity must first be materialised into a same-apex, control-plane-readable session. There is no existing test/probe to prove a fix against — the ruling defines what to build.

Why this is a one-way door (ADR 0174)

It is a security-posture decision on the highest-privilege surface in the product — the routes behind this gate rotate the steward set, revoke/retire credentials, suspend and remove members (DDR 0217 rulings 6–8). Defining how the operator's identity is trusted here is a posture ruling, not a revertible config tweak, and the ticket itself flags it as ADR 0212 territory. It is squarely on the ADR 0174 one-way-door list (auth-posture / trust-boundary), so it stops on the human.

Why human

A one-way-door ruling (ADR 0174): choose the operator-identity posture for the IDIP-path control surface. Not Ben's hands — a worker/session can implement + prove whichever Ben picks; Ben's is the posture call.

Proposed default ruling (adopt to unblock): Option 1 — one identity posture. Have the idss-idp bridge mint the same Domain=<apex> community SSO session the auth gate already reads, mirroring what /authz/signin does on the kanidm path (the bridge is the IDIP path's IdP; the missing piece is the post-sign-in session-mint step). The existing admin.<apex> forward_auth → /authz/gate → copy_headers X-Idss-Identity posture then carries the operator identity onto /api/v1/idip/* unchanged — no new trusted-header surface, one posture across every steward and service route. Rejected alternative — Option 2 (a bridge-native SessionResolver on each IDIP control route) — forks the trust model into a second posture for the same-privilege surface, which is the higher long-term risk.

Whichever lands, the pin is the same: a seam test that drives GET /api/v1/idip/stewards/rotation and GET /api/v1/idip/credentials through the actual dashboard auth path (bridge-session → apex → gate), so the 200/401 split cannot silently return. Under Option 1 the control-plane routes need no code change — the fix is the bridge session-mint + the same forward_auth the admin route already renders — so the seam test lives at the gate/bridge boundary, not on each route.

Note: commit adef99e8 only fixed how this presented (the rotation-strip 401 was reddening a landed approval's error line). The 401 itself is untouched and is this issue.


No two-way part landed this session: the fix, the seam-test shape, and the Caddy change all depend on the ruling, and no operator-identity mechanism exists on the IDIP path to prove a green test against. Relabelled ready-for-session → ready-for-human; agent-working dropped.

## Ruled by agent under ADR 0174 — veto anytime **Ruling: this is a one-way door → routed `ready-for-human` with a proposed default below.** The two-way residue (a green seam test, the Caddy wiring) cannot be landed before the ruling, because its very shape depends on which option is chosen and there is nothing on the IDIP path yet to test against (see the "deeper finding" below). ### The seam confirmed (paths are repo-root; the ticket cites the `control-plane/`-prefixed copies) - Steward roster **list** route runs **no gate** — `internal/controlapi/idip_roster.go` `registerIdipRoster` mounts `GET idipRosterListPath` with no auth (only the two `127.0.0.1` bridge reads take the gate-secret bearer via `bearerOK`). → **200**. - `WithIdipCredentials(..., nil)` / `WithIdipStewards(..., nil)` / `WithIdipStanding(..., nil)` / `WithIdipRemoval(..., nil)` (`cmd/control-plane/main.go:1068–1096`) each fall a **nil resolver back to `HeaderSessionResolver{}`** (`idip_credentials.go:75–77`, `idip_stewards.go:64–66`), which reads the identity off the trusted `X-Idss-Identity` header (`authgate.go:110–116`). No header → `operatorAuthed`/`stewardIdentity` write the **401** (`idip_stewards.go:82–83`). Exactly the ticket's split. ### Deeper finding — why neither option is a mechanical wiring On the **kanidm path**, `X-Idss-Identity` is injected by Caddy's `admin.<apex>` route: `forward_auth /authz/gate` resolves the community **SSO session cookie** and `copy_headers X-Idss-Identity` (`internal/clan/frontdoor.go` `renderAdminRoute`, `renderRoute`). That SSO cookie is minted by the gate's own OIDC client — `GET /authz/signin` runs the authorization-code flow **against kanidm** and sets the `Domain=<apex>` cookie (`internal/controlapi/signin.go:27–44`). On the **IDIP path there is no such mechanism**: - No kanidm (`frontdoor.go`: `IdentityIDIP` declares no `services.kanidm`; `id.<apex>` proxies the idss-idp bridge). So `/authz/signin`'s OIDC-against-kanidm substrate does not apply. - The operator's bridge sign-in (signify challenge, ADR 0212 dec. 1) lands a session on **`id.<apex>` — a different origin** from the apex dashboard, and DDR 0217 ruling 9 records that origin is unreachable from the dashboard by construction. - The dashboard's `/api/v1/idip/*` XHRs reach the control plane through the **ungated portal apex** route (`renderPortalRoute`), carrying **no** `X-Idss-Identity`. Hence the 200s (ungated routes) sit beside the 401s (header-gated routes) in one page load. So both ticket options share an **unbuilt prerequisite**: the operator's bridge-verified identity must first be materialised into a same-apex, control-plane-readable session. There is no existing test/probe to prove a fix against — the ruling *defines what to build*. ### Why this is a one-way door (ADR 0174) It is a **security-posture decision on the highest-privilege surface in the product** — the routes behind this gate rotate the steward set, revoke/retire credentials, suspend and *remove* members (DDR 0217 rulings 6–8). Defining how the operator's identity is trusted here is a posture ruling, not a revertible config tweak, and the ticket itself flags it as ADR 0212 territory. It is squarely on the ADR 0174 one-way-door list (auth-posture / trust-boundary), so it stops on the human. ## Why human A **one-way-door ruling** (ADR 0174): choose the operator-identity posture for the IDIP-path control surface. Not Ben's hands — a worker/session can implement + prove whichever Ben picks; Ben's is the posture call. **Proposed default ruling (adopt to unblock): Option 1 — one identity posture.** Have the **idss-idp bridge mint the same `Domain=<apex>` community SSO session the auth gate already reads**, mirroring what `/authz/signin` does on the kanidm path (the bridge *is* the IDIP path's IdP; the missing piece is the post-sign-in session-mint step). The existing `admin.<apex>` `forward_auth → /authz/gate → copy_headers X-Idss-Identity` posture then carries the operator identity onto `/api/v1/idip/*` unchanged — **no new trusted-header surface, one posture across every steward and service route.** Rejected alternative — Option 2 (a bridge-native `SessionResolver` on each IDIP control route) — forks the trust model into a second posture for the same-privilege surface, which is the higher long-term risk. Whichever lands, the pin is the same: a seam test that drives `GET /api/v1/idip/stewards/rotation` and `GET /api/v1/idip/credentials` through the **actual** dashboard auth path (bridge-session → apex → gate), so the 200/401 split cannot silently return. Under Option 1 the control-plane routes need no code change — the fix is the bridge session-mint + the same forward_auth the admin route already renders — so the seam test lives at the gate/bridge boundary, not on each route. Note: commit `adef99e8` only fixed how this *presented* (the rotation-strip 401 was reddening a landed approval's error line). The 401 itself is untouched and is this issue. --- *No two-way part landed this session: the fix, the seam-test shape, and the Caddy change all depend on the ruling, and no operator-identity mechanism exists on the IDIP path to prove a green test against. Relabelled `ready-for-session` → `ready-for-human`; `agent-working` dropped.*
Owner

Fixed — b63b3851.

The ruling this asked for turned out not to be needed: the codebase had already chosen, and the IDIP routes just didn't use the choice. main.go:961 gives the logstream routes — the very precedent the IDIP wiring comment cited — gateResolver, the CookieSessionResolver over the community SSO session. session.go:170-174 states outright that this is "the production SessionResolver … replacing the never-set X-Idss-Identity header the default resolver read". The four IDIP families passed nil, which resolves to that never-set header. Not a fork between two seams; one wiring line repeated four times.

The 401 was the benign half of it. The apex portal route is ungated by design (#512) and was rendered with no header stripping, so an inbound X-Idss-Identity there is written by the caller, not the gate — and operatorAuthed (logstream.go:146) asks only whether an identity is present, never whose. So the same line that refused the honest operator admitted any caller who set the header, on a public URL, to create/issue/revoke credentials, start steward rotations, and suspend or remove members. That is why option 1 (add forward_auth to the portal route) was the wrong layer to reach for: it would have papered over a route family trusting a header it must never trust.

What landed:

  1. The four families take stewardSessionResolver(gateResolver) — the gate's own cookie resolver, so the operator's browser is recognised on the ungated portal route and behind admin.<apex>.
  2. Resting (no apex / no gate secret) now fails closed via controlapi.DenyAllResolver — the posture WithKeriBootGate already took — instead of falling back to header trust.
  3. renderPortalRoute strips X-Idss-Identity inbound, so no future header-trusting route is reachable that way.
  4. The drive grew a non-skippable operator-session leg: the founder signs in at their own front door (/authz/signin → the bridge → the idss_session cookie) before any steward act, asserting the cookie directly rather than inferring it from a page that renders the same either way.

The seam test you asked for, in the shape you asked for: TestIdipStewardSession_CookieAdmitsHeaderAloneDoesNot drives GET /idip/stewards/rotation and GET /idip/credentials three ways — no session → 401, forged header alone → 401, real community SSO session → 200. Plus TestStewardSessionResolver_NeverHeaderTrust (the wiring), TestRenderFrontDoor_PortalStripsInboundIdentityHeader (proven red against the pre-fix render) and TestDenyAllResolver_NeverAuthenticates. docs/GOTCHAS.md #148 records the general hazard: an ungated route that does not strip a trusted header is not weak auth, it is no auth.

Still open, filed as #1098 (ready-for-human): authentication is real now, but there is no authorization — any signed-in MEMBER still passes operatorAuthed. The roster knows role: operator, but whether the bridge's OIDC subject is the AID the registry keys on needs confirming before a gate keys on it; assuming that equality wrongly would lock a founder out of their own community.

Note the roster read (WithIdipRoster's steward-facing list, idip_roster.go:117) still runs no gate at all — unchanged here, since it predates this arc and is a read; worth a look under #1098's umbrella.

Checks: go build ./...; go test ./internal/controlapi ./internal/clan ./control-plane/... ./internal/keria; gofmt; vue-tsc; app vitest 53/53.

**Fixed — `b63b3851`.** The ruling this asked for turned out not to be needed: the codebase had already chosen, and the IDIP routes just didn't use the choice. `main.go:961` gives the logstream routes — the very precedent the IDIP wiring comment cited — `gateResolver`, the **`CookieSessionResolver`** over the community SSO session. `session.go:170-174` states outright that this is "the production `SessionResolver` … replacing the never-set X-Idss-Identity header the default resolver read". The four IDIP families passed `nil`, which resolves to that never-set header. Not a fork between two seams; one wiring line repeated four times. **The 401 was the benign half of it.** The apex portal route is ungated by design (#512) and was rendered with no header stripping, so an inbound `X-Idss-Identity` there is written by the caller, not the gate — and `operatorAuthed` (`logstream.go:146`) asks only whether an identity is *present*, never whose. So the same line that refused the honest operator admitted **any caller** who set the header, on a public URL, to create/issue/revoke credentials, start steward rotations, and suspend or remove members. That is why option 1 (add `forward_auth` to the portal route) was the wrong layer to reach for: it would have papered over a route family trusting a header it must never trust. What landed: 1. The four families take `stewardSessionResolver(gateResolver)` — the gate's own cookie resolver, so the operator's browser is recognised on the ungated portal route *and* behind `admin.<apex>`. 2. Resting (no apex / no gate secret) now **fails closed** via `controlapi.DenyAllResolver` — the posture `WithKeriBootGate` already took — instead of falling back to header trust. 3. `renderPortalRoute` strips `X-Idss-Identity` inbound, so no future header-trusting route is reachable that way. 4. The drive grew a non-skippable `operator-session` leg: the founder signs in at their own front door (`/authz/signin` → the bridge → the `idss_session` cookie) before any steward act, asserting the cookie directly rather than inferring it from a page that renders the same either way. The seam test you asked for, in the shape you asked for: `TestIdipStewardSession_CookieAdmitsHeaderAloneDoesNot` drives `GET /idip/stewards/rotation` and `GET /idip/credentials` three ways — no session → 401, **forged header alone → 401**, real community SSO session → 200. Plus `TestStewardSessionResolver_NeverHeaderTrust` (the wiring), `TestRenderFrontDoor_PortalStripsInboundIdentityHeader` (proven red against the pre-fix render) and `TestDenyAllResolver_NeverAuthenticates`. `docs/GOTCHAS.md` #148 records the general hazard: an ungated route that does not strip a trusted header is not weak auth, it is no auth. **Still open, filed as #1098 (`ready-for-human`):** authentication is real now, but there is no *authorization* — any signed-in MEMBER still passes `operatorAuthed`. The roster knows `role: operator`, but whether the bridge's OIDC subject is the AID the registry keys on needs confirming before a gate keys on it; assuming that equality wrongly would lock a founder out of their own community. Note the roster read (`WithIdipRoster`'s steward-facing list, `idip_roster.go:117`) still runs no gate at all — unchanged here, since it predates this arc and is a read; worth a look under #1098's umbrella. Checks: `go build ./...`; `go test ./internal/controlapi ./internal/clan ./control-plane/... ./internal/keria`; gofmt; `vue-tsc`; app vitest 53/53.
ben closed this issue 2026-09-01 03:48:25 +00:00
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#1094
No description provided.