Repository navigation
fix(auth)!: a boot outside development mode retires what the development seed issued - #36699
Conversation
…e development mode Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D Co-authored-by: Claude <noreply@anthropic.com>
…d changeset Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D Co-authored-by: Claude <noreply@anthropic.com>
…v-seed-retire-at-boot
…ment instead of naming it a follow-up Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D Co-authored-by: Claude <noreply@anthropic.com>
…sued credentials end Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D Co-authored-by: Claude <noreply@anthropic.com>
…tire-at-boot @ c1e7347) onto main Takes the dev-seed boot-time retirement over on this thread's branch. Conflicts: one import line in auth-plugin.ts (both kept); the tenant-audit census shard regenerated with scripts/tenant-audit-census.mjs --write. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbX8ecPYZVemPRBFSrY
…ount opened as another account A session the development seed's account opened acting as another account reads as that account and acts for the seed account; the revocation keyed on the account's own sessions did not reach it. The boot outside development mode now tombstones those too (same reason, same fail-closed rule). Pinned in the first retirement case: red before, green after. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbX8ecPYZVemPRBFSrY
…uest Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbX8ecPYZVemPRBFSrY
📓 Docs Drift CheckThis PR changes 1 package(s): 46 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 12 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. 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 6798c505a6b81cbafc7d43b98fedba141d59680b && git checkout 6798c505a6b81cbafc7d43b98fedba141d59680b
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 85dde2da8c38f018d97a43ae5da6ab55308a8aa9 fb3c2cc478f49ad9d6fa6322f411dcefe4ee56c8 && git checkout -B drift-repro 85dde2da8c38f018d97a43ae5da6ab55308a8aa9 && git merge --no-ff fb3c2cc478f49ad9d6fa6322f411dcefe4ee56c8
node scripts/docs-audit/affected-docs.mjs --json 85dde2da8c38f018d97a43ae5da6ab55308a8aa9
|
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbX8ecPYZVemPRBFSrY
|
Two red checks at
Generated by Claude Code |
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj Contract reviewServed-tier: Head note. This record is for ① Derived judgmentsA boot outside development mode retires them: yes. A boot in development mode leaves them alone: yes. The first line of the function. Pinned (case 2). Accounts without the stamp are unaffected: yes. The only account list is the read on the stamp column. No other account id enters the loop. Pinned with an administrator-created control account in cases 1, 4 and 6. An operator-set credential is untouched: yes. An account whose password changed since the seed fails the in-force check and is skipped, with everything it was issued later. Pinned (case 3) for the operator's reset and for an administrator's password write. A retired credential answers as a revoked one: yes. Sessions are tombstoned in place in the shape the existing revocation writes. Keys get Before the first request: yes. The remedy command does not trip the retirement. The hook is registered in No more than the card: yes, with one remark. The card says "sessions, API keys and tokens". The code also unlinks linked sign-in accounts, disables the OAuth applications the account registered and revokes the SCIM credentials it minted. That is the shared revocation Clause-② line: Metadata-protocol line: DELIBERATE CORRECTION of Place 1, the bold label. Place 2, the last sentence. Not consumed: the file is on ② Semver level
③ Boundary flags
④ Design judgmentThe change does what card #35184 asks. One function, one hook, the operator's own revocation reused, and the same development-mode predicate the refusals use. Retiring only accounts whose seed credential is still in force is the right reading of "an operator-set credential is untouched": retiring on the bare stamp would end operator-era credentials at every restart. Failing the boot is the right failure for a rule that says nothing keeps acting. No must-fix, no should-fix. Notes:
Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj 维护者速读开发环境会自动建一个带默认密码的管理员(「种子账号」)。以前把同一个数据库拿去以生产模式启动时,这个账号在开发时留下的登录会话、API 密钥等还能继续用,要等运维手动改密码才失效。现在生产模式启动时会自动作废这些凭据;作废不了就拒绝启动并说明原因和办法。运维改过密码的账号不受影响。 席位核对 — ACCEPT (L1) · repo:objectstack#1 · head
|
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj Narrowing hand-off · 2026-11-23T13:32Z: |
Requested by Warren · project thread
Fixes #35184
Supersedes #36311: this branch carries that PR's commits (head
c1e7347cc1, merged onto currentmain) and adds one hardening commit. The card thread can push only its own branch, so the takeover lands here.Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — no skill states what a boot outside development mode does to a seeded account's credentials.
skills/**names the development seed only asos dev --seed-admin(skills/objectstack-platform/references/operations.md); checked atorigin/main.维护者速读
What changes
The rule (ruling item 3 on #34717, the card's text): when a deployment leaves development mode, nothing the development seed issued keeps acting for an account that carries the development seed stamp. Development mode is
NODE_ENV=development(isDevelopmentMode, the predicate the #34717 refusals use). No switch.From #36311 (unchanged, see that PR for the full account):
dev-seed-credential-retirement.ts(new),retireDevSeedCredentials: outside development mode, one indexed read for stamped accounts, the in-force filter (isDevSeedCredentialInForce), then per account the revocationos user set-passworduses (revokeSessionsAndApiKeys: sessions tombstoned, keys revoked, authorized apps, device sign-ins, linked sign-in accounts, registered OAuth apps, SCIM credentials), outstanding reset tokens (endOutstandingResetTokens), and sessions in a hostsecondaryStorage(read back).kernel:readyhook inauth-plugin.ts, independent ofregisterRoutes; it settles beforekernel:listeningopens the socket.content/docs/deployment/self-hosting.mdx), changeset (patch,!, BREAKING section, ADR-0087not-required), census shard regenerated.New in this PR:
retireSessionsOpenedAs), tombstoned exactly as the account's own (same reason, counted insessions, same fail-closed rule). A further security item is with the owner seat.forced-reset-revocation.ts:isLiveSessionis exported for reuse (no behaviour change).os user set-passwordnow says what that command ends (the account's own sessions, keys and grants) instead of "the same credentials".main(node scripts/tenant-audit-census.mjs --write).Read first (by risk):
packages/plugins/plugin-auth/src/dev-seed-credential-retirement.ts:retireDevSeedCredentialsandretireSessionsOpenedAs.packages/plugins/plugin-auth/src/auth-plugin.ts, thekernel:readyhook: it runs on every boot outside development.packages/plugins/plugin-auth/src/dev-seed-credential-retirement.test.ts, cases 1–3.Two-minute check:
pnpm --filter @objectstack/plugin-auth exec vitest run src/dev-seed-credential-retirement.test.tsshows 6 cases green.Why
#35184 (p1): credentials the development seed issued kept acting after the deployment left development mode.
Verification
Branch
claude/project-thread-grxa1f, headfb3c2cc478, onorigin/main115d38788e.035b1fdfe): case 1 red, 5 others green. After the fix: 6/6 green. Removing the new call is that same red.scripts/pm/os-verify-lock.sh):dev-seed-credential-retirement,dev-seed-credential-production,dev-seed-credential(3 files, 26 passed) on the port before the fix; thendev-seed-credential-retirement,api-key-restore-guard,forced-reset-revoke-reason-vocabulary,scim-deactivation-reconcile-user,session-tombstone,admin-impersonate-endpoint(6 files, 128 passed) after it.pnpm --filter @objectstack/plugin-auth build && … typecheck: exit 0,check:test-typecheckOK.node scripts/pm/dispatch-gates.mjs --commandsderived 110, all run: 104 exit 0;check-empty-changesetexit 1 by design (the DELIBERATE CORRECTION below);check-tenant-audit-censusand its self-test exit 1 on the first pass (shard drift from the new write site), regenerated, both re-run exit 0; NOT MEASURED (exit 3, prerequisite):check-plugin-teardown-shape --self-test(needs an unshallow clone),check:skill-examples,check:dual-build-cjs-loads(need packages built). CI carries those three.Acceptance notes
admin_password_reset, as in fix(auth)!: a boot outside development mode retires what the development seed issued #36311; a dedicated reason is follow-up plugin-auth: boot-time dev-seed retirement records revocations as admin_password_reset; add a dev_seed_retired reason (after #36311) #36313..changeset/dev-seed-credential-production-refusal.md(unreleased, from fix(auth)!: a server outside development mode refuses a development seed credential #34717) is corrected: see## DELIBERATE CORRECTION.overlap-check.mjsat this head, fix(auth)!: a boot outside development mode retires what the development seed issued #36311 excluded):.changeset/dev-seed-credential-production-refusal.mdconflicts with chore: version packages #35129; the generated census shard conflicts with fix(plugin-auth)!: a directory deactivation removes the user's local password; a re-activation restores access through SSO only #34738 (whoever lands second regenerates it).auth-plugin.tswith fix(hosted): personal-view delete and attachment remove/rename answer on a hosted tenant kernel instead of 404 #36690 merges cleanly.DELIBERATE CORRECTION
This PR rewrites two lines in a pending release note it did not add:
.changeset/dev-seed-credential-production-refusal.md, in the note's last paragraph. That paragraph's label and its last sentence named the boot-time retirement as a follow-up. This PR ships it, so left unchanged the note would publish two false lines.check-empty-changesetstays red by design; the dispatching seat confirms by its own record.os user set-password, and at boot:"Human Minimum
packages/specholds no runtime logic. (No spec change.)pnpm lintis read from CI's Lint job, not run locally.main, one pull request.packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01JQwxbX8ecPYZVemPRBFSrY