bug: every other preferred_username-keyed service (Gramps, video, newsletters, surveys, Paperless, portroute) carries the same IDIP username collision #1902 fixed for Files #1903
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.
Depends on
Reference
Matou/idss#1903
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?
Symptom
Sibling of #1902 (Files/Nextcloud), which was fixed by keying the Nextcloud account uid on the member's AID (
sub) on the IDIP path instead ofpreferred_username. Every OTHER community service that keys accounts/records on thepreferred_usernameclaim carries the SAME collision on the IDIP path: the bridge takespreferred_usernamefrom the member's own credential (identityFromVerdict,internal/idp/ledger_verifier.go) and nothing makes it unique, so two IDIP members who chose the same username collide onto one account/record.Services still exposed (from #1902's cause analysis, not yet verified live per service)
internal/clan/whakapapa.go:~645)internal/clan/video.go:~660)kanidm communities are NOT exposed (kanidm already makes
preferred_usernameunique, #866).What is needed
A ruling (the same A/B shape #1902 faced) per service, then the fix: on the IDIP path, key each service on the member's AID (
sub, ADR 0196) — or the ruled equivalent — the way #1902 did for Nextcloud. Each service verifies that two IDIP members with the samepreferred_usernameget two separate accounts/records.References
sub= AID), ADR 0212 / #788 (the IDIP bridge), #866 (whypreferred_usernameon kanidm)Filed while working #1902 (its ruling scoped these services out as "a separate ticket").
Ruled by agent under ADR 0174 — veto anytime
Ruling: this is a verify-first sibling of #1902, labelled
bug+ready-for-agent. The A/B architectural choice is NOT reopened per service — Ben already ruled A1 on #1902 (key on the AID,sub, on the IDIP path; kanidm unchanged; no migration). The remaining work is, per service, to determine whether an exposed IDIP path even exists and, only where it does, apply that same doctrine.Why this is a two-way door. Each service's OIDC claim mapping is a one-line render change, revertible by a later commit, and provable by a per-service render test plus a "two IDIP members, same
preferred_username" collision test — the exact shape #1902 pins. It closes an impersonation hole (it does not widen security posture), destroys no data (A1 leaves existing accounts behind), touches no credentials and spends nothing. None of the one-way-door residues apply; the only genuinely human call — A vs B — was already made on #1902.What I verified in the code (correcting the ticket's premise)
The ticket carries #1902's cause analysis "not yet verified live per service". I looked. All six named services provision against co-located kanidm OAuth2 clients, and kanidm already makes
preferred_usernameunique (#866) — which #1902's own ruling states is NOT exposed:whakapapaOIDCClientID, "the kanidmwhakapapaOAuth2 client (co-located, loopback)" (internal/clan/whakapapa.go:161,215).internal/clan/video.go:44,517-518,558).newslettersOAuth2 client … the files.go:822 pattern … no co-located kanidm carries no IdP host" (internal/clan/newsletters.go:77,174,538).preferred_username, superadmin set reconciled from the ledger (internal/clan/surveys.go:227).paperlessOIDCProviderName = "kanidm"(internal/clan/paperless.go:111,122).preferred_usernamefrom the operator account (internal/clan/portroute.go:42).The Files/Nextcloud collision existed because Nextcloud has a second render block — the device/IDIP-bridge provider whose discovery is the PUBLIC IDIP issuer (
cfg.OIDCDiscoveryURL,internal/clan/files.go:1172-1173), not kanidm; on that path nothing makespreferred_usernameunique. I did not find an equivalent IDIP/bridge render branch in any of the six services above — they appear kanidm-only. I did keyword-grade tracing, not an exhaustive read of every render path, so this is "likely not exposed", not proven.⚠️ Regression warning for the implementing agent
These services key on kanidm's
preferred_usernameon purpose — kanidm makes it unique (#866), and it is the correct handle there. Do NOT blindly flip these mappings tosub. Changing the kanidm claim would break kanidm sign-in for a case that was never broken. The fix applies ONLY to a genuine IDIP/bridge render path (a block whose discovery URI is the public IDIP issuer, likefiles.go:1172), if one exists for that service.Agent brief
Depends on #1902 (native dependency added) — land the Nextcloud IDIP fix first; it is the reference implementation for the AID-keyed IDIP block.
For each service in {Gramps/whakapapa, video, newsletters, surveys, paperless, portroute}, do the verify-then-fix loop:
cfg.OIDCDiscoveryURL), the wayinternal/clan/files.go:1172-1173does — separate from its co-located kanidm client.preferred_username" so a future reader doesn't re-file. No mapping change.sub, ADR 0196), leave the kanidm path onpreferred_username, no migration of existing accounts. Pin with a render test (IDIP branch →sub, kanidm branch →preferred_username) and a collision test (two IDIP members with the samepreferred_usernameget two separate accounts/records).Acceptance criteria
subwith the two tests above.preferred_usernamemapping is changed (a render/assertion guards this).References
sub= AID), ADR 0212 / #788 (the IDIP bridge), #866 (whypreferred_usernameis safe on kanidm)swarm-claim host=matou-dev-server-01 run=33025
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #1903 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope