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
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Reference
Matou/idss#1094
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Failure
On the standing rehearsal droplet (
rehearsal-b.idss.nz, drive20260901T021405Z), 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):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/:103take the bearer viabearerOK,idip_roster.go:74). Hence 200.control-plane/cmd/control-plane/main.go:1068—WithIdipCredentials(..., nil)andmain.go:1075—WithIdipStewards(..., nil): a nil resolver falls back toHeaderSessionResolver{}(internal/controlapi/idip_stewards.go:64-66,idip_credentials.go:75-77), which reads the identity from the trustedX-Idss-Identityheader (internal/controlapi/authgate.go:49,:110). No header →stewardIdentitywrites the 401 atinternal/controlapi/idip_stewards.go:82-83. Hence 401.So nothing is injecting
X-Idss-Identityonto 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 atmain.go:1066-1067assumes "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, soissuableDefs(: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'sapproveleg reached the wire at all.#1087drive run straight into this.Note: commit
adef99e8fixed 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:
forward_authon the dashboard's/api/v1/idip/*requests and injectX-Idss-Identity, matching what the logstream/mail steward routes already assume. This touches the deployed droplet's Caddy config, not just this checkout.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/rotationandGET /api/v1/idip/credentialsthrough the same auth path the dashboard's browser uses, so the 200/401 split cannot silently return.drive
20260901T021405Zred atapprove:approval failed: sign in at the community front door to act on the steward setevidence:
/home/dev/swarm/Matou/idss/test-results/drive-idip/20260901T021405Zon matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was capturedRuled by agent under ADR 0174 — veto anytime
Ruling: this is a one-way door → routed
ready-for-humanwith 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)internal/controlapi/idip_roster.goregisterIdipRostermountsGET idipRosterListPathwith no auth (only the two127.0.0.1bridge reads take the gate-secret bearer viabearerOK). → 200.WithIdipCredentials(..., nil)/WithIdipStewards(..., nil)/WithIdipStanding(..., nil)/WithIdipRemoval(..., nil)(cmd/control-plane/main.go:1068–1096) each fall a nil resolver back toHeaderSessionResolver{}(idip_credentials.go:75–77,idip_stewards.go:64–66), which reads the identity off the trustedX-Idss-Identityheader (authgate.go:110–116). No header →operatorAuthed/stewardIdentitywrite 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-Identityis injected by Caddy'sadmin.<apex>route:forward_auth /authz/gateresolves the community SSO session cookie andcopy_headers X-Idss-Identity(internal/clan/frontdoor.gorenderAdminRoute,renderRoute). That SSO cookie is minted by the gate's own OIDC client —GET /authz/signinruns the authorization-code flow against kanidm and sets theDomain=<apex>cookie (internal/controlapi/signin.go:27–44).On the IDIP path there is no such mechanism:
frontdoor.go:IdentityIDIPdeclares noservices.kanidm;id.<apex>proxies the idss-idp bridge). So/authz/signin's OIDC-against-kanidm substrate does not apply.id.<apex>— a different origin from the apex dashboard, and DDR 0217 ruling 9 records that origin is unreachable from the dashboard by construction./api/v1/idip/*XHRs reach the control plane through the ungated portal apex route (renderPortalRoute), carrying noX-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/signindoes on the kanidm path (the bridge is the IDIP path's IdP; the missing piece is the post-sign-in session-mint step). The existingadmin.<apex>forward_auth → /authz/gate → copy_headers X-Idss-Identityposture 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-nativeSessionResolveron 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/rotationandGET /api/v1/idip/credentialsthrough 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
adef99e8only 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-workingdropped.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:961gives the logstream routes — the very precedent the IDIP wiring comment cited —gateResolver, theCookieSessionResolverover the community SSO session.session.go:170-174states outright that this is "the productionSessionResolver… replacing the never-set X-Idss-Identity header the default resolver read". The four IDIP families passednil, 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-Identitythere is written by the caller, not the gate — andoperatorAuthed(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 (addforward_authto 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:
stewardSessionResolver(gateResolver)— the gate's own cookie resolver, so the operator's browser is recognised on the ungated portal route and behindadmin.<apex>.controlapi.DenyAllResolver— the postureWithKeriBootGatealready took — instead of falling back to header trust.renderPortalRoutestripsX-Idss-Identityinbound, so no future header-trusting route is reachable that way.operator-sessionleg: the founder signs in at their own front door (/authz/signin→ the bridge → theidss_sessioncookie) 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_CookieAdmitsHeaderAloneDoesNotdrivesGET /idip/stewards/rotationandGET /idip/credentialsthree ways — no session → 401, forged header alone → 401, real community SSO session → 200. PlusTestStewardSessionResolver_NeverHeaderTrust(the wiring),TestRenderFrontDoor_PortalStripsInboundIdentityHeader(proven red against the pre-fix render) andTestDenyAllResolver_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 passesoperatorAuthed. The roster knowsrole: 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.preferred_username, but the operator check keys on the AID #1101