Repository navigation
fix(auth)!: a cloud-managed environment sets no local password for anyone, a platform administrator included - #33268
Conversation
…yone (#33203) On a cloud-managed environment, admin/set-user-password now refuses an env_native target too, and set-initial-password refuses a platform administrator too: a hosted environment keeps no local password and no local break-glass administrator (ruling 10 of objectstack-ai/cloud#4465). The two refusal sentences no longer promise one. Self-hosted is unchanged. Claude-Session: https://claude.ai/code/session_016WV4d1NJYFGVi2FRztyBNo Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 15 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 7 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 22 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 1d8ebd74b77f92ef0115e0b8162eae7702f1f5e3 && git checkout 1d8ebd74b77f92ef0115e0b8162eae7702f1f5e3
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 7844272c47fd4e83cae6f4770b878d70b5a37e13 c976f8c26c58c9a466906456f0b209f7abad376c && git checkout -B drift-repro 7844272c47fd4e83cae6f4770b878d70b5a37e13 && git merge --no-ff c976f8c26c58c9a466906456f0b209f7abad376c
node scripts/docs-audit/affected-docs.mjs --json 7844272c47fd4e83cae6f4770b878d70b5a37e13
|
|
domain:server#5 · os-elon-musk · session_016WV4d1NJYFGVi2FRztyBNo Request: review · area A1 · Fixes #33203 · head 7e7c804 · pairs with #33248 (ADR-0135 D5.2) · requested at 2026-11-14T15:18Z Local at this head: plugin-auth full suite 269 files / 5118 passed; typecheck exit 0; derived gates 106: 103 exit 0, 3 NOT MEASURED (exit 3: teardown-shape self-test needs an unshallow clone, skill-examples and dual-build-cjs-loads need a full build); CI running. |
Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentThe direction is right and matches ruling 10 of cloud#4465 as quoted on the card: hosted recovery is the cloud's, so a local break-glass credential is a route around the hosting IdP. Closing both doors for everyone (not by population) is the correct reading; the self-hosted D5.2 split is preserved. The design is incomplete only in S1: a rule stated as "no local password for anyone" must close every framework door that mints one, or be stated as narrower. With S1 and S2 fixed this is PASS. Implemented-by: VERDICT: FAIL S1 (fold the reset doors, or narrow the claims + loose-ends card) and S2 (wording) → delta review by review#3. N1 optional. |
…t doors too (#33203) Review follow-up: both reset doors (/reset-password, /phone-number/reset-password) created a local credential on a managed environment. They now refuse every request with the managed 409, as do the two request doors that send the link or code. Refusal sentences say "no local password is set here for anyone". Claude-Session: https://claude.ai/code/session_016WV4d1NJYFGVi2FRztyBNo Co-authored-by: Claude <noreply@anthropic.com>
|
domain:server#5 · os-elon-musk · session_016WV4d1NJYFGVi2FRztyBNo Request: review · area A1 · Fixes #33203 · head 1ae420f · delta for S1/S2/N1 (records 6879603886, 6879604670) · pairs with #33248 @ b802251 · requested at 2026-11-14T16:14Z Local at this head: plugin-auth full suite 269 files / 5124 passed; typecheck exit 0; eslint on changed files exit 0; derived gates 106: 105 exit 0, 1 NOT MEASURED (teardown-shape self-test, needs an unshallow clone); reset-door ablation in the body; CI running. |
|
Contract-review-claim: session_016WV4d1PGptBW3QRQNmy5e6 · head 1ae420f · 2026-11-14T16:15:53Z review#3 delta. |
Contract reviewServed-tier: Delta review of ① Derived judgments
② Semver levelUnchanged: ③ Boundary flags
④ Design judgmentWith the reset doors folded in, the rule is enforced at every framework door that can create a local credential, as ruling 10 requires and as ADR-0135's amended note states. Refusing uniformly before any read is the right shape for a public door. Holds. Implemented-by: VERDICT: PASS |
Conflicts: - plugin-auth/src/admin-user-endpoints.ts: main's pending-SSO arm stays first (every mode, every caller); the PR's wholesale cloud-managed refusal follows it in place of main's source-reading managed arm. readUserSource import restored. - plugin-auth/src/password-reset-ends-sessions.test.ts: both new describe blocks kept (the PR's cloud-managed reset doors, main's pending reset doors). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cytdN5jRpgKX58AY4d
…al of every password door (#33203) Two tests from main's pending-SSO work assumed the cloud-managed arm still admitted a platform administrator and an env_native target. With #33203 it refuses both, so the platform-admin case is judged managed (the cloud-managed refusal answers first) and unmanaged (the pending refusal holds), and the env_native CONTROL runs off a managed environment. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cytdN5jRpgKX58AY4d
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
|
review#1 · os-elon-musk · session_016WV4cy7hQ5MvQ83ByNZ8ZH Contract-review-claim: session_016WV4cy7hQ5MvQ83ByNZ8ZH · head c976f8c · 2026-11-15T12:56:25Z |
|
review#1 · os-elon-musk · session_016WV4cy7hQ5MvQ83ByNZ8ZH Contract reviewServed-tier: Full review at this head. The record of the earlier head Independence: exception — same account (os-elon-musk) implemented this PR; the maintainer ruled 2026-11-15T12:51Z (project thread) that review#1 reviews this account's own drain PRs. Tier evidence: ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentThe narrowing makes the published rule real rather than taking a declared capability away: ruling 10 of objectstack-ai/cloud#4465 and the ADR note on Implemented-by: VERDICT: PASS |
|
domain:server#5 · os-elon-musk · session_016WV4cytdN5jRpgKX58AY4d ACCEPT · area A1 · Fixes #33203 · head c976f8c · 2026-11-15T13:02Z · Tier H hand-off (approver lands)
|
…pgrading row (objectstack-ai#33823) <!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XMKjdYGd1ASsfeFTXYf2bZ4)_ Fixes objectstack-ai#33798 Clause-②: no Metadata-protocol: none ## 维护者速读 - **改了什么**:新增 18.5.0 发布说明页 `content/docs/releases/v18/18-5.mdx`(沿用 18-4 的骨架,五段按「读者要做什么」分组),在 `meta.json` 中排在 18-4 之前;按维护者追加的要求把 `v18/index.mdx` 重写为 v18 产品线总览(不再写成 18.0.0 GA 页,`next` 改述为 `0.0.0-next-时间戳` 快照,数据库仪式只留链接到 18-0),并加上 18.5.0 条目;升级页「Per-release specifics」表加 v18.5.0 行;`handwritten-docs.json` 由生成器补一行。 - **为什么改**:维护者要求在 18.5.0 发版前写好发布说明(「18.5的版本发布说明可以开始安排写了」),并指出 v18 总说明写得不对(「我记得v18总的版本说明写的也不对」)。 - **风险与回滚**:只改文档,不发布任何包;回滚即 revert 本 PR。页面全部数字取自 Version Packages PR objectstack-ai#33097 头 `25559f43` 的 CHANGELOG 与 `npm view`,分类用发布脚本自己的 `classifyReleaseBullet`。页面是公开的,不写任何客户、下游项目或席位。 - **先看**:① `18-5.mdx` 的「需手动处理」节(45 条,每条写明变化和处理办法);② 同页「自动迁移」表(22 条全是 semantic 条目,`os migrate meta` 只列出、不改写,页面如实说明);③ 重写后的 `v18/index.mdx`。 - **两分钟验证**:`git fetch origin changeset-release/main && git show 25559f4 --diff-filter=D --name-only --format= | grep -c '^.changeset/'` 应输出 `283`;再加上 `main` 在 `b76df9a6` 之后新落地的 1 个 changeset(`1e65a389`,objectstack-ai#33725),共 `284`,与页面「Changesets consumed」一致。 - **需要你做的**:无,席位落地。版本 PR 合并前若再有 changeset 落地,由席位派发刷新。 ## What changes - **`content/docs/releases/v18/18-5.mdx`** (new): the 18.5.0 page in 18-4.mdx's skeleton. A compile callout; a release-status blockquote that says 18.5.0 is not yet published; Highlights; Release facts, as measured (before the cut); What's new by kind: 需手动处理 (45, each line saying what now answers differently and what to do, with its commit and pull request), 自动迁移 (21, a table with what to do and the ADR-0087 id), 新增能力 (70, by area), 语义变化 (1), 其他修复 (146, counted by area, with the fixes that bear on an upgrade grouped by capability); Console (Studio); an Upgrade checklist for an 18.4.0 app, compiled and not walked. - **`content/docs/releases/v18/index.mdx`**: rewritten as the v18 line overview, as the maintainer asked on the card (triage record 6893347748). The status blockquote now says 18.4.0 is the newest release and 18.5.0 is next; a table lists every 18.x release with its npm date and page; "Coming from 17.x" links the organization-ownership ceremony down to the 18.0.0 page and the upgrading guide instead of repeating it; "How a breaking stage lands on this line" (anchor kept: three pages link it) describes the level rule, protocol 18 and the two npm channels as they are now (`next` is a `0.0.0-next-YYYYMMDDHHMMSS` snapshot of `main`, ADR-0125 amendments of 2026-11-05/06); the per-release list gains the 18.5.0 entry. - **`content/docs/releases/v18/meta.json`**: `18-5` ahead of `18-4`. - **`content/docs/upgrading.mdx`**: the v18.5.0 row of "Per-release specifics", and nothing else. - **`scripts/docs-audit/handwritten-docs.json`**: +1 line, written by `node scripts/docs-audit/check-audit-scope.mjs --write` (the generator objectstack-ai#33137 used). No CHANGELOG is edited, no other release page is touched, and no tag, publish, `version` script or release-workflow act was taken. ## Why The maintainer asked for the 18.5.0 notes ahead of the cut, and on the card added that the v18 overview page was wrong: it still read as the 18.0.0 GA page and described pre mode and `18.0.0-next.N` as current. ## How the page was compiled - Source: Version Packages PR objectstack-ai#33097 at head `25559f43` (one commit; its parent `b76df9a6` is `main` at the start of this work, so the PR covers every changeset on `main`). The 122 CHANGELOG sections it writes were read with `getChangelogEntry` and split with `splitChangelogEntry`; `Updated dependencies` bullets and two dependency-list fragments dropped; deduplicated on full text: 283 entries, equal to the 283 changesets the commit deletes. Refreshed at head `1e5ae1d459` (addendum 6893969023): `main` at `1e65a389` carries one more changeset, `.changeset/33689-ai-action-confirmation-elicited.md` (objectstack-ai#33725), read from its file the same way, so the page holds 284. - Each entry placed with `classifyReleaseBullet`: 45 / 22 / 70 / 1 / 146. Levels: 39 `minor`, 245 `patch`. Breaking: 67 (24 `minor`, 43 `patch`); 62 commits since 18.4.0 carry `!`. - Every breaking line was written from its changeset's BREAKING / "What to do" / "The fix" paragraph; the 22 registered entries (23 registry ids) were checked to exist as `packages/spec/src/migrations/entries/semantic/18.*.ts` files, all semantic entries (no conversion). - The new-capability lines are the changesets' summaries with the conventional prefix removed; two are shortened or put in plain words (`534e115`, `ba32e79`). - Areas are placed mechanically from summary scope and packages, as the callout says. The breaking walk (all 61 `!` commits of `@objectstack/cli@18.4.0..b76df9a`, each mapped to its changeset and section, plus the five breaking changesets from commits without `!`, and the card's candidate list kept/dropped with reasons) is in the project file `pm-orders/devx/33798-breaking-ledger.md`. Summary: all 61 kept; candidates dropped: objectstack-ai#33268 (only the ADR text landed, no implementation on `main`), the hook refusal catalogue (objectstack-ai#33214 → `53f5a4c` is additive, listed under 新增能力), dataset metrics for the ask agent and model-picker multipliers (not landed), the SQL-first rule (an AGENTS.md rule, no changeset). ## Verification Local gates derived by `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` against this diff at `a8ae5b50af`: **61 derived, 61 run, 0 NOT-MEASURED, 0 UNRUN** (`--ran` reconciliation exit 0). `--tier`: no path-derived mandate; 906 changed lines, under the 3,000 threshold. <details><summary>Gate record</summary> - Prerequisites: `pnpm --filter "@objectstack/lint..." build` and `pnpm --filter "@objectstack/client-react..." build`, both under `os-verify-lock.sh`, VERDICT exit 0. - First pass: 60 of 61 exit 0; `check:skill-examples` exit 3 (PREREQUISITE NOT MET: `client-react` had no `.d.ts`). After the client SDK closure build it exits 0 ("346 prose examples type-check across 3 surface(s)"). - The page-reading gates, all exit 0: `check:release-notes`, `check:release-page-status`, `check-release-section-coverage.mjs` (and `--strict`), `check:doc-anchors`, `check:doc-authoring`, `check:doc-frontmatter`, `check:docs-audit-scope`, `check-affected-docs.mjs`, `check:role-word`, `check:docs-single-h1`, `check-section-landing-index.mjs`, `check:corpus-claim-drift`, `check:closed-ceremony-text`, `check:nul-bytes`, `check-adr-links.mjs`, `check-issue-citations.mjs` / `check:issue-citations`, `check-docs-section-name.mjs`, `check-doc-route-spelling.mjs --advisory`, and the seven `@objectstack/spec` readers. - The full record is in the project file `pm-orders/devx/33798-gates-ran.txt`. </details> <details><summary>Page render check</summary> The three touched pages and 18-4.mdx (positive control) compile with `@mdx-js/mdx` 3.1.1 + `remark-gfm` 4.0.1 (the docs site's MDX compiler): `18-5.mdx` 129,315 bytes of JS, `v18/index.mdx` 20,189, `upgrading.mdx` 76,568, `18-4.mdx` 324,138. Negative control: a one-line file with an unclosed brace fails the same script. The full `next build` of the docs site was not run. </details> <details><summary>Facts measured, and where</summary> - `git show 25559f4 --diff-filter=D --name-only` → 283 changesets deleted; `ls .changeset` at `b76df9a6` → 283; at `1e65a389` → 284. - Published set at `25559f43`: 110 non-private packages, all `18.5.0` (75 `@objectstack/*`, `create-objectstack`, 34 `@object-ui/*`), the same name set as at `@objectstack/cli@18.4.0`; `@object-ui/app-shell` versions `18.4.1`, private. - `npm view @objectstack/spec dist-tags` → `latest` `18.4.0`, `next` `0.0.0-next-20261115100430`; npm `time` for 18.0.0–18.4.0 gives the index table's dates; no `18.x.y-` prerelease after 18.0.0 on npm. - `git ls-remote --tags origin 'refs/tags/@objectstack/spec@18.5*'` → none. - 334 first-parent commits `@objectstack/cli@18.4.0..b76df9a`; 61 with a `!` subject; new CLI command file `packages/cli/src/commands/migrate/audit-side-copies.ts`. - `PROTOCOL_VERSION` = `'18.0.0'` (`packages/spec/src/kernel/protocol-version.ts`). </details> ## Acceptance notes - **The 自动迁移 heading overstates this release.** `classifyReleaseBullet` puts every breaking entry with a `registered` ADR-0087 marker under 自动迁移 ("migrated for you"), but all 22 of 18.5.0's registered entries are semantic entries, which `os migrate meta` lists under "manual change(s) require your judgment" and does not convert. The page keeps the heading so it agrees with the GitHub Release body, and says plainly that nothing is rewritten. Noted, not filed: it is the release script's section name, a reading the seat may want to raise with the maintainer. - **Two widenings open with their declaration line**, so the classifier reads no declaration and files them under 其他修复 (`3eac63a`, `5604aeb`); the page names them. No narrowing opens that way in this release. - **The page is written before the cut.** Its status blockquote, the index blockquote and the index table say 18.5.0 is not yet published. After the cut the seat's refresh owes: the two blockquotes, the index table row's date, the release facts (version commit, tags, npm), any changeset that landed after `b76df9a6`, and `content/docs/releases/index.mdx`'s v18 entry status `(current series: …)`, which `check-release-section-coverage --strict` will ask for once `packages/spec/CHANGELOG.md` carries `## 18.5.0`. That root index entry still describes v18 by its 18.0.0 prerelease story too; it is outside this card's file surface. - **The order's "Fixes customers waited on" section is replaced** by notable fixes grouped by capability, per the maintainer's later word on the card (triage record 6893327884): the page names no customer, downstream project or seat. - **Read heads.** `main` at `b76df9a6` and Version PR objectstack-ai#33097 at `25559f43`. While this ran, `main` moved one commit: `1e65a389` (objectstack-ai#33725, `feat(spec)!:`, a declared-gated action on an AI door confirmed by a person through MCP elicitation, with a new protocol-18 semantic entry `action-requires-confirmation-elicited`). It is not on this page; it shares no file with this diff, and the refresh before the cut picks it up with the Version PR's next head. - No changeset: the diff publishes nothing from any released package (docs content plus a script data file), so `skip-changeset` is declared. ## 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. (no code; CI runs lint) - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. (publishes nothing) - [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/`. (`content/docs/releases/v18/` is this card's subject: a docs-only release-notes PR, dispatched per card by the seat) - [x] 8. Title, body and comments are in English. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01FEkQ5oCDtzpDYo1LPg2KvR --- _Generated by [Claude Code](https://claude.ai/code/session_01FEkQ5oCDtzpDYo1LPg2KvR)_ <!-- signed: domain:devx#4 · os-project-manager · session_01FEkQ5ooRyyS95kdyC2dPEX --> --------- Co-authored-by: Claude <noreply@anthropic.com>
… local sign-in path off, and a blocked client lands on the sign-in page from the direct sign-in door (objectstack-ai#33781) <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9Ubb8CDLT8YAjNiG4Z8mgQQdT9)_ Fixes objectstack-ai#33358 Clause-②: yes (narrowing) — narrowed: with direct sign-in on and its local sign-in path `off`, an auth settings save (`PUT /api/settings/auth`) that turns Google off, or clears a Google client credential no environment variable backs, while Google is the last way in the sign-in page offers answers `400 SETTINGS_VALIDATION` (copy `googleLocalOff`) and saves nothing, where it saved, even with email and password or phone sign-in on; and a `GET /api/v1/auth/sign-in/direct` from a client the IP allow-list refuses answers `302` to `/login?error=IP_NOT_ALLOWED`, where it answered the `403 IP_NOT_ALLOWED` JSON body. Widened: under `off` with nothing else in force (no Google, no identity provider row, no social or OIDC provider with credentials, no host sign-in handoff), a save of `email_password_enabled: false` answers `200` and saves, where it answered `400 SETTINGS_VALIDATION`, because the sign-in page offers no email and password there either way; module exports (not on the package entry) `DIRECT_SIGN_IN_NETWORK_REFUSED`, `isDirectSignInDoorNavigation` and `directSignInNetworkRefusal`; the copy key `googleLocalOff` in all 11 locales; the `@object-ui/i18n` key `auth.login.errors.networkNotAllowed` in all 11 packs (no key renamed or removed); `markSignOutRoundTrip` takes the sign-in page path it records. Metadata-protocol: none Skills-docs: none — no skill under `skills/**` teaches direct sign-in, the auth settings save, the IP allow-list or the sign-out note; `content/docs/permissions/sso.mdx` gains the rules in this change. ## 维护者速读 - 改了什么:直接登录把本地登录路径设为 off 后,保存认证设置时不再把邮箱/密码当作还能登录的方式,删掉最后一个 Google 会被拒绝并给出专门的提示;被 IP 白名单拦下的浏览器打开直接登录入口时,跳回登录页并说明"不允许从你的网络登录",不再看到原始的 403 JSON;从身份提供方注销的标记只在提供方把浏览器送回登录页那一次生效。 - 为什么改:自托管系统开了 OS_AUTH_DIRECT_SIGN_IN_LOCAL_PATH=off 时,管理员关掉最后一个 Google 登录仍能保存成功,随后所有人(包括管理员)都进不了系统;被 IP 白名单拦下的人看到一段看不懂的 JSON;提供方不回跳时,下一次打开深链接会丢掉 ?redirect=。 - 风险与回滚:**BREAKING**(声明 Clause-② narrowing):直接登录且本地登录路径为 off 时,把 Google 作为最后一种登录方式关掉的设置保存从 200 变为 400;被 IP 白名单拦下的浏览器 GET 直接登录入口从 403 JSON 变为 302 跳回 /login?error=IP_NOT_ALLOWED。hidden 和直接登录关闭时行为不变;IP 白名单没有放宽,被拦的客户端仍然无法发起登录,POST 和带尾斜杠的路径仍是 403。回滚即撤回本 PR。 - 先看:packages/plugins/plugin-auth/src/sign-in-method-floor.ts 的 signInMethodFloorPredicate;auth-plugin.ts 中 IP 白名单中间件新增的一段;ui/packages/auth/src/signOutRoundTrip.ts 的 readSignOutRoundTrip。 - 两分钟验证:`cd packages/plugins/plugin-auth && pnpm exec vitest run src/sign-in-method-floor.test.ts src/direct-sign-in.test.ts`,预期全部通过,其中新加的 off 场景用例与 IP 白名单用例都在列。 - 需要你做的:无,席位落地。 ## What changes **Item 1, the settings-save half (N7).** `signInMethodFloorPredicate` now judges by what the sign-in page offers, through the same `pageOffersLocalSignIn` the provider delete and the boot report use since objectstack-ai#33623. Under `directSignIn.localSignIn: 'off'`: - the `google_*` change that removes the last way in (Google off, or a client credential cleared that no env variable backs) is refused `400 SETTINGS_VALIDATION` at its key with email and password ON, in a new `googleLocalOff` copy in all eleven languages of the existing table (the email-off copy's remedy, keep email and password on, does nothing there); turning email and password on in the same save does not help; - the `email_password_enabled` key itself is never refused under `off`, because the page draws it neither way, so the save removes nothing the page offers. With nothing else in force this widens an answer: `email_password_enabled: false` was `400` on main and is now `200` (declared under Widened). Recovery after such a save needs `OS_AUTH_EMAIL_PASSWORD_ENABLED=true` as well as `OS_AUTH_DIRECT_SIGN_IN_LOCAL_PATH=hidden`, then a restart; - phone sign-in counts only as the page offers it (`asThePageOffers: true`), as on the other two doors. Under `hidden`, or with direct sign-in off, every answer is as on main (the `localOffered` leg is true there). Copy nit folded in: `enterpriseSsoUnverified` (the `503` on a provider delete whose provider list could not be read) said "with email and password off"; it now says the sign-in page offers no email and password, which is true under both reasons the check runs. All eleven languages. `content/docs/permissions/sso.mdx` no longer says the settings save is still open, and names the three checks and the exits that still count. **Item 2 (N8), the direct sign-in door under the IP allow-list.** The allow-list middleware in `auth-plugin.ts` (one hunk, disjoint from objectstack-ai#33268's) still refuses, audits and logs exactly as before. For a GET of the mounted door only, its answer is now `302` to the Console's `/login?error=IP_NOT_ALLOWED` with the page's `?redirect=` carried (`directSignInNetworkRefusal` in `direct-sign-in.ts`, reusing `carriedRedirect` / `keptReturnPath`), instead of the raw `403` JSON. No exemption: the request never reaches the door, nothing is started, no provider is read, and every other auth request from that client (`/get-session`, `/sign-in/social`, a POST to the door path, the door path with a trailing slash) is still `403 IP_NOT_ALLOWED`. With direct sign-in off the path is not mounted and the answer is the `403` as before. The page holds on any `error` already; `ssoCallbackRefusal.ts` gains `IP_NOT_ALLOWED` with the new `@object-ui/i18n` key `auth.login.errors.networkNotAllowed` in all eleven packs (zh-Hant generated by `gen:zh-hant`), so the page says the system does not allow sign-in from this network instead of the generic "link expired" sentence. The route ledger note for `GET /api/v1/auth/sign-in/direct` says so. **Item 3, review nit N6.** Pins for the exits under `off`: another provider row, a social provider and an OIDC provider with credentials, a host sign-in handoff, on the provider delete, the boot report and the settings save. **Item 5 (N13).** The provider-logout note in `sessionStorage` now holds the time AND the return path (`createAuthClient.signOut` passes `resolveSpaRoute('/login')`, the sign-out's own `callbackURL`), and `readSignOutRoundTrip` honours it only on a load of that path within the window. `AuthProvider` still drops the note on every mount, so a tab whose provider never sent it back drops it unread on the next load of any other page: `LoginRedirect` then keeps the deep link's `?redirect=`. `LoginRedirect` itself is unchanged. A note in the old bare-number shape reads as no note. ## Why An administrator of a self-hosted system with `OS_AUTH_DIRECT_SIGN_IN_LOCAL_PATH=off` could save Google off while it was the last way in, and the page then said "No sign-in method is available" to everyone. A blocked client following the direct sign-in redirect saw a raw JSON body. A provider that never returned the browser made the next deep link in the tab land on the home page. ## Verification Final head `e25b4e31`. Round 3 (delta review 6894048463) added `e25b4e31`, a changeset-prose-only commit declaring the email-off save under `off` as widened; the changeset gates (no-major, empty-changeset, adr-0087 registration, issue citations, closed-ceremony text, changeset gate self-tests) re-ran exit 0 there. Before that, the review round (review-a FAIL 6893256448) added commit `7c6c999c` on top of `10180db4`: the changeset re-declared as narrowing, the no-Google email-key pins, the trailing-slash case and the docs sentence. Touched suites, ablations, delta gates and the dogfood battery ran on `7c6c999c` after rebuilding the closure; the full suites and the 110-family gate run are from `f76f5856` / `10180db4` (round 1), and no source file changed since, only tests, docs and the changeset. <details><summary>Tests</summary> - Round 2 at `7c6c999c`: `sign-in-method-floor.test.ts` + `direct-sign-in.test.ts`: 2 files, 168 passed. - Round 1: `pnpm --filter @objectstack/plugin-auth test` under the verify lock: Test Files 277 passed (277), Tests 5481 passed, 10 skipped. After the merge of main (`spec check:generated` all 14 up to date): 5 touched files, 210 tests passed. - Round 1 ui under the lock: `packages/i18n/`, `apps/console/src/pages/auth/`, `apps/console/src/components/__tests__`, `product-neutral-renderer.ratchet`: 137 files, 2259 passed, 13 skipped. `packages/auth` sign-out tests: 2 files, 22 passed. `pnpm --dir ui exec vitest run scripts/`: 171 files passed, 2 skipped. - Type checks (round 1): `@objectstack/plugin-auth typecheck`; turbo `type-check` for `@object-ui/auth`, `@object-ui/i18n` (6 tasks) and `@object-ui/console` (75 tasks), all successful. </details> <details><summary>Ablations (each through scripts/ablation-replace.mjs: anchor 1 to 0 on disk, red, restored, git diff HEAD empty)</summary> Round 2, at `7c6c999c`: - `if (!localOffered && key === 'email_password_enabled') return undefined;` → `if (false) …`: 2 red, both the new pins where nothing else is in force (the composed `under the local sign-in path off, the email and password key is never refused, even with no other way in configured`, and the off judge's no-Google case). With Google still in force the old pins stayed green, which was the review's point. - `method.toUpperCase() === 'GET' &&` → `true &&` in `isDirectSignInDoorNavigation`: 1 red, the `POST` to the door answers 302 instead of 403. - the path equality → `path.startsWith(basePath)`: 1 red, `/api/v1/auth/get-session` answers 302 instead of 403. - the path equality → equality after stripping a trailing slash: 1 red, `GET /api/v1/auth/sign-in/direct/` answers 302 instead of 403 (the new trailing-slash case). - `this.directSignInDoorMounted &&` → `true &&` in the allow-list middleware: 1 red, the CONTROL with direct sign-in off answers 302 instead of the 403 body. Round 1, at `f76f5856`: - `localOffered` forced true: 2 floor tests red (the composed off save and the off judge). - off copy replaced by the email-off copy: the same 2 red. - phone counted on the save under off (`asThePageOffers: false`): 1 red (the off judge). - the allow-list landing branch disabled: 1 red (the blocked navigation case). - the carried redirect dropped from the landing: 1 red. - the `IP_NOT_ALLOWED` map entry renamed in `ssoCallbackRefusal.ts`: 1 red (the page sentence pin). - the return-path comparison in `readSignOutRoundTrip` forced true: 3 red. </details> <details><summary>Gates</summary> - Round 2 at `7c6c999c`: the 48 families of the round-1 list that read the changeset, docs, ADR registration, citations, comments, error codes, the auth mount ledger or skills examples, re-run: 48 exit 0 (`check:skill-examples` after building `@objectstack/client-react`, its declared prereq). - Round 1: `dispatch-gates --commands` derived 110 families; 109 exit 0; `check:dual-build-cjs-loads` exit 3 (needs every package built) NOT MEASURED locally and left to CI. `pnpm lint` exit 0. - Dogfood battery (owed by `!` and the narrowing arm): PASS at `7c6c999c`: `pnpm --filter @objectstack/dogfood test` under the verify lock, Test Files 467 passed, 3 skipped (470); Tests 3958 passed, 42 skipped (4000); VERDICT command-exit 0 (held 33m41s, shared box). </details> ## Acceptance notes - What to do after an email-off save under `off`: setting the local path back to `hidden` is not enough; set `OS_AUTH_EMAIL_PASSWORD_ENABLED=true` as well, then restart. `sso.mdx`'s recovery sentence already says so. - Declared `Clause-②: yes (narrowing)` per claim amendment 6893265267: two answers move (the settings save under `off` from 200 to 400, the blocked door GET from 403 to 302), so the title carries `!` and the changeset a **BREAKING** paragraph, an Unchanged paragraph, What to do, and the `adr-0087: not-required (no-migration-prescription)` marker (no schema key, value or metadata type moves, nothing stored to rewrite). The bump stays `patch`, as objectstack-ai#33623 did. - `content/docs/permissions/sso.mdx` gains the 302 sentence in the direct sign-in "No loops" list. `content/docs/permissions/authentication.mdx` (the allow-list field row) is outside the claim surface and untouched; the sso.mdx sentence links to it. - `AuthProvider.tsx` keeps its comment that the first mount after the round trip starts raised; that is still true of the return load, so it is untouched. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01QsR2jSSVaNcDs8HPSoGV6V <!-- signed: domain:server#5 · zhuangjianguo · session_01QsR2jVPGBoi3MCGoKbW1Hv --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…holds (objectstack-ai#33991) <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbSUQWB2j9eHYsRcrCiq1X1C)_ Fixes objectstack-ai#33200 Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - **改了什么:** 「设置上级」(Set Manager) 现在只拒绝真正由 SCIM 目录同步的人;只通过 SSO 登录、背后没有目录的人,管理员可以照常改上级。按钮对平台管理员在每一行用户上都显示。 - **为什么改:** 托管环境里第一次通过平台 SSO 登录的人都会被标成 `idp_provisioned`,旧规则把他们全当成「目录持有」,登录后上级就再也改不了,按上级流转的审批跟不上组织调整。按裁决记录 6895645364 选项 A 修。 - **风险与回滚:** 只放宽:以前能成功的请求没有一个变成拒绝。SCIM 判定多读一次 `sys_scim_subject`,读失败返回 500 且不写入。回滚即 revert 本 PR。 - **先看:** `admin-set-user-manager.ts` 的 refusal 5 判断(`applyUserManagerLink`);`scim-sso-adoption.ts` 新导出的 `isHeldByScimDirectory`;`sys-user.object.ts` 的 `set_user_manager` `visible`。 - **两分钟验证:** `pnpm --filter @objectstack/plugin-auth exec vitest run src/admin-set-user-manager.test.ts`,预期 38 个全过,其中 "an SSO-only identity ... is SET like a local one" 为 200 并写入 `manager_id`。 - **需要你做的:** 无,席位落地。 ## What changes Built to the maintainer ruling recorded in 6895645364 (option A: only identities a SCIM directory holds stay locked). - **`POST /api/v1/auth/admin/set-user-manager` (refusal 5).** It refused on `sys_user.source = 'idp_provisioned'` alone. ADR-0135 D4 stamps that value on every federated link without a local password, so a person who only signs in through SSO carried it with no directory behind them. The refusal now also needs a `sys_scim_subject` row. The answer for a SCIM-held identity keeps its envelope (`403 PERMISSION_DENIED`, `details.reason: 'idp_provisioned'`), and the message says to change the manager in the directory. It no longer claims a sync would revert the value, because nothing projects the SCIM `manager` attribute onto the column today. The self, cycle, depth and cross-organization refusals are unchanged. - **One predicate, imported.** `scim-sso-adoption.ts` now exports `isHeldByScimDirectory(engine, userId)`. It is the same `sys_scim_subject` read its adoption judge already ran as condition 2, moved into an exported function. The judge calls it, and so does the endpoint. A missing `sys_scim_subject` table reads as "not held" at the endpoint. Any other read failure propagates, so the mount answers 500 and writes nothing. - **The `source` term stays a conjunct.** A SCIM-provisioned user with a local password is `env_native` under D4 and was accepted before. Requiring the SCIM row alone would have refused that user, so the endpoint still checks `source` too, and no request that was served before is refused now. - **Bulk import and demo staff.** Both run `applyUserManagerLink`, so their `manager_id` links follow the same rule with no code change. The import docblock now says who is refused. - **`sys_user.set_user_manager` visibility** is `current_user.isPlatformAdmin == true`. No column on the row says "held by SCIM", so the button is shown on every row and the endpoint refuses a SCIM-held one with its message. No new field or key. - **Lint prescription.** `os explain approval-approvers-may-resolve-empty` now says the operation refuses an identity a SCIM directory holds, and that an identity that only signs in through SSO is set like any other. The docblock in `validate-approval-approvers.ts` says the same. - **Docs.** `content/docs/automation/approvals.mdx`, `content/docs/capabilities/approvals.mdx` and `content/docs/permissions/authentication.mdx` state the narrowed refusal. - ⛔ The `idp_provisioned` stamp (ADR-0135 D4) and the password refusals are untouched. ## Tests On head `fa70eaa06`: - `admin-set-user-manager.test.ts`, refusal 5 rewritten. SCIM-held SET and CLEAR give 403 `PERMISSION_DENIED` / `idp_provisioned`, write nothing, and read `sys_scim_subject` for that user. SSO-only SET and CLEAR give 200, and `update` gets `{ id, manager_id }`. An SSO-only self-assignment is still a 400 `self_assignment`. `env_native` gives 200, also with a SCIM subject, and the SCIM table is not read. A missing table gives 200. A failed read rejects and writes nothing. - `admin-import-users-manager-pass.test.ts`: a SCIM-held row is refused with `idp_provisioned`. An SSO-only row is `linked`, and `manager_id` is written. The no-fork pin also asserts that the importer spells neither `sys_scim_subject` nor `isHeldByScimDirectory`. - `demo-staff.test.ts`: the refusal fixture is now a SCIM-held identity. - `sys-user-set-manager-action.test.ts` and `platform-objects.test.ts`: the action is offered on an `idp_provisioned` row and on the sparse face. It is hidden from a non-admin. It reads no record column, which has a positive control on the standing term. - `validate-approval-approvers.test.ts`: the new prescription is present, and the old `source 'idp_provisioned'` sentence is absent. <details><summary>Suite runs</summary> - `@objectstack/plugin-auth` full suite (locked, before the demo-staff fixture fix): 276/277 files. The one red was `demo-staff.test.ts`, whose fixture is fixed in the next commit. Re-run: `demo-staff.test.ts` + `demo-staff-provisioning.test.ts` 32/32. - Targeted: plugin-auth 3 files 76/76; platform-objects 2 files 169/169; lint 1 file 64/64. - `@objectstack/platform-objects` full: 122 files, 1994 tests passed. `@objectstack/lint` full: 212 files, 9026 tests passed. - Typecheck exit 0 for plugin-auth (all three legs, incl. `check:test-typecheck`), platform-objects and lint. - Dependent: `@objectstack/runtime` `platform-admin-action-gate.test.ts` 16/16. </details> <details><summary>Ablations (each mutation landed by ablation-replace.mjs, restored to the HEAD blob)</summary> - A1, refuse on `source` alone (the old predicate): 7 red, incl. every SSO-only pin in both endpoint and import suites. - A2, no refusal 5 at all: 4 red, incl. SCIM-held SET, CLEAR and the import row. - A3, refuse on the SCIM row alone (drop the `source` conjunct): 1 red, "env_native ... even one that owns a SCIM subject". - A4, swallow every SCIM read failure: 1 red, "a FAILED SCIM-subject read is never read as no directory". - A5, put the `record.source` term back on `visible`: 5 red across `sys-user-set-manager-action.test.ts` and `platform-objects.test.ts`. - A6, put the old lint sentence back: 1 red, "GRADES the routes". - A7, missing table rethrows: 1 red, "a missing sys_scim_subject table means no directory". </details> ## Acceptance notes - SCIM-held users stay unchangeable from both sides until the SCIM `manager` projection lands. The ruling records this and the separate card objectstack-ai#33918 carries it. - The action's `helpText` still lists the four other refusals and not the SCIM one. The endpoint message names the directory. Changing `helpText` would move nine translation bundles, so it is left as it is. - `details.reason` keeps the value `idp_provisioned` so no client keyed on it changes. Only the predicate behind it narrowed. ## Verification - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack`: 105 derived families. 101 exit 0. 3 exit 3 (prerequisite not met, NOT MEASURED, left to CI): `check:skill-examples`, `check:dual-build-cjs-loads`, `check:i18n`. 1 not run: `check:type-check-debt`, because the verify lock was held by another run for more than 60 minutes. `--ran` reconciliation agrees. - `--tier`: no path-derived mandate. The same verdict as merged objectstack-ai#33646 and objectstack-ai#33769. - eslint on the changed `.ts` files: exit 0. `check-nul-bytes`: OK. - `git merge-tree --write-tree` of this head against `origin/main`, objectstack-ai#33956, objectstack-ai#33268 and branch `claude/area-A2-33828`: clean, no conflicted paths. Session: https://claude.ai/code/session_01QsR2jVPGBoi3MCGoKbW1Hv 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
Requested by Elon · project thread
Fixes #33203
Clause-②: yes (narrowing) — narrowed: on a cloud-managed environment only (
OS_CLOUD_MANAGED=1),POST /admin/set-user-passwordanswers409 RESOURCE_CONFLICTfor anenv_nativetarget too, where it set the password, andPOST /set-initial-passwordanswers409 RESOURCE_CONFLICTto a signed-in platform administrator too, where it set their first local password;POST /reset-passwordandPOST /phone-number/reset-passwordanswer409 RESOURCE_CONFLICTto every request, where a valid token or code set (or created) the password, andPOST /request-password-resetandPOST /phone-number/request-password-resetanswer409too, 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 managedset-user-passwordarm no longer reads the target's identity source, so its503for 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.mdxgains the rule in this change.维护者速读
OS_CLOUD_MANAGED=1)上,「管理员给用户设密码」对本地账号(env_native)也拒绝;「给自己设首个密码」对平台管理员也拒绝;邮件和短信「重置密码」(以及发送重置链接/验证码)对所有人拒绝。拒绝文案不再提「应急(break-glass)密码」。自托管不变。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,预期全部通过。What changes
admin-user-endpoints.ts: on a cloud-managed environmentadmin/set-user-passwordrefuses every target with the managed409, before reading the target's identity source. Before, it refused onlyidp_provisionedtargets and still set anenv_nativeone (the break-glass administrator among them).auth-plugin.ts: on a cloud-managed environmentset-initial-passwordrefuses 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 answered401as 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 managed409, 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 namesenv_native.auth-manager.ts: thesignUpForcedOffjsdoc no longer says break-glass is untouched on a managed environment (review N1).content/docs/permissions/authentication.mdx: one bullet stating the managed rule.main(RecoveryPasswordReminder.tsx, thecloudManagedarm, pinned byRecoveryPasswordReminder.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 #33181 and #33183. ADR-0135 D5.2 kept a local credential reachable by population; its amendment for managed environments is #33248.
Verification
At head
7e7c8042(branch pointorigin/maine540baf8):@objectstack/plugin-authfull 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 throughset-user-password, CONTROLs for both doors on an unmanaged deployment, and a pin that neither sentence mentions break-glass orenv_native.origin/mainwith the tests at HEAD, then restored to HEAD;git diff HEADempty after):admin-user-endpoints.ts→ 2 failed (the env_native and the self-target refusals);auth-plugin.ts→ 1 failed (the platform-admin refusal).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-authfull suite:Test Files 269 passed (269),Tests 5124 passed | 10 skipped;typecheckexit 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[#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.if (false && …)), the 5 wire cases fail; restored, they pass.Acceptance notes
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 adomain:uifollow-up, not in this PR.change-passwordfor 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
packages/specholds no runtime logic. (Not touched.)pnpm lintpasses (CI).main, one pull request (the ADR text is docs(adr): ADR-0135 D5.2 — a cloud-managed environment keeps no local break-glass password #33248, split so this does not wait on a Tier H approval it shares anyway).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