Skip to content

fix(plugin-auth)!: a cloud-managed runtime keeps email and password off when its deployment declares it off - #38028

Draft
objectstack-fleet[bot] wants to merge 5 commits into
mainfrom
claude/issue-34174-managed-password-toggle
Draft

objectstack-fleet[bot] wants to merge 5 commits into
mainfrom
claude/issue-34174-managed-password-toggle

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #34174

Clause-②: yes (narrowing) — narrowed: on a cloud-managed runtime (OS_CLOUD_MANAGED=1) whose deployment declares emailAndPassword.enabled: false, an auth settings save (PUT /api/settings/auth) that changes email_password_enabled to a value that reads on answers 400 SETTINGS_VALIDATION and saves nothing in the batch, where it saved; a stored value that reads on is no longer applied there; and there a Google change no longer counts email and password as a way in. Widened: on that runtime, a save that turns email_password_enabled off or clears it answers 200 and saves without the sign-in method floor, where the floor refused it 400 SETTINGS_VALIDATION; the field error can carry constraint: { cloudManaged: true, declaredEmailPassword: false }; a managedEmailPassword copy key in all 11 locales.
Metadata-protocol: none
Skills-docs: none — no skill under skills/** teaches the auth settings save or the email and password switch; content/docs/deployment/self-hosting.mdx and content/docs/permissions/sso.mdx gain the cloud-managed case in this change.

维护者速读

  • 托管云环境的管理员在 设置 → 认证 里重新打开「邮箱/密码登录」后,登录页不再重新画出一张提交必失败的密码表单;自建部署用户无感。
  • 属于托管云环境的统一登录工作,替托管环境的最终用户解决「看得见却用不了的登录方式」。
  • 出错时托管环境的管理员保存该开关会被拒并看到说明;已存的旧值不生效、服务端记一次错误日志;可直接撤回本改动。
  • 无

What changes

On a cloud-managed runtime (isCloudManaged()) whose deployment declared emailAndPassword.enabled: false, email and password stays off whatever the auth settings hold. Two places, both in plugin-auth:

  1. The settings pass (bindAuthSettings, auth-plugin.ts). A stored auth.email_password_enabled that reads on is not applied there, so getPublicConfig().emailPassword.enabled (what GET /api/v1/auth/config serves) keeps answering false. Said once at error with the remedy (clear the setting), the same level this pass uses for the audience settings it does not apply. An OS_AUTH_EMAIL_PASSWORD_ENABLED value (source: 'env') is the deployment's own declaration and still applies.
  2. The save door (sign-in-method-floor.ts). The write predicate on email_password_enabled (the sign-in floor's; the settings service keeps one predicate per key) refuses a save of a value that reads on there: 400 SETTINGS_VALIDATION, invalid_value at the key, a new localized sentence managedEmailPassword in all eleven settings locales, constraint { cloudManaged: true, declaredEmailPassword: false }. Any other save of the key there (off, or a clear) passes, and is no longer judged by the floor: the host holds it off either way, so it removes no way in, and it is how a row stored on is put right. A Google change judged by the floor there reads email and password as off whatever the same save sets it to (contract review S1): a true that is no change asks no predicate at its own key, and the runtime would not apply it.
  3. Docs. self-hosting.mdx (the sign-in floor section) and sso.mdx (the direct sign-in off section) state the cloud-managed case.

Why both, chosen contract-first. The card offers "refuse the save" or "do not apply the key". Measured on main (below), the save door alone cannot close it: with nothing stored, the key resolves to the manifest default true, so the settings service sees a save of true as no change, asks no predicate, and stores the row, which the pass then applied. Rows stored before this change are not reached by a save door either. So the guarantee is the settings pass not applying the key on such a runtime, and the save door is the loud refusal wherever the settings service does ask (a change from a stored false). Neither half adds a tolerant fallback in a consumer: the deployment's declaration is the authority, and the store is refused, not reinterpreted.

Admin update-user (the card's last section). better-auth 1.7.12's POST /admin/update-user refuses data.password on every deployment (dist/plugins/admin/routes.mjs, PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER, 400) before any write. No fix needed; a pin in cloud-managed.test.ts holds it on a managed runtime (400 with that code, the member's hash unchanged, the identity-provider user still without a credential), so a vendor upgrade that starts accepting the key reds here.

Self-hosted deployments, and managed ones that declared email and password on, are unchanged (two CONTROL cases).

Read first (by risk):

  1. packages/plugins/plugin-auth/src/auth-plugin.ts, the email_password_enabled branch of bindAuthSettings: the skip condition (enabled && source !== 'env' && emailPasswordHeldOffByHost(...)) and the once-only error.
  2. packages/plugins/plugin-auth/src/sign-in-method-floor.ts, the new first branch of signInMethodFloorPredicate: it returns before the floor for every save of that key on such a runtime.
  3. packages/plugins/plugin-auth/src/sign-in-method-floor.test.ts, the new last describe.

Tests

  • New describe in sign-in-method-floor.test.ts (real AuthPlugin, real SettingsService with the shipped auth manifest, real settings PUT route), eight cases: a stored value that reads on is not applied and is said once; a row stored before boot is not applied; turning it on is refused at the save door (envelope 400 + SETTINGS_VALIDATION, field invalid_value, the zh-CN sentence, nothing in the batch written); clearing a row stored on passes; the env declaration still applies; { email_password_enabled: true, google_enabled: false } with Google the last way in is refused at google_enabled; CONTROL self-hosted; CONTROL managed with email and password declared on.
  • New case in cloud-managed.test.ts: admin update-user with data.password on a managed runtime.
Premise, measured on main 4af32b9 before any edit

A probe test (deleted afterwards) booted AuthPlugin with emailAndPassword: { enabled: false } under OS_CLOUD_MANAGED=1 over a real SettingsService:

BEFORE false {"value":true,"source":"default",...}
SAVE-TRUE err undefined {"value":true,"source":"global",...}
AFTER-TRUE true
SAVE-FALSE err SETTINGS_VALIDATION
AFTER-FALSE true

So getPublicConfig().emailPassword.enabled went false → true on a save of true, which no predicate was asked about, and turning it back off was then refused by the sign-in floor.

Ablation (each leg through scripts/ablation-replace.mjs, restored to HEAD, git diff HEAD empty)
  • Settings pass skip removed (if (!emailPasswordHeldOff) → if (true)): 2 failed / 5 passed of the new describe (the two "not applied" cases).
  • Save-door branch removed (if (key === 'email_password_enabled' && emailPasswordHeldOffByHost(deps)) → if (false)): 2 failed / 5 passed (the refusal case, and the clear case, which the floor then refuses).
  • S1 condition removed (localOffered && !emailPasswordHeldOffByHost(deps) → localOffered && true): 1 failed / 7 passed (the Google case).

Verification

Local runs at the final head

All at final head 5dd302a3.

  • pnpm --filter @objectstack/plugin-auth typecheck: passed (tsc --noEmit, the examples project, check:test-typecheck OK).
  • pnpm --filter @objectstack/plugin-auth test: Test Files 295 passed (295), Tests 6298 passed, 10 skipped (6308).
  • Dogfood battery (pnpm --filter @objectstack/dogfood test after building its dependency closure, under the verify lock): Test Files 490 passed, 3 skipped (493); Tests 4144 passed, 68 skipped (4212); lock verdict command-exit 0.
  • Derived gate families (node scripts/pm/dispatch-gates.mjs --commands, 110 with the docs paths): --ran reconciliation 110 derived, 107 run with exit 0, 3 NOT MEASURED (exit 3, prerequisite): node scripts/check-plugin-teardown-shape.mjs --self-test (checker-health only; its pinned fixture needs an unshallowed clone), pnpm check:dual-build-cjs-loads and pnpm --filter @objectstack/spec run check:skill-examples (each reads built output for packages outside the closure built here). check:dts-closure and check:type-check-debt first read a tree mid-rebuild / waited on this run's own lock, and re-ran green. Families CI runs are read from this PR's check-runs, not re-run here.

Two-minute check: pnpm --filter @objectstack/plugin-auth exec vitest run --maxWorkers=2 src/sign-in-method-floor.test.ts -t 'cloud-managed runtime keeps' shows 8 passed.

Acceptance notes

  • With nothing stored, the settings page reads auth.email_password_enabled as the manifest default (true, source: default) on any deployment that declared email and password off, self-hosted included, while the runtime runs it off. On a managed runtime a re-save of that default is stored and not applied (said at error). It is not changed here.
  • The display gap above is filed by the seat as Setup › Authentication shows "email and password" on when the deployment declared it off #38029.

Generated by Claude Code

…f when its deployment declares it off

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK
…untime; changeset

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 27, 2026
@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/plugin-auth, touching 15 documentable anchor(s).

11 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/deployment/cli.mdx (via AuthPlugin (symbol, a top-level class))
  • content/docs/deployment/self-hosting.mdx (via AuthPlugin (symbol, a top-level class))
  • content/docs/deployment/tenancy-modes.mdx (via AuthPlugin (symbol, a top-level class))
  • content/docs/kernel/services-checklist.mdx (via AuthPlugin (symbol, a top-level class))
  • content/docs/permissions/authentication.mdx (via AuthPlugin (symbol, a top-level class))
  • content/docs/permissions/record-view-auditing.mdx (via AuthPlugin (symbol, a top-level class))
  • content/docs/permissions/sso.mdx (via AuthPlugin (symbol, a top-level class))
  • content/docs/plugins/index.mdx (via AuthPlugin (symbol, a top-level class))
  • content/docs/plugins/packages.mdx (via AuthPlugin (symbol, a top-level class))
  • content/docs/protocol/objectui/actions.mdx (via cloudManaged (symbol, a method of interface SignInMethodFloorDeps), cloudManaged (literal, a string literal in emailPasswordHeldOffByHost))
  • content/docs/upgrading.mdx (via AuthPlugin (symbol, a top-level class))

⛔ 6 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-3.mdx (via AuthPlugin (symbol, a top-level class))
  • content/docs/releases/v17/17-5.mdx (via AuthPlugin (symbol, a top-level class))
  • content/docs/releases/v17/17-6.mdx (via AuthPlugin (symbol, a top-level class))
  • content/docs/releases/v18/18-0.mdx (via AuthPlugin (symbol, a top-level class))
  • content/docs/releases/v18/18-1.mdx (via AuthPlugin (symbol, a top-level class))
  • content/docs/releases/v18/18-2.mdx (via AuthPlugin (symbol, a top-level class))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 21 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json b4921982a0fd09f763d61adf4d4315698ef493ad → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 415782fc25b040d42da7fec6651650ae450ab98d — the merge of head 5dd302a33d1a9cc64c206f477814013f09852119 into base b4921982a0fd09f763d61adf4d4315698ef493ad, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 415782fc25b040d42da7fec6651650ae450ab98d && git checkout 415782fc25b040d42da7fec6651650ae450ab98d
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin b4921982a0fd09f763d61adf4d4315698ef493ad 5dd302a33d1a9cc64c206f477814013f09852119 && git checkout -B drift-repro b4921982a0fd09f763d61adf4d4315698ef493ad && git merge --no-ff 5dd302a33d1a9cc64c206f477814013f09852119

node scripts/docs-audit/affected-docs.mjs --json b4921982a0fd09f763d61adf4d4315698ef493ad

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs b4921982a0fd09f763d61adf4d4315698ef493ad → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: db39eb311eb288d7e0eccb1ae74751c232a9accf
Local-runs: none
Scope: packages/plugins/plugin-auth/src/sign-in-method-floor.ts, packages/plugins/plugin-auth/src/auth-plugin.ts, packages/plugins/plugin-auth/src/sign-in-method-floor.test.ts, packages/plugins/plugin-auth/src/cloud-managed.test.ts + read, not reviewed: .changeset/managed-email-password-held-off.md
Security-touching: yes
Rule-change-verified: none
Regen-provenance: none

First round on this PR. Inputs: card #34174, triage 7211578688, claim 7222972851, dev report 7224276022 (its conclusions not adopted), the PR body's declaration lines, git diff origin/main...db39eb31 (merge base 4af32b99), AGENTS.md Post-Task step 3, execution-duties.md lines 104 to 110, the stock changesets and packages/plugins/plugin-auth/CHANGELOG.md, and the check-runs on this head. Nothing was built or run. The PR as declared (Clause-②: no, no schema or governed path) touches none of the four contract faces; this record exists because the declaration itself is the question, and finding M1 puts the PR on the narrowing face.

① Derived judgments

  • What the diff changes at a published door (PUT /api/settings/auth, SettingsService.setMany('auth', …)), on a cloud-managed runtime whose deployment declared emailAndPassword.enabled: false:
    • narrowed: a save that changes email_password_enabled to a value that reads on answers 400 SETTINGS_VALIDATION and writes nothing in the batch, where it was stored;
    • widened: a save that turns the key off or clears it is accepted where the sign-in floor refused it with constraint.lastSignInMethod: email_password (the PR body's own measurement on main: SAVE-FALSE err SETTINGS_VALIDATION; its ablation: with the new branch removed, the clear case is refused);
    • widened, response: the field error at that key can now carry constraint: { cloudManaged: true, declaredEmailPassword: false } and the new sentence managedEmailPassword;
    • applied state: a stored value that reads on no longer reaches getPublicConfig().emailPassword.enabled there.
  • Clause-②: no: WRONG. The line this diff owes is Clause-②: yes (narrowing).
    • The arm. AGENTS.md Post-Task step 3 gives the arm no carve-out for a refusal that depends on host state, and execution-duties.md line 107 names "narrowing a published accept set" as the case. The auth settings save is treated as a published accept set by every earlier change to this same predicate: the floor's introduction (yes (narrowing), "a save an administrator could make before is now refused at the settings save door with the existing SETTINGS_VALIDATION / invalid_value field error"), the refused clear, and 3372da0 (yes (narrowing), the googleLocalOff refusal). All three carry a BREAKING banner and an ADR-0087 marker.
    • A refusal conditioned on what the deployment mounts or declares is declared the same way in stock: .changeset/pre/33933-knowledge-settings-with-service.md ("on a deployment that does not mount …") and .changeset/pre/37678-knowledge-turso-settings-group.md, both no (narrowing), Metadata-protocol: none, patch.
    • The value. 3372da0 declared yes for the exact parallel of this diff's widened half: "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", plus a new copy key in all eleven locales. execution-duties.md line 109: removing a deliberate guard's refusal is yes unless the no cites the published text that already denies the refusal; this no cites none.
    • The sibling managed-door changesets the dev report rests on do not bear on this. 35220, 34889 (no) and 34651, 34171 (yes (widening)) add an action, reword copy or add a response key; none refuses a request that was accepted.
    • The negative boundary (execution-duties.md line 105, a runtime security change is not clause ②) speaks to the yes | no value, not to the arm: 35184-dev-seed-retire-at-boot and both password-reset-* changesets are security behaviour changes and carry (narrowing).
    • The claim's Clause-②: no was a prediction made before the diff existed; landing-operations.md line 5 makes the diff the fact.
  • Metadata-protocol: none: RIGHT. No authorable metadata key, value or type changes; a settings value is runtime state, the reading 33933 records in its ADR-0087 marker.

② Semver level

③ Boundary flags

  • Author: objectstack-fleet[bot]. No note owed.
  • Security-touching: yes: the diff decides whether a sign-in method is advertised and lets one save past the last-sign-in-method guard.
    • The apply-side skip is safe. The condition is enabled && source !== 'env' && cloudManaged && declared off; it only ever withholds an enabled: true patch, so it cannot turn a method off or admit anyone. An OS_AUTH_EMAIL_PASSWORD_ENABLED value still applies as the deployment's own declaration. The other emailAndPassword keys in the pass are untouched.
    • It is logged: once at error with the remedy, re-armed when the condition clears. The same level the pass uses for a membership_policy it ignores.
    • The floor bypass for off and clear is safe on this runtime: the running value is off before and after the save, so the save removes no way in.
  • Envelope: matches the write-predicate convention. The predicate returns SettingsWriteRefusal (message, constraint); refuseByWritePredicates wraps it as invalid_value at the key and throws SettingsValidationError for the whole batch before any row is written. No new error code, so ERROR_CODE_LEDGER is not touched.
  • Admin update-user: the pin asserts 400 and PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER for a member and for an identity-provider user on a managed runtime, the member's hash unchanged and no credential created. That is the right shape for a vendor behaviour the card asked to be checked; no code change is owed.
  • SQL push-down: the diff adds no query. Nothing to report.
  • Main: merge base is 4af32b99; PR mergeable_state reads blocked, not dirty.
  • Check-runs on this head, read at 2026-11-27T17:22:40Z: 50 runs, 14 success, 16 skipped, 20 in progress, none failed.
    • Success so far: Check Changeset, PR-body guards, Governed Surface Queue Guard, Dogfood Regression Gate, Lint · ESLint, Lint · PM dispatch-gates, Lint · scoped · tooling self-tests, Type Check · debt ledger, Test UI, Check PR Size, Plan Test Core shards, Auto Label, Flag docs affected, filter.
    • Not yet answered: Build Core, Test Core 1 to 10, Live E2E UI, Type Check (workspace, source gates, consumer gates), four Lint families.
    • "All green" is not established on this head. No auto-merge is armed.

④ Design judgment

Owed on the narrowing face (M1); judged over the whole diff outside the changeset.

  • Both halves are needed, and the split is the right one. The settings service asks a predicate only about a change from the resolved value (refuseByWritePredicates: stableStringify(next) === stableStringify(current) skips), and with nothing stored the key resolves to the manifest default true. So a save door alone cannot stop a re-save of the default or reach a row stored earlier; the apply-side skip is the guarantee and the door is the loud answer. This meets the card's Expected in both of its offered forms.
  • No tolerant fallback is added: the deployment's declaration is the authority and the stored value is refused or left unapplied, not reinterpreted.
  • Off and clear pass: verified in the predicate (readToggle(next, false): false, 'false', 0, null all return before the floor) and pinned by two cases.
  • CONTROLs: self-hosted with the same declaration still applies the stored toggle and the floor still refuses turning it off; managed with email and password declared on is judged by the floor as before. emailPasswordHeldOffByHost requires both cloudManaged() === true and declaredEmailPasswordEnabled() === false, and an absent dep reads as not managed, so no other caller's behaviour moves.
  • Locale strings: managedEmailPassword is present in all eleven tables (en, zh-CN, ja-JP, es-ES, zh-Hant, ar, fr, pt-BR, ru, de, ko), and Record<SettingsCopyLocale, SignInFloorCopy> makes a missing one a type error. Each says the same four things: managed, declared off, cannot be turned on here, nothing saved.

M1 (must-fix): the declaration line is wrong in the PR body and the changeset.

  • Both read Clause-②: no. The diff refuses a save that was accepted and accepts a save that was refused, at a published door (①).
  • Owed: Clause-②: yes (narrowing) with the narrowed and widened halves named, in the PR body and the changeset body; the BREAKING banner and one ADR-0087 marker in the changeset; a Skills-docs: line in the PR body; the full dogfood battery pinned to the final head in the dev report (os-dev.md line 219); the seat's note against claim 7222972851, whose line reads Clause-②: no. Whether the title takes ! follows the repo's own rule for a BREAKING changeset; the three precedents on this door carry it.
  • No code change is asked for by M1.

S1 (should-fix): the Google leg of the floor trusts a batch value the runtime will not apply.

  • signInMethodFloorPredicate, emailPasswordAfter: when the batch carries email_password_enabled, the value is read from the batch. On a held-off runtime a batch of { email_password_enabled: true, google_enabled: false } where true is no change (the manifest default, or a row already stored on) asks no predicate at the email key, and at the Google key reads email and password as on after the save, so the floor passes. The runtime keeps email and password off, so the save can remove the last way in the page offers.
  • Reach is narrow: it needs no identity provider row and no host sign-in handoff, and a managed runtime normally has one. The fix is one condition: emailPasswordAfter is false when emailPasswordHeldOffByHost(deps). A case beside the new describe pins it.

Nits, none with an effect on correctness or the contract:

  • N1. The door reads an unreadable next as off (readToggle(next, false)) and the settings pass reads an unreadable stored value as on (asBoolean(value, true)). The toggle's declared type refuses such a value before any predicate runs, so nothing reaches the gap.
  • N2. A false row saved here without the floor's judgment would apply if the deployment were later redeployed with email and password declared on. On a managed runtime the host refuses every password door either way.
  • N3. content/docs/permissions/sso.mdx (line 833) and self-hosting.mdx (line 805) state the floor's refusal without the managed case. Goes with the Skills-docs: line M1 owes.
  • N4. The display gap the dev report files as out of scope (the settings page shows the default true while the runtime runs off) is real and is the reason a re-save of the default is reachable from the console. A card, not a condition here.

Must-fix: M1. Should-fix: S1.

Implemented-by: claude/issue-34174-managed-password-toggle
Reviewed-by: session_01Q4EjjQkY5yXZrN9BEA3rEK

VERDICT: FAIL

…assword as a way in; docs state the managed case

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK
…banner and ADR-0087 disposition

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK
@objectstack-fleet objectstack-fleet Bot changed the title fix(plugin-auth): a cloud-managed runtime keeps email and password off when its deployment declares it off fix(plugin-auth)!: a cloud-managed runtime keeps email and password off when its deployment declares it off Nov 27, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 5dd302a33d1a9cc64c206f477814013f09852119
Local-runs: none
Scope: packages/plugins/plugin-auth/src/sign-in-method-floor.ts, packages/plugins/plugin-auth/src/auth-plugin.ts, packages/plugins/plugin-auth/src/sign-in-method-floor.test.ts, packages/plugins/plugin-auth/src/cloud-managed.test.ts + read, not reviewed: .changeset/managed-email-password-held-off.md, content/docs/deployment/self-hosting.mdx, content/docs/permissions/sso.mdx
Security-touching: yes
Rule-change-verified: none
Regen-provenance: none

Delta round by the reviewer of record 7224378765 (FAIL at db39eb31, M1 and S1 open). Inputs: git diff db39eb31 5dd302a3 (two commits, five files), the PR's current title and body, dev report 7225675485 (its conclusions not adopted), the seat's claim note 7224397824, and the check-runs on this head. Nothing was built or run. auth-plugin.ts and cloud-managed.test.ts are byte-identical to the head the first record reviewed; its judgments on them carry unchanged.

① Derived judgments

  • The delta:
    • sign-in-method-floor.ts: one condition. emailPasswordAfter is false when emailPasswordHeldOffByHost(deps).
    • sign-in-method-floor.test.ts: one new case, and the describe's SettingsService takes the file's existing ConfidentialTestAdapter so the Google secret can be stored.
    • The changeset: the declaration line, a Skills-docs: line, one ADR-0087 marker, the BREAKING banner, a What-to-do line, ! in the summary.
    • Two docs pages gain a paragraph each on the managed case.
  • Clause-②: yes (narrowing): RIGHT. The changeset and the PR body both name the narrowed half (the refused save, the stored value not applied, the Google leg) and the widened half (off and clear accepted without the floor, the new constraint shape, the managedEmailPassword key in 11 locales). The two texts agree.
  • Metadata-protocol: none: RIGHT, unchanged.
  • The S1 change adds one more narrowed case, and the declaration names it: on a held-off runtime a Google removal is now refused where the batch also carried an unchanged email_password_enabled: true.

② Semver level

  • @objectstack/plugin-auth patch: right. The kind is none, and a non-protocol narrowing ships patch with its banner and disposition.
  • The changeset now carries the BREAKING banner, exactly one marker (not-required (no-migration-prescription), open to it because the kind is none), and both declaration lines. Check Changeset is success on this head (both runs).
  • The marker's justification is accurate: no schema key, accepted value or metadata type moves, and stored rows are left in place.
  • The PR title carries !, as the three earlier changes on this door do.

③ Boundary flags

  • Author: objectstack-fleet[bot]. No note owed.
  • The seat's note against claim 7222972851 is on the card (7224397824). The bookkeeping M1 asked for is done.
  • Security-touching: yes, as before. The delta tightens the floor: it can only add a refusal at a google_* key on a held-off runtime, and cannot admit a save the floor refused.
  • The dev report pins the dogfood battery to this head: 490 files passed, 3 skipped; 4144 tests passed, 68 skipped; no failures. Read from the report, not re-run here.
  • SQL push-down: the delta adds no query. Nothing to report.
  • Main: the head merges without conflict (merge-tree, no checkout). Merge base 4af32b99.
  • Check-runs on this head, read at 2026-11-27T18:38:46Z: 59 runs, 42 success, 17 skipped, none failed, none in progress. All green is established on this head. No auto-merge is armed.

④ Design judgment

Findings of the first record, at this head:

M1 (must-fix): closed.

  • Declaration, banner, marker, Skills-docs: line, title, battery and claim note are all in place (①, ②, ③).

S1 (should-fix): closed.

  • The condition sits where the first record placed it. The email_password_enabled key itself still returns before it on a held-off runtime, so the off and clear path is unchanged; off a held-off runtime the helper is false and the expression reads as before, so both CONTROLs are unaffected.
  • The new case is the scenario the finding named: Google in force as the last way in, then { email_password_enabled: true, google_enabled: false } with true as no change. It asserts the refusal at google_enabled with lastSignInMethod: google, that Google stays stored on, and that email and password stays off.

Nits, none with an effect on correctness or the contract:

  • N1 (open, accepted). The door and the settings pass read an unreadable value with opposite fallbacks; type validation runs first.
  • N2 (open, accepted). A false row saved here without the floor would apply after a redeploy that declares email and password on.
  • N3: closed. self-hosting.mdx and sso.mdx state the managed case, and the text matches the code: refused on, stored on not applied, off and clear accepted, the env declaration still applies, the Google leg.
  • N4 (open, a card). The settings page shows the default true on a declared-off deployment: Setup › Authentication shows "email and password" on when the deployment declared it off #38029.

No must-fix, no should-fix.

Implemented-by: claude/issue-34174-managed-password-toggle
Reviewed-by: session_01Q4EjjQkY5yXZrN9BEA3rEK

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

维护者速读

  • 托管环境(部署声明不提供邮箱密码登录)里,管理员在设置页把「邮箱/密码登录」打开会被拒绝并给出本地化说明;已存的打开值也不再生效,登录页不会再画出注定 409 的密码表单。
  • 同时,在这种环境里关掉或清空这个开关不再被「至少保留一种登录方式」拦住,因为密码登录本来就不可用。
  • 自建部署、以及声明提供密码登录的托管环境不变。文档两处已补充托管情况。
  • 要你做什么:用 os-zhuang 批准本 PR(收窄类改动需授权批准)。契约审核 PASS 记录 7225728561,Head-sha 5dd302a33d1a9cc64c206f477814013f09852119。

席位意见:首轮契约审核 FAIL(声明应为收窄 + 一处判定漏洞),返工后全部关闭;CI 全绿;新发现的设置页显示问题已立卡 #38029。建议批准。

席位核对 — ACCEPT · repo:objectstack#6 · head 5dd302a33d1a9cc64c206f477814013f09852119

  • Shape: draft → main, Fixes #34174, title carries !.
  • Premise measured on main 4af32b99 (dev report 7224276022): a stored email_password_enabled = true flipped getPublicConfig().emailPassword.enabled to true on a managed, declared-off runtime; the save asked no predicate.
  • Declaration change against claim 7222972851: noted at 7224397824; the PR declares Clause-②: yes (narrowing), Metadata-protocol: none, patch, BREAKING banner, ADR-0087 not-required (no-migration-prescription), Skills-docs: none.
  • Review history: contract review FAIL 7224378765 (M1, S1) → rework → PASS 7225728561, no must-fix or should-fix open.
  • Admin update-user: better-auth refuses data.password on every deployment; pinned on a managed runtime, no code change.
  • Gates: check-runs at head 42 success, 17 skipped, 0 failed (reviewer read 18:38Z); dogfood battery at this head 490 files / 4144 tests passed (dev report 7225675485).
  • Follow-ups: Setup › Authentication shows "email and password" on when the deployment declared it off #38029 (settings page shows the default on a declared-off deployment). N1, N2 left as nits.
  • Landing: narrowing — handoff to os-zhuang.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

Review requested: this narrowing PR (Clause-②: yes (narrowing)) lands by an authorized APPROVED review or an enqueue by an approver.

Records at head 5dd302a33d1a9cc64c206f477814013f09852119:

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 27, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A stored auth.email_password_enabled re-advertises email and password on a cloud-managed runtime that declared it off

2 participants