setPassword's begin-credential-update GET still decodes {token:...}; real kanidm answers [CUSessionToken, CUStatus] as an array, and even fixed the commit is MFA-policy-refused — by-hand temp_password 400s live (invite-member leg) #662
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
1 participant
Notifications
Due date
No due date set.
Blocks
Reference
Matou/idss#662
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
invite-memberleg (rehearsal drive20260822T121105Z, signature1dc3e7a84786) reds onPOST /api/v1/members/by-hand:Source:
error-context.mdin the run dir,tests/e2e/journey.droplet.spec.ts:664(theinvite-memberleg,journey.droplet.spec.ts:638-703).Evidence
internal/kanidm/kanidm.go:657-661(setPassword) begins the admin credential-update session withGET /v1/person/{id}/_credential/_update, decoding the response intostruct { Token cuToken \json:"token"` }`.{"token":...}for that GET — it returns a JSON array[CUSessionToken, CUStatus]. This exact shape was already found and documented live against real kanidm 1.10.3 indocs/spike-findings/smoke-idp-178.md:68-86(finding 3), which lists four separatesetPassworddefects:{"token":...}— still broken; this is what reds today./v1/credential/_updatebody order[CURequest, CUSessionToken]— fixed by #580 (e198b8cd), confirmed at kanidm.go:668-672 (comment cites the fix)./v1/credential/_commit— fixed by #551 (db8ada0e), confirmed at kanidm.go:679.credential-type-minimum = mfa) refuses to commit a bare admin-set password (can_commit:false, warnings:["MfaRequired"]) even once the wire shapes are correct.internal/kanidm/fakekanidm_test.go:322-334's fake server still answers the begin GET with{"token": sid}(an object), matching the code's wrong assumption rather than real kanidm — so the seam test can't catch this; only a live drive does. The fake double for the POST step already documents the array convention correctly atfakekanidm_test.go:346-350(the #580 comment) — the begin-GET handler never got the matching correction.internal/kanidm/kanidm.go:179-182(CreatePerson) is what routes the by-hand path throughsetPasswordin the first place, driven fromPOST /api/v1/members/by-hand(internal/controlapi/members.go:153,internal/member/byhand.go:46CreateByHand).Suspected layer
internal/kanidm(setPassword+ its fake double), plus a founding/provisioning-layer account-policy decision (ADR 0077 territory — same shape as #485'scredential-type-minimumoneshot for the founding passkey floor, seeinternal/founding, grepcredential-type-minimum).Why this isn't a mechanical self-fix
Fixing only the decode (accept the array) satisfies the compiler and a seam test, but per the spike finding it will not close this leg: kanidm still refuses to commit a bare admin-set password credential under its default MFA-required policy, so the by-hand temp-password flow will fail one step later with a different error on the next drive. The finding's own two remediation options are structurally different:
RenderGatewayGuest/RenderFrontDoor) to also cover the by-hand temp-password path, keepingsetPasswordand its "operator hands the person a temp_password" contract (internal/member/idp.go:33-35, DDR 0073) intact; orsetPasswordat all and instead mint a reset-token intent via the already-workingMintResetTokenpath (internal/kanidm/kanidm.go:262-,internal/member/reset.go:241) — the way the smoke-idp-178 lab run had to route around this exact defect — which changes the by-hand UX contract (no more direct temp password handed out).Choosing between those is a design decision, not a one-line fix, and this healer session has no live kanidm to prove either path against (the droplet from this drive is already torn down).
What plugging it needs
MintResetToken) — human/design call, ADR 0077.setPassword: fix its begin-GET decode to the real[CUSessionToken, CUStatus]array shape (kanidm.go:657-661).fakekanidm_test.go:322-334's begin-GET handler to answer the same array shape, so the seam test would catch this the way #580's POST-body fix did.docs/spike-findings/smoke-idp-178.mdshows this exact path was never actually load-bearing on real kanidm before this leg started exercising it.drive
20260822T121105Zred atinvite-member:POST /api/v1/members/by-hand e2e-member failed: 400 {"code":"act_failed","message":"kanidm: decode GET /v1/person/e2e-member/_credential/_update: json: cannot unmarshal array into Go value of type strevidence:
test-results/…/20260822T121105Z/on matou-workstation (legs.json, droplet-journal.txt, trace) — a representative screenshot is attached here if one was captured (#596)Close report — advances #662
Ruled by agent under ADR 0174 — veto anytime. Two-way door: revertible by
commit
7b842332, provable by the seam tests (which previously could notcatch this — see below).
What landed
7b842332—internal/kanidm.setPassword's begin-credential-update GET nowdecodes real kanidm's
[CUSessionToken, CUStatus]array, not{"token":...}. Both fake kanidm doubles that had silently drifted to matchthe wrong assumption (
internal/kanidm/fakekanidm_test.goand the smoke-idpbinary's own
control-plane/cmd/smoke-idp/localkanidm.go) are corrected tothe same array shape, so the seam tests now catch this class of drift instead
of only a live drive.
docs/GOTCHAS.md#52 records the wire-shape hazard.STATUS.mdupdated same commit.The design question this ticket raised is already closed
The ticket's "why this isn't a mechanical self-fix" section read
smoke-idp-178.mdfinding 3's fourth defect (kanidm's defaultcredential-type-minimum = mfarefusing to commit a bare admin-setpassword) as still open, needing a ruling between (a) extending the
account-policy oneshot to cover by-hand, or (b) switching by-hand to
MintResetToken.That ruling was already made — ten days before this ticket's drive — as
ADR 0170 / #485 (landed
a54545ea, confirmed live by #49480b26fa7).RenderFrontDoor'skanidmCredentialFloorBlock(
internal/clan/frontdoor.go:203-209) unconditionally lowersidm_all_persons' credential floor toanyon every gateway render — own-VPS, rented, and self-hosted alike (confirmed still unconditional after
#660's public-carrier widening) — and
idm_all_personsis the builtin groupevery person belongs to, a by-hand member included. The block's own doc
comment already names "a founder (or member) commits a bare password" as the
intent — option (a) was already implemented, generically, for an unrelated
ticket. So there was no live design decision left for this session to make or
park: this was a mechanical two-way-door fix all along.
Proof
TDD red-first:
fakekanidm_test.go's begin-GET handler was switched to thearray shape first, reproducing the ticket's exact decode error
(
json: cannot unmarshal array into Go value of type struct { Token kanidm.cuToken "json:\"token\"" }) against the unfixed adapter — then theadapter fix turned it green.
go build ./...,go vet ./...,go test ./...green across every package (57 pkgs, incl.
control-plane/cmd/smoke-idp,which shared the same drifted-double bug),
gofmtclean.NOT re-proved by a fresh live drive this session — the drive's droplet
(
20260822T121105Z) was already torn down, and this session-runner classcannot itself fire the standing rehearsal (#577/ADR 0184 lock). The next
invite-memberleg is the live proof, per the #635/#636/#641/#643 precedentof closing a healed ticket on the strength of seam tests + a landed design
ruling rather than blocking on a drive this session cannot cause.