Repository navigation
docs(spec): ban-user and unban-user no longer described as needing the admin plugin - #34119
Conversation
…e admin plugin The ban and unban doors are ObjectStack mounts served with the better-auth admin plugin off as well as on. AuthFamiliesSchema.admin, the features.admin flag and the plugins.admin config described them as part of the admin plugin's surface. The actions guide's requiresFeature example now gates impersonate_user, which still 404s without the plugin. Claude-Session: https://claude.ai/code/session_01ADHkmNsjxB7oSL12vpVvW6 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check3 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 — 173 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 9d8e381b1c634aa3f815714bee7705033e2413da && git checkout 9d8e381b1c634aa3f815714bee7705033e2413da
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin fa1fb6f4e0b162f768c340ea781ccba65c61c1f7 5ec1a172638303071ad68d399d21e0f3b2c9ed07 && git checkout -B drift-repro fa1fb6f4e0b162f768c340ea781ccba65c61c1f7 && git merge --no-ff 5ec1a172638303071ad68d399d21e0f3b2c9ed07
node scripts/docs-audit/affected-docs.mjs --json fa1fb6f4e0b162f768c340ea781ccba65c61c1f7 |
|
domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC Contract-review-claim: session_01ADHkmQjrEpxMVxEiDUJHqC · head 3688723 · 2026-11-15T19:50Z |
|
domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC Contract reviewServed-tier: PR #34119 for card #34008. Read: the card body and its four comments (os-dev-report 6900296801 included), the PR body and file list (9 files, +37 / -19), the net diff from merge-base Gate verdicts on this head (45 check-runs): 14 completed ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentRoute by route on
S1 (should-fix) — N1 (nit) — N2 (nit) — the discovery describe says the family's routes answer 404 and names ban/unban as the exception. Other ObjectStack Security: no No must-fix. Implemented-by: VERDICT: PASS |
…admin plugin either Measured with plugins.admin off: unlock-user and set-user-password answer 200 like ban-user and unban-user; create-user answers 501, set-role and impersonate-user 404. The plugins.admin describe and JSDoc and the features.admin describe now list what needs the plugin from those readings. The JSDoc no longer says better-auth enforces the admin check on every route: ObjectStack mounts, create-user, remove-user and the rebuilt impersonate-user run the ADR-0068 gate; only vendor routes keep the legacy-role check. Claude-Session: https://claude.ai/code/session_01ADHkmNsjxB7oSL12vpVvW6 Co-authored-by: Claude <noreply@anthropic.com>
|
domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC Contract-review-claim: session_01ADHkmQjrEpxMVxEiDUJHqC · head 97b9f14 · 2026-11-15T20:33Z |
|
domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC Contract reviewServed-tier: Round 2, a delta review. It continues the round-1 record on head Read: the delta Gate verdicts on this head (72 check-runs): 57 ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
The three descriptions now agree with each other and with the tree on which operations the plugin turns on. S1 — CLOSED. N1 — CLOSED in part. "Assign global platform roles" is gone and "better-auth enforces this internally" is replaced by a sentence that names which doors run the ADR-0068 gate and which keep the vendor's role-scalar check. That replacement is right for every route it names, and wrong for one it covers without naming: S2. S2 (should-fix) — new in this delta. The JSDoc now says "Every one of these doors is platform-admin gated", then sorts them into two groups: the ObjectStack mounts, N2 (nit) — unchanged from round 1; no change needed. N3 (nit) — N4 (nit) — the tree pins ban and unban with the plugin off ( N5 (nit) — "ObjectStack mounts that write through the platform" is loose: with the plugin on, ban-user writes through better-auth's Security: no No must-fix. Implemented-by: VERDICT: PASS |
…ion and GET list-users stop-impersonating is neither ADR-0068 gated nor role-checked: better-auth admits it on the impersonated session with the signed admin_session cookie. list-users is a GET route. The four ObjectStack mounts are described as mounts rather than the plugin's routes, without claiming how they write. Claude-Session: https://claude.ai/code/session_01ADHkmNsjxB7oSL12vpVvW6 Co-authored-by: Claude <noreply@anthropic.com>
|
domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC Contract-review-claim: session_01ADHkmQjrEpxMVxEiDUJHqC · head 6fe7a56 · 2026-11-15T21:08Z |
|
domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC Contract reviewServed-tier: Round 3, a delta review. It continues the round-2 record on head Read: the delta Gate verdicts on this head (71 check-runs): 57 ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
S2 — CLOSED. "Every one of these doors is platform-admin gated" is gone, and N3 — CLOSED. N5 — CLOSED. The loose "write through the platform" is replaced by a true statement. N2 (nit) — unchanged; no change needed. N4 (nit) — unchanged and still open: nothing committed pins Nothing new to grade in this round. Security: no No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC Contract-review-handoff: review#2 — CONTRACT_REVIEW_TIER unavailable (maintainer-limited fable quota, 2026-11-15T23:20Z) · head 5ec1a17 Merge-of-main review: origin/main ea6de74 merged into the reviewed head 6fe7a56 (r3 PASS 6901417063) under the K ≥ 15 landing rule. Per the card thread: no conflicts, the regen produced 0 changes, and the PR diff (merge-base..6fe7a56 vs origin/main..5ec1a17) is byte-identical (sha256 a1d905662859be8a; 9 files, +52/−25). |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head 5ec1a17 · 2026-11-15T23:23Z |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract reviewServed-tier: Read at 2026-11-15T23:51Z. Merge delta review of this head against PASS 6901417063 at 6fe7a56; claim: comment 6903112431; lane request 6903091199 on mailbox #33873. Independence: implemented in an os-steve project thread, dispatched by domain:spec#2 (os-steve); reviewed by os-tesla. PR #34119, card #34008. This record is complete for this head and replaces 6901417063 for it. Read: the PR body, the card and its thread, the three earlier records, What the head is. Net-change equivalence, verified per path. What main brought in ( ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentIndependent reading at this head, since the three earlier records came from the implementing lane's own reviewer. The card asks for two texts to stop saying ban and unban need the admin plugin, with a changeset for the spec describe. The PR does that and, under the widened claim, corrects the same statement in two more spec descriptions.
Earlier findings, by id: S1 closed in round 2; S2, N3 and N5 closed in round 3; N1 closed across rounds 2 and 3. Re-read at this head, the closing text is still in place, byte for byte. N2 (nit) — carried, no change needed. The discovery describe names ban and unban as outside the 404 family; other ObjectStack mounts under N4 (nit) — carried, for the follow-up card. Committed tests pin ban and unban with the plugin off; nothing committed pins Security: no path of the diff is under No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC ACCEPT · PR #34119 (#34008) · head
|
Requested by Steve · project thread
Fixes #34008
Clause-②: no
Metadata-protocol: none
维护者速读
authFamilies.admin、features.admin、plugins.admin)和 actions 文档示例不再说「停用/恢复、解锁、重设密码需要 admin 插件」,按实测列出真正依赖插件的操作;引用文档随之重新生成。packages/spec/src/api/discovery.zod.ts、content/docs/protocol/objectui/actions.mdx、packages/spec/src/api/auth-endpoints.zod.ts。git grep -n "update-user, ban-user" -- packages/spec/src content/docs应无结果。What changes
AuthFamiliesSchema.admindescribe (packages/spec/src/api/discovery.zod.ts): the example family memberban-useris replaced byimpersonate-user, and one sentence saysban-userandunban-userare not in the family: they are ObjectStack mounts, served whatever the flag says. Still one paragraph.features.admindescribe (packages/spec/src/api/auth-endpoints.zod.ts): creating and impersonating users are the operations that need the plugin; banning, unbanning, unlocking and setting a password answer without it, and the describe says the console still shows its unlock and set-password actions only when the flag is true.plugins.admindescribe and JSDoc (packages/spec/src/system/auth-config.zod.ts): the JSDoc lists the endpoints that need the plugin (create-user, which answers501without it,impersonate-user/stop-impersonating,set-role,remove-user,GET list-users,list-user-sessions,revoke-user-session(s)) apart from the four ObjectStack mounts served without it (ban-user,unban-user,unlock-user,set-user-password), described as mounts rather than the plugin's routes, with no claim about how they write. "better-auth enforces this internally" is replaced: the ObjectStack mounts,create-user,remove-userand the rebuiltimpersonate-userrun the ADR-0068 gate, the vendor routes keep better-auth's legacyuser.rolecheck, andstop-impersonatingis neither: better-auth admits it on the impersonated session with the signedadmin_sessioncookieimpersonate-userset (read frombetter-auth/dist/plugins/admin/routes.mjs1.7.12, which also declareslist-usersasGET). "assign global platform roles" is gone. The describe follows the same split.content/docs/protocol/objectui/actions.mdx: therequiresFeature: adminworked example gatesimpersonate_user(/api/v1/auth/admin/impersonate-user) in place ofban_user. The second example (disable_oauth_application) is unchanged.content/docs/references/api/{discovery,protocol,auth-endpoints}.mdx,content/docs/references/system/auth-config.mdx(check:generated --fix, which named onlycheck:docsstale)..changeset/34008-ban-without-admin-plugin-prose.md:patchon@objectstack/spec.Why
The measurement, on
origin/mainat27c2f1ea. A throwaway probe (thepending-sso-users.test.tsharness, one platform admin, deleted after the run, not committed) fired each door withplugins.adminoff and on:features.admin/admin/unlock-user/admin/set-user-password/admin/ban-user/admin/unban-user/admin/set-role/admin/create-userNOT_IMPLEMENTED/admin/impersonate-userSource reading:
packages/plugins/plugin-auth/src/auth-plugin.ts:POST {basePath}/admin/ban-userand/admin/unban-userare raw Hono mounts with no admin-plugin condition. Without the plugin,getBanWriterwrites through the data engine (isAdminPluginMounted()false) and the session refusal enforces the ban.pending-sso-users.test.tspins this ("a row banned while the admin plugin was on stays refused after the plugin is turned off", the ban / unban cases with the plugin off, and a CONTROL with it on).sys_user.ban_user/unban_usercarry norequiresFeature, andPUBLIC_AUTH_FEATURES.admin.gatedInputs(packages/spec/src/kernel/public-auth-features.ts) books neither, with a note saying why.features.adminis false: the better-auth vendor routes with no ObjectStack mount:list-users,set-role,update-user,list-user-sessions,revoke-user-session(s),stop-impersonating, andimpersonate-user(replaced on the admin plugin's ownendpointsrecord byadmin-impersonate-endpoint.ts, so it exists only with the plugin). The dogfood pindiscovery-auth-families.dogfood.test.tsreadsGET /auth/admin/list-usersas 404 with the plugin off and not 404 with it on.sys_user.impersonate_userdeclaresrequiresFeature: 'admin', which is why it is the docs example now.create-userstay mounted without the plugin but answer501 NOT_IMPLEMENTED; the describe's family list does not name them, so this PR does not touch that wording.Tests
pnpm --filter @objectstack/spec testat6fe7a568: Test Files 843 passed (843), Tests 26966 passed | 1 todo. Lock VERDICT command-exit 0.git grepof the three old phrases outsidepackages/spec/src, references and CHANGELOGs finds only the two out-of-scope copies listed below).Acceptance notes
packages/plugins/plugin-auth/src/auth-manager-plugin-list.ts:312, a code comment "Platform admin: ban/unban, set-password, impersonate, set-role." beside the admin plugin's registration. With the plugin on, the vendor's ban hook still enforces, so it is loose rather than false.domain:server.docs/qa/platform-checklist/areas/identity-auth.jsonitemidentity-auth.admin-lifecycle-operationstitle lists ban/unban among "admin user-lifecycle operations"; it makes no plugin claim.domain:devx.content/docs/releases/v18/18-5.mdxandpackages/spec/CHANGELOG.mdkeep their historical wording (release-owned).content/docs/permissions/authentication.mdxalready says ban / unban answer withoutplugins.admin; unchanged.skills/**file teaches the old rule (git grep -n "ban-user\|ban_user\|unban" -- skillsis empty), so no skills follow-up.sys_user.unlock_userandsys_user.set_user_passworddeclarerequiresFeature: 'admin'(packages/platform-objects/src/identity/sys-user.object.ts) andPUBLIC_AUTH_FEATURES.admin.gatedInputsbooks both, while their doors answer 200 with the plugin off (probe above). On a deployment without the admin plugin the two buttons are hidden though the doors work: the same shape the ban / unban buttons had before PR fix(platform-objects): offer Ban / Unban without the better-auth admin plugin #33989. Not changed here (platform-objects + kernel feature table); for the seat to file. Thefeatures.admindescribe states the current console behaviour as it is.discovery.zod.tsandcontent/docs/**; the delta also asks for otherpackages/spec/**copies, which addedauth-endpoints.zod.tsandauth-config.zod.ts.Verification
Derived gates at 6fe7a56: 104 derived, 103 run green, 1 NOT MEASURED
node scripts/pm/dispatch-gates.mjs --ranon the final record: "104 derived famil(ies) accounted for — 103 run, 1 NOT-MEASURED".pnpm check:dual-build-cjs-loadsexit 3, PREREQUISITE NOT MET (reads every package'sdist/; this container built only the spec, lint and client-react closures). CI runs it.6fe7a568, withNODE_OPTIONS=--max-old-space-size=4096exported for the whole run, and all 103 exited 0 on that first run. Earlier heads needed reruns: at97b9f14c,spec check:generatedran itscheck:test-typechecktscout of heap without that flag; at36887238,check-plugin-teardown-shape.mjs --self-testneeded its pinned fixture commit fetched into the shallow clone.spec-seat2/34008-gates-ran-r3.txt.🤖 Generated with Claude Code
https://claude.ai/code/session_01ADHkmNsjxB7oSL12vpVvW6