Repository navigation
fix(plugin-auth): remove-sso-user writes an admin audit row; host-failure texts say the removal is refused - #35422
Conversation
…is refused; a committed removal writes an admin audit row Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb
…ure wording Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb
📓 Docs Drift Check7 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 21 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 6c80b8a8aaaff09ad214642e42f83b72a9c66e34 && git checkout 6c80b8a8aaaff09ad214642e42f83b72a9c66e34
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin a5ddeb6ead111f4d1a7373e05cf5ddcbab2b86a8 19f393f3614922732d80ae148c2d890f852b661b && git checkout -B drift-repro a5ddeb6ead111f4d1a7373e05cf5ddcbab2b86a8 && git merge --no-ff 19f393f3614922732d80ae148c2d890f852b661b
node scripts/docs-audit/affected-docs.mjs --json a5ddeb6ead111f4d1a7373e05cf5ddcbab2b86a8 |
|
repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4 维护者速读
席位核对 — ACCEPT (L1-a) · repo:objectstack#5 · head
|
…ng-sso-users shared harness Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb
|
repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb Landing · area data-1 · 2026-11-19T10:16Z
State: draft → ready + auto-merge (merge queue). The PR body now says |
repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb
Fixes #34404
Clause-②: no
Metadata-protocol: none
维护者速读
席位核对
What changes
packages/plugins/plugin-auth/src/environment-user-host.ts: thegoesAhead('removed')log sentence said "The removal goes ahead." althoughrunRemoveSsoUseranswers503 SERVICE_UNAVAILABLEonhost_failed(both the member-throw and the accessor-throw paths). It now says "The removal is refused: the door keeps no record to ask the host again from." The file header and theEnvironmentUserHostdocblock now list a removal with a deactivation as refused on a host failure. Theadded/deactivated/reactivatedsentences are unchanged (A1: onlyremovedwas false).packages/plugins/plugin-auth/src/auth-plugin.ts: theenvironmentUserHostoption docblock, same correction.packages/plugins/plugin-auth/src/pending-sso-users.ts: a removal that committed calls the sharedwriteAdminAuditwithaction: 'delete',recordIdthe removed user, andmetadata{ event: 'user.admin_removed_pending', hostNotified }. Every refusal path returns before it, so a refused removal writes nothing.packages/plugins/plugin-auth/src/admin-user-endpoints.ts:writeAdminAudit'sactionadmits'delete'(a declaredsys_audit_log.actionoption), andAdminAuditDecisionsgains theuser.admin_removed_pendingvariant. Neither symbol is exported from the package entry..changeset/34404-remove-sso-user-audit-row.md:@objectstack/plugin-authpatch.The door's behaviour is unchanged apart from the new audit row.
Tests
Head
19f393f361(round 2, per L1-a ACCEPT 7004734980). The pins live in the component's shared harness,pending-sso-users.test.ts, as one top-leveldescribe('[#34404] admin/remove-sso-user writes an admin audit row for a removal that committed')on itsstage()/managedStage(). Each case adds the person through the realadmin/add-sso-userroute and removes them through the realadmin/remove-sso-userroute:deleterow, both with and without a host.503, the person is kept), a typed host refusal, and a not-pending person (409) write zero rows.The round-1 file
remove-sso-user-audit-row-34404.test.tsis deleted.Readings
pending-sso-users.test.ts+pending-sso-seams.test.ts+admin-user-endpoints.test.ts: Test Files 3 passed (3), Tests 219 passed (219); lock VERDICT command-exit 0.19f393f361: thewriteAdminAuditcall guarded never to run (blob 13f9a76b → 844dc222) gives 2 failed / 2 passed. The two row pins go red and the two CONTROLs stay green. Restored: blob == HEAD.pnpm --filter @objectstack/plugin-auth typecheck: exit 0.Acceptance notes
Fixes.admin/ban-user/admin/unban-user, which write no explicit admin audit row.Verification
dispatch-gates.mjs --commandsat19f393f361gives 77 families: 76 exit 0, and 1 NOT MEASURED (check:dual-build-cjs-loads, which needs a full build; CI runs it).overlap-check.mjs --branch=HEAD: clean.Generated by Claude Code