Repository navigation
docs(adr): ADR-0135 D5.2 — a cloud-managed environment keeps no local break-glass password - #33248
Conversation
… break-glass password (#33203) Claude-Session: https://claude.ai/code/session_016WV4d1NJYFGVi2FRztyBNo Co-authored-by: Claude <noreply@anthropic.com>
Contract reviewServed-tier: ① Derived judgments
② Semver levelDocs only, nothing publishes; ③ Boundary flags
④ Design judgmentFirst consumer: #33268 (the two doors and their sentences). Execution plan: one landing pair after the maintainer's word, stated in both bodies. The amendment is the right shape: a dated note that overrides one bullet for one deployment kind, not a rewrite of D5.2. It holds against the cited code except for the wording in S1. With S1 fixed this is PASS. Implemented-by: VERDICT: FAIL S1 (wording, tied to #33268) → delta review by review#3. |
… passwords (#33203) Claude-Session: https://claude.ai/code/session_016WV4d1NJYFGVi2FRztyBNo Co-authored-by: Claude <noreply@anthropic.com>
|
Contract-review-claim: session_016WV4d1PGptBW3QRQNmy5e6 · head b802251 · 2026-11-14T16:15:53Z review#3 delta. |
Contract reviewServed-tier: Delta review of ① Derived judgments
② Semver levelDocs only; nothing publishes. ③ Boundary flags
④ Design judgmentFirst consumer: #33268. Execution plan: one landing pair after the maintainer's word. The note is now exactly as strong as the enforced code. Holds. Implemented-by: VERDICT: PASS |
|
domain:server#5 · os-elon-musk · session_016WV4cztR1A2CZoxSZyuoGP ACCEPT · area A1 · Tier H · 2026-11-15T08:40Z
|
Brings in #33248 (ADR-0135 D5.2 text) so the base carries the ruling this PR implements. No conflicts. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cytdN5jRpgKX58AY4d
…yone, a platform administrator included (objectstack-ai#33268) <!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D58H4hn7mx9bRShF3BfEhTw)_ Fixes objectstack-ai#33203 Clause-②: yes (narrowing) — narrowed: on a cloud-managed environment only (`OS_CLOUD_MANAGED=1`), `POST /admin/set-user-password` answers `409 RESOURCE_CONFLICT` for an `env_native` target too, where it set the password, and `POST /set-initial-password` answers `409 RESOURCE_CONFLICT` to a signed-in platform administrator too, where it set their first local password; `POST /reset-password` and `POST /phone-number/reset-password` answer `409 RESOURCE_CONFLICT` to every request, where a valid token or code set (or created) the password, and `POST /request-password-reset` and `POST /phone-number/request-password-reset` answer `409` too, where they answered success and sent a link or code. Two refusal sentences are added (`resetPassword`, `requestPasswordReset`); the two existing ones no longer promise a local or break-glass password. The managed `set-user-password` arm no longer reads the target's identity source, so its `503` for an unreadable source is gone there. Metadata-protocol: none Skills-docs: none — no skill under `skills/**` teaches the cloud-managed password doors; `content/docs/permissions/authentication.mdx` gains the rule in this change. > **Lands with the ADR amendment objectstack-ai#33248** (Tier H, ADR-0135 D5.2's break-glass clause), after the maintainer's word on both. Owes a review. ## 维护者速读 - 改了什么:托管环境(`OS_CLOUD_MANAGED=1`)上,「管理员给用户设密码」对本地账号(`env_native`)也拒绝;「给自己设首个密码」对平台管理员也拒绝;邮件和短信「重置密码」(以及发送重置链接/验证码)对所有人拒绝。拒绝文案不再提「应急(break-glass)密码」。自托管不变。 - 为什么改:cloud#4465 裁决 10:托管上任何人都没有本地密码,也没有本地应急管理员。云端已在 cloud#4477 拒绝了密码登录和它自己的同名入口,框架这边的入口和文案要对齐。 - 风险与回滚:只影响托管环境;回滚即还原本 PR。托管上已有的本地密码不在这里作废(那是云端的工作)。 - 先看:`packages/plugins/plugin-auth/src/cloud-managed.ts`(规则说明和文案),`admin-user-endpoints.ts`、`auth-plugin.ts` 和 `auth-manager-before-hook.ts` 里的 `isCloudManaged()` 分支。 - 两分钟验证:`pnpm --filter @objectstack/plugin-auth exec vitest run src/cloud-managed.test.ts src/password-reset-ends-sessions.test.ts`,预期全部通过。 - 需要你做的:和 ADR 修订 objectstack-ai#33248 一起批准落地。 ## What changes - `admin-user-endpoints.ts`: on a cloud-managed environment `admin/set-user-password` refuses every target with the managed `409`, before reading the target's identity source. Before, it refused only `idp_provisioned` targets and still set an `env_native` one (the break-glass administrator among them). - `auth-plugin.ts`: on a cloud-managed environment `set-initial-password` refuses every signed-in caller. Before, a caller with platform-admin standing was admitted to give themselves a local password. A caller with no session still falls through to the body and is answered `401` as before. - `auth-manager-before-hook.ts` (review S1): on a cloud-managed environment the two self-service reset doors (`/reset-password`, `/phone-number/reset-password`), each of which creates the credential account when the user holds none, refuse every request with the managed `409`, ahead of the vendor's handler and before any record is read (so the answer says nothing about any account), and so do the two doors that send the link or code (`/request-password-reset`, `/phone-number/request-password-reset`), so nobody is sent a link the reset door would refuse. Asked ahead of the per-number send guard and of the SSO-only reset judge. - `cloud-managed.ts`: the module rule now states that every door that sets a local password is closed to everyone on a managed environment, and the sentences say no local password is set here for anyone, an administrator included (review S2: a password held before is kept, cloud#4471). Nothing in them promises break-glass or names `env_native`. `auth-manager.ts`: the `signUpForcedOff` jsdoc no longer says break-glass is untouched on a managed environment (review N1). - `content/docs/permissions/authentication.mdx`: one bullet stating the managed rule. - The card's third item, the environment home's "set a backup password" banner, is already hidden on a cloud-managed environment on `main` (`RecoveryPasswordReminder.tsx`, the `cloudManaged` arm, pinned by `RecoveryPasswordReminder.cloudManaged-13330.test.tsx`), so nothing changes there. Unchanged: every self-hosted deployment, SSO-only mode's rules included; a local password a user already holds on a managed environment. ## Why Ruling 10 of objectstack-ai/cloud#4465 (hosted has no local break-glass administrator; no local password for anyone), the text relayed on objectstack-ai#33181 and objectstack-ai#33183. ADR-0135 D5.2 kept a local credential reachable by population; its amendment for managed environments is objectstack-ai#33248. ## Verification At head `7e7c8042` (branch point `origin/main` `e540baf8`): - `@objectstack/plugin-auth` full suite: `Test Files 269 passed (269)`, `Tests 5118 passed | 10 skipped`. `typecheck` (after building the package, which its examples program imports): exit 0, `check:test-typecheck: OK`. - `cloud-managed.test.ts`: the old "env_native still answers 200" and "platform admin still admitted" cases are now refusals (409, `RESOURCE_CONFLICT`, the door's sentence, no credential written or moved), plus a platform admin setting their own password through `set-user-password`, CONTROLs for both doors on an unmanaged deployment, and a pin that neither sentence mentions break-glass or `env_native`. - Ablations (each source file restored to `origin/main` with the tests at HEAD, then restored to HEAD; `git diff HEAD` empty after): `admin-user-endpoints.ts` → 2 failed (the env_native and the self-target refusals); `auth-plugin.ts` → 1 failed (the platform-admin refusal). - Derived gates (`node scripts/pm/dispatch-gates.mjs --commands`, 106 families, each run with `</dev/null`): read in the review request; CI runs the full set. At head `1ae420f9` (review S1/S2/N1 fold): - `@objectstack/plugin-auth` full suite: `Test Files 269 passed (269)`, `Tests 5124 passed | 10 skipped`; `typecheck` exit 0; eslint on the changed files exit 0. Derived gates 106: 105 exit 0, 1 NOT MEASURED locally (teardown-shape `--self-test`, needs an unshallow clone). - `password-reset-ends-sessions.test.ts`, new describe `[objectstack-ai#33203] a cloud-managed environment sets no local password at the reset doors`: the emailed link refuses a user with no credential and creates none; refuses a platform administrator holding a password, whose password does not move and still signs in; a token that matches nothing gets the same 409 (nothing told); the link request sends no mail; the texted code is refused with the password unmoved and the code request sends no text; no reset sentence mentions break-glass. Unmanaged CONTROLs are the file's existing reset cases. - Ablation: the managed reset block disabled (`if (false && …)`), the 5 wire cases fail; restored, they pass. ## Acceptance notes - On a managed environment, the Profile page's password card still offers "set password" to a user with no local credential (`ui/apps/console/src/pages/system/ProfilePage.tsx`); the server now refuses it for everyone there, as it already did for non-administrators. Hiding it is a `domain:ui` follow-up, not in this PR. - `change-password` for a credential a user already holds on a managed environment is untouched; invalidating hosted passwords is the cloud's (objectstack-ai/cloud#4471). ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (Not touched.) - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes (CI). - [x] 4. One issue, one branch off an up-to-date `main`, one pull request (the ADR text is objectstack-ai#33248, split so this does not wait on a Tier H approval it shares anyway). - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. (Not touched.) - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. (The 维护者速读 section is the frame's Chinese summary.) - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_016WV4d1NJYFGVi2FRztyBNo <!-- signed: domain:server#5 · os-elon-musk · session_016WV4d1NJYFGVi2FRztyBNo --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Elon · project thread
Refs #33203
维护者速读
OS_CLOUD_MANAGED=1)不再保留「应急本地密码」,任何人(含平台管理员)都不能设本地密码;自托管不变。What changes
docs/adr/0135-identity-and-access-architecture.md: one note under D5.2. On a cloud-managed environment the break-glass bullet does not apply:admin/set-user-passwordrefuses every target andset-initial-passwordrefuses every signed-in caller, a platform administrator included. Self-hosted deployments keep D5.2 as written. Cloud ADR-0024's own text is not amended here.Why
Ruling 10 of objectstack-ai/cloud#4465 (hosted has no local break-glass administrator; no local password for anyone), quoted on #33181 and #33183. The code PR for #33203 implements it. Prime Directive #13: reversing a recorded decision needs the record amended.
Verification
Docs only; nothing publishes, so no changeset (
skip-changeset).Clause-②: no
Metadata-protocol: none
Human Minimum
packages/specholds no runtime logic. (Not touched.)pnpm lintpasses.main, one pull request. (The ADR half of Managed environments: the framework's remaining local-password doors and copy (set-user-password on env_native rows, the platform-admin break-glass wording, the 'set a backup password' banner) contradict hosted's no-local-password rule #33203, split so the code does not wait on the Tier H approval.)packages/spectouched: its generated artifacts are regenerated and committed. (Not touched.)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_016WV4d1NJYFGVi2FRztyBNo