#1098 steward gate locks the founder out: the SSO session carries preferred_username, but the operator check keys on the AID #1101
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#1101
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?
The failure
Drive
20260901T051005Z(commit953c9280) reds at legcreate-credential— 25 green, 1 red, no skips (artifacts/verdict.json,artifacts/legs.json:118-124):The refusal watch is telling the truth and the leg is right to red. The founder — the community's only steward, signed in at their own front door one leg earlier — is being refused every steward act by the #1098 authorization gate.
Evidence
The caller is authenticated: leg
operator-sessionis green, andestablishOperatorSession(app/tests/e2e/fixtures/idip.ts:575-580) asserts theidss_sessioncookie exists before returning. A missing session would be 401 (internal/controlapi/logstream.go:148-151); this is 403, i.e. theauthorizeStewardbranch (internal/controlapi/idip_authz.go:134-137), reached only after the identity resolved.The caller is genuinely a steward on the roster.
logs/droplet-journal.txt:699:RosterAdapter.Registeranchors the issuance and confirms the receipt in the same act whenSAIDis set (internal/keria/adapter.go:196-201), and the drive's own page snapshot confirms the settled row: "role: operator · recorded on the roster (operator, active)" (artifacts/journey.idip-.../error-context.md, S7x carrier row).active⇒Credential.issued()(internal/keria/standing.go:70-80). SoIsOperator("EPxkx5Y3…")would answer true.The identity handed to the check is not that AID. The gate's OIDC client prefers
preferred_usernameand falls back tosubonly when it is empty:On the IDIP path the bridge emits both:
sub= AID andpreferred_username= the handle (internal/idp/storage.go:528-533, ADR 0196). The founder's handle is the e-mail local-part —usernameFromOperator(app/src/components/founding/FoundingStandup.vue:815-819) — and this drive's operator e-mail isdrive@example.nz(state/founding-state.json→/draft/details/operator/email), so the session'ssubclaim is the string"drive".The steward gate then asks the roster for that string:
StewardResolver.Authorize→s.Operators.IsOperator(ctx, identity)(internal/controlapi/idip_authz.go:103-115)RegistryOperators.IsOperator→o.reg.Member(aid)(internal/keria/operators.go:56)Registry.Memberlooks up by AID only —indexOfAID(st.Members, aid)(internal/keria/registry.go:534-544)No row for
"drive"→false→ErrNotOperator→ 403.The assumption is stated explicitly in two places and is simply not true of what the gate hands over:
internal/controlapi/idip_authz.go:79-81— "it resolves the community SSO session (the identity IS the member's AID — the bridge sets sub = AID, ADR 0196)"control-plane/cmd/control-plane/main.go:1062-1065— "the gate's own session cookie identifies the caller (sub = AID, ADR 0196)"Why the seam did not catch it
Every #1098 test seeds the session with an AID-shaped identity by hand and never crosses the OIDC exchange:
internal/controlapi/idip_steward_session_test.go:141-145,158-160andcontrol-plane/cmd/control-plane/idip_steward_resolver_test.go:18-22,38both usefakeOperators{operators: map[string]bool{"Etama": true}}against a cookie minted for"Etama". The username/AID mismatch is invisible on that seam — it lives indiscoveryOIDC.Exchange, which no steward test exercises.Blast radius (all one defect, no separate fault)
Every route family wired with
stewardResolverrefuses the founder identically — credentials (#1078), steward rotations (#1085), standing/suspend (#1082), removal (#1083) (control-plane/cmd/control-plane/main.go:1095-1122) — plus the logs surface, which routes through the sameoperatorAuthed→authorizeStewardpath (internal/controlapi/logstream.go:146-158). The remaining ten credentials-tail legs cannot arm until this is plugged.Suspected layer
Control plane, IDIP identity path. The defect is the boundary between
internal/controlapi/oidcprovider.go(what claim becomes the SSO session'ssub) andinternal/keria/operators.go(what key the roster is asked for).What plugging it needs — and the ruling it is blocked on
Two fixes are available and they are not interchangeable. This needs a ruling on which claim is the IDIP path's session identity before code is written:
sub(the AID). GivediscoveryOIDCapreferSubjectflag set byNewBridgeOIDC(internal/controlapi/oidcprovider.go:81-92), leaving kanidm onpreferred_username. Small and it matches every comment already in the tree — includinginternal/keria/standing.go:84-88, which describes the deny projection as "keyed by AID (the bridge's OIDC subject)". But the same identity feeds/authz/gate→member.Orchestrator.GateDecision(control-plane/cmd/control-plane/main.go:926;internal/member/komiti.go:567-588), which every service route on the gateway front door sits behind viaforward_auth(internal/clan/frontdoor.go:429). Flipping it changes whatDenied()andisOperator()see forfiles.<apex>,chat,code— legsdoor,branded-login,oidc-admin,files-healthyandmember-sign-inare currently green with the username, and this drive stands up a paid droplet to find out.RosterEntry.Username. Contained to the steward surfaces — but nothing enforces username uniqueness on the roster (Registry.Joinis idempotent on the AID alone,internal/keria/adapter.go:186-193), so this keys authorization on a non-unique field. That is not a change to make quietly.Whichever wins, the fix must land with a test that crosses the exchange — one that feeds a userinfo body carrying both
sub(AID) andpreferred_username(handle) and pins which one reachesIsOperator. That is the pin the current seam is missing, and its absence is why #1098 shipped green.Recommend recording the ruling as an amendment to ADR 0074/0212 (which claim the community SSO session's
subcarries, per identity path) rather than fixing it in one file and leaving the two comments quoted above still asserting the other thing.Note for the healer loop: this signature (
c1881a2de870) already absorbed one self-heal —a0f8350f(create-credentialwaited for the S1i card on the S7i screen). That fix was correct and the leg advanced past it; this is the next, deeper fault at the same leg, not a regression of that one.drive
20260901T051005Zred atcreate-credential:reachability probe failed: [data-field="credentials-panel"] is absent because the control API REFUSED: GET /api/v1/idip/stewards/rotation → 403 ({"code":"not_operator","message":"only a steward canevidence:
/home/dev/swarm/Matou/idss/test-results/drive-idip/20260901T051005Zon matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was capturedFixed —
2c7ece8e. Your diagnosis was exact.The gate's OIDC client took userinfo's
preferred_usernameas the session identity (internal/controlapi/oidcprovider.go:210). Correct for kanidm, whose ledger is keyed by username; wrong for IDIP, whose roster's stable key is the AID — the subject the bridge publishes assub(internal/idp/storage.go:524, "openid → sub = AID"). So the founder's session resolved to a handle no roster lookup could find, and #1098's gate refused the community's only steward.NewBridgeOIDCnow takes the identity fromsub; the kanidm shape keepspreferred_username. The split is per-IdP exactly asformEncodeCredentialsalready is, and each still falls back to the other claim rather than failing a sign-in outright.TestBridgeOIDC_IdentityIsTheAIDdrives both shapes off ONE userinfo carrying both claims, and is proven red against the pre-fix source (it returned"tama").Two things worth recording rather than smoothing over:
Role: RoleOperator, receipt-confirmed) and the bridge's userinfo (sub = AID) — but never the gate client's extraction between them, which is exactly where the mismatch lived. The claim was stronger than the evidence behind it.credentials-panel has not shipped, which reads as swarm backlog — and, being a skip rather than a red, would have left the drive GREEN with the whole credentials tail unrun. Instead the leg red in one run carrying the door's own words, which is how this was found and diagnosed the same hour.