operator-document-archive: allauth auto-signup forks a 2nd, unprivileged account #1607
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#1607
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
20260918T200406Z(commit5b1ca810,artifacts/verdict.json: 45 legs, 40 green, 5 red, 0 skip) went red first atoperator-document-archive.artifacts/journey.jsoncarries the same string as the drive'sfault:The username in Paperless's own refusal —
proof-operator3, notproof-operator— is the whole fault.What the live box said
The bare access line in the brief was refused (
root@209.38.94.45: Permission denied (publickey,keyboard-interactive)), butartifacts/live-box.jsonrecordskept_on_red: trueand the drive's own key atstate/rent-operator/id_ed25519; read-only over that key the box answered.systemctl --failedis empty — nothing crashed.Read the timestamps against the leg order: 20:43:05 the
grant-operatorleg pre-provisions id 4proof-operator(staff+superuser, no email); 20:45:28 the redeploy hook does the same for the foundingoperator(id 5, same trap, un-sprung only because nobody signed in as them); 20:47:01 the door leg signs in through kanidm and django-allauth creates a brand-new id 6proof-operator3with no admin flags, binding the kanidmuidto that row. Id 4 is orphaned and never touched again.The defect
internal/documentarchivesvc/documentarchivesvc.go:227states the premise the box falsifies:Paperless-ngx does not use mozilla-django-oidc.
internal/clan/paperless.go:358registersallauth.socialaccount.providers.openid_connectand:359setsPAPERLESS_SOCIAL_AUTO_SIGNUP = "true". Allauth's auto-signup never adopts an existing local account by username — on collision it suffixes to a free one. That isproof-operator3exactly.Permanent, not a race.
account()(documentarchivesvc.go:282) looks the person up withGET /api/users/?username=proof-operator, still finds orphaned id 4 holding both flags, andReconcileRoletakes the idempotent no-op at:209on every later pass. Soartifacts/roles/detail-proof-operator-after-redeploy.jsonreads{"service":"document-archive","has_access":true,"role_in_app":"superuser"}with nonot_appliedmarker — the panel tells the community the operator bit is applied while the box holds them at no privilege. That is a truthfulness fault on a posture card, not only a missing bit.member-document-archiveis green for the right reason: a plain member is a deliberate no-op (:203), so no pre-provisioned row exists to collide with andproof-member(id 7) auto-signs-up at its exact username.Subsidiary, same territory: group sync produced nothing —
SELECT g.name, u.username FROM auth_group g JOIN auth_user_groups ug … JOIN auth_user u …returns(0 rows).paperless.go:360setsPAPERLESS_SOCIAL_ACCOUNT_SYNC_GROUPS = "true"and the oneshot mapsoperators -> admins/idm_all_persons -> members, but neither Django group exists and Paperless's sync assigns to groups that already exist, it does not create them. Worth fixing alongside — it cannot substitute, because/admin/gates on theis_staffbit no Django group can confer.Suspected layer
Product. The document-archive port's identity-binding assumption (
internal/documentarchivesvc/documentarchivesvc.go:224-241), written against the wrong OIDC library's semantics, plus the allauth linking settings absent from the render (internal/clan/paperless.go:355-361). Not harness (the leg asserted the right thing and quoted Paperless's own words) and not infra (zero failed units).What plugging it needs
A human ruling first — the candidates are materially different products:
SOCIALACCOUNT_EMAIL_AUTHENTICATION+…_AUTO_CONNECT, withprovisionOperatorwriting the email and a verifiedaccount_emailaddressrow. This lets an IdP-asserted email silently adopt a pre-existing local superuser account: a security posture at a trust moment, wants an ADR.uid— honest and narrow, but it reverses #1553's ruling (an operator granted before first sign-in lands non-admin until a reconcile pass catches them).is_staff/is_superuserfrompgroupsat each sign-in — closest to "an operator is admin everywhere" and self-healing, but new product surface on the sign-in path.Whichever is ruled, the fix spans the render, the port and the double, and cannot be proven on the workstation. Make the double faithful FIRST:
internal/documentarchivesvc/documentarchivesvc_test.go:50-52'ssignUpis username-keyed and its comment encodes the very premise that produced this bug — teach it to suffix on collision and record the social binding, watch the pre-provision test go red the way the box did, then build the ruled fix. The proof is the next drive'soperator-document-archiveleg.The other four reds — a KNOWN frontier, no new ticket
operator-whakapapa,member-whakapapa,operator-newsletters,member-newslettersall show kanidm's ownError Code: InvalidState. Confirmed on the live box by the Operation IDs the legs recorded:…and identically for
c2cbf6ce(whakapapa),49be6b32andb869b83e(o2rs.name: "newsletters"). This is GOTCHAS #252, whose entry already names these two clients as out of scope:And commit
e74b1cbb(which landed the same fix for Paperless) says so in its own message: "NOT fixed, waiting on Ben: Listmonk 6.1.0 and Gramps Web API 3.13.1 send no PKCE and have no switch; disabling enforcement on those clients is a security-posture change against ADR 0196." These four re-prove on the next fire and want no new ticket.Two corrections to the framing
pairis green (237 ms), andartifacts/legs.jsoncontains no skip entries at all (verdict.json:"skip": 0) — so no skip reason in this drive names anything out of scope. The PKCE frontier above is established from GOTCHAS #252 ande74b1cbb, not from skip reasons.artifacts/healer-refusal.jsonis present (the drive's healer refused to fast-lane this,confident: false, sigaae325ce6cbf) and its document-archive diagnosis is sound — I re-derived it against the box. But its dismissal of the PKCE four as "already addressed … landed byc0c8d550(ADR 0254), which is newer than this drive's commit" does not check out:git log c0c8d550→unknown revision, and the ADR sequence ends at0253-…. The right reason those four are not filed is the standing GOTCHAS #252 ruling, not a fix that has landed.Absent from the run directory
No
logs/electron-*or helper log beyondhelper-opened-urls(28 bytes); thelogs/guest-*.logset is 127 bytes each (stub-sized — this is a droplet drive, not a guest VM one, andhost.jsonrecordsqemu: exit ENOENT).artifacts/legs/,artifacts/nextcloud/and the Playwright report underreport/exist but were not needed — the box answered directly.drive
20260918T200406Zred atoperator-whakapapa:kanidm rendered its OWN error page for proof-operator at whakapapa (https://id.roles-proof.idss.nz/ui/oauth2?response_type=code&client_id=whakapapa&redirect_uri=https%3A%2F%2Fwhakapapa.roles-proof.idsevidence:
/home/dev/swarm/Matou/idss/test-results/drive-rented-services/20260918T200406Zon matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was capturedDuplicate of #1605 (same run, same diagnosis, filed twice by the reporter). Closing; the ruling lives on #1605.