Skip to content

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

Description

@objectstack-fleet

repo:cloud#2 · os-warren · session_01JQwxbWTyRFQwYN1hZXbCHL

Filing gate: ① a product defect, read from code at the pin and confirmed by the contract review of cloud PR #4589 (card cloud#4535), which judged it acceptable as a follow-up. The cloud half (hosted builds with emailAndPassword.enabled: false, and the relay refuses every password door) is PR #4589. Reader: the domain:server lane (plugin-auth).

维护者速读

cloud#4535 让托管环境以 emailAndPassword.enabled: false 构建,/auth/config 因此不再宣称密码登录。但框架的设置层会把已存储的 auth.email_password_enabled 覆盖到声明之上:托管环境的管理员在 Setup → 设置 → 认证 里把「启用邮箱/密码登录」打开并保存,/auth/config 就重新宣称 emailPassword.enabled: true,登录页重新画出表单,而 cloud 的中继仍对每次提交回 409。托管(isCloudManaged())环境上这个开关应当不可重新打开(保存时拒绝,或者设置层对托管环境不应用该键)。

Facts (objectstack at b914e72; read from code, not measured on a running stack)

  • plugin-auth/src/auth-plugin.ts ~L2518 (bindAuthSettings): an explicit
    email_password_enabled is applied with applyConfigPatch({ emailAndPassword: { enabled } }),
    over the deployment's declaration.
  • getPublicConfig() (auth-manager.ts ~L5796) answers emailPassword.enabled from that patched
    config.
  • sign-in-method-floor.ts refuses only turning the toggle OFF with nothing else in force;
    turning it ON is never refused.
  • On a managed runtime the password doors are refused by the host (cloud relay, cloud#4468 /
    cloud#4535), so a re-advertised form leads only to 409s.

Expected

On a cloud-managed runtime (isCloudManaged()), email and password stay off once the host
declares them off: the settings save of auth.email_password_enabled = true is refused (write
predicate, same door as the sign-in floor) or the key is not applied there, and /auth/config
keeps answering false. Self-hosted deployments keep the toggle as today.

Seam: spec:auth.email_password_enabled (setting) → runtime:bindAuthSettings / getPublicConfig().emailPassword.enabled
Dedupe words: managed email_password_enabled setting override, cloud-managed re-enable password login, emailAndPassword declared off settings

Also check on the same door (review nit)

POST admin/update-user: whether better-auth (the version at the pin) accepts data.password there was not readable in the review tree. If it does, the hash admits nobody on hosted (the relay refuses every password sign-in). It still belongs with this card: a managed runtime should not take a local password through any admin door.

Activity

  1. added
    bug
    pm:queue
    domain:server
    on Nov 15, 2026
  2. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in area:cloud · domain:server · Bug · p2 · pm:queue · size S; rationale: on a cloud-managed runtime, a stored auth.email_password_enabled re-advertises password sign-in, so the login page draws a form whose every submit fails with 409. End users see a sign-in path that cannot work. That is a user-facing defect, raised p3 → p2 to match its sibling #34171 (same login surface, p2). Audit restatement, tier 3. Recorded 2026-11-27T06:29Z.

  3. added
    priority:p2
    and removed on Nov 27, 2026
  4. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

    Picked by card-pick.mjs --order area:cloud --seat repo:objectstack#6 at 16:10Z: rank 3, order 1 (ranks 1–2 skipped: #37831 released 7213628657 pending a live repro; #37868 is area:fleet, outside this seat's intake). The maintainer in this seat's project, verbatim: 「继续处理 area:cloud p1 p2」.

    Claim: PM loop round 8
    Session: session_01Q4EjjQkY5yXZrN9BEA3rEK
    Account: hotlong
    Branch: claude/issue-34174-managed-password-toggle
    Worktree: objectstack-issue-34174
    Domain: domain:server
    Seat: repo:objectstack#6
    File surface: packages/plugins/plugin-auth/src/ (auth-plugin.ts bindAuthSettings, sign-in-method-floor.ts or the settings write predicate, and the admin update-user door if it takes a password), their tests, one changeset
    Container & model: S, mode:subagent, model: default, effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: n/a — auth settings write predicate on cloud-managed runtimes
    Thread-read: 7211578688
    Premise: unverified — read from code at an old pin; the dev re-reads on main that a stored auth.email_password_enabled = true overrides a managed runtime's declared false in /auth/config, and pins it in a test before fixing. If main already refuses or ignores it, the dev reports premise not reproduced.
    Serial constraints cleared: no open PR touches packages/plugins/plugin-auth (files of #37948 and #37924 read, 16:12Z).
    Scope this dispatch: the whole card, including the admin update-user check. Fixes #34174.

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 27, 2026
  6. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK
    os-dev-report

    {
      "issue": 34174,
      "status": "done",
      "branch": "claude/issue-34174-managed-password-toggle",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/38028",
      "session": "session_01Q4EjjQkY5yXZrN9BEA3rEK",
      "premise_still_valid": true,
      "summary": "Premise reproduced on main 4af32b99: under OS_CLOUD_MANAGED=1 with emailAndPassword.enabled false declared, setMany({email_password_enabled:true}) was stored (source global) with no predicate asked (the key resolves to the manifest default true, so the save is 'no change') and getPublicConfig().emailPassword.enabled went false -> true; turning it back off was then refused by the sign-in floor. Fix in plugin-auth, both halves: (1) bindAuthSettings does not apply a stored (non-env) email_password_enabled that reads on when the runtime is cloud-managed and the deployment declared it off, said once at error with the remedy; (2) the email_password_enabled write predicate (the sign-in floor's door) refuses a save that turns it on there with 400 SETTINGS_VALIDATION / invalid_value and a new localized managedEmailPassword sentence in all 11 settings locales, and lets off/clear through without the floor. The apply-side half is the guarantee because the save door is never asked about a re-save of the default and cannot reach rows stored earlier. Self-hosted and managed-declared-on unchanged (CONTROL cases). Admin update-user: better-auth 1.7.12 refuses data.password on every deployment (PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER, 400, routes.mjs line 259) before any write; pinned in cloud-managed.test.ts on a managed runtime, no code change needed.",
      "tests": "At cf1c7b32: pnpm --filter @objectstack/plugin-auth typecheck passed (tsc --noEmit, examples project, check:test-typecheck OK); pnpm --filter @objectstack/plugin-auth test: Test Files 295 passed (295), Tests 6297 passed | 10 skipped (6307), lock VERDICT command-exit 0. At final head db39eb31 (adds one module-top import to the test file): vitest run src/sign-in-method-floor.test.ts src/cloud-managed.test.ts: Test Files 2 passed, Tests 121 passed, VERDICT command-exit 0. Ablation (tests import src, no dist leg; scripts/ablation-replace.mjs, each restored blob == HEAD, git diff HEAD empty): apply-side skip removed -> 2 failed | 5 passed of the new describe (both 'not applied' cases); save-door branch removed -> 2 failed | 5 passed (refusal case and clear case).",
      "gates": "Local: node scripts/pm/dispatch-gates.mjs --commands derived 77 at db39eb31; ran all; --ran with recorded exit codes: 77 derived, 75 run, 2 NOT-MEASURED, 0 UNRUN. NOT MEASURED (exit 3 prerequisite): node scripts/check-plugin-teardown-shape.mjs --self-test (checker-health; pinned fixture unreachable on a shallow clone), pnpm check:dual-build-cjs-loads (reads every package dist, not built here). pnpm check:test-source-alias went red (exit 1) on the edited test file, fixed in db39eb31 with the prescribed module-top import, re-ran exit 0. Also at db39eb31: check:nul-bytes 0, check:cross-package-test-inputs 0, check-empty-changeset 0, check-adr-0087-registration 0, check:doc-authoring 0. The 75 others ran at cf1c7b32 (the last commit only adds that test import). CI at report time (head db39eb31, single read): Check Changeset, Check PR Size, Governed Surface Queue Guard, Lint (ESLint, PM dispatch-gates, docs & code guards, repo & tooling, CI/release/engine, scoped x3), PR-body guards, Type Check (consumer, debt ledger, source, workspace): in_progress; opt-in/queue rows skipped. test:repo not run locally (diff touches no repo-project test).",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm (claim's Clause-②: no copied)",
      "mcp_calls": "0",
      "api_writes": "2 — fleet-write relay pr_create (POST /repos/objectstack-ai/objectstack/pulls + POST /issues/38028/assignees); this os-dev-report comment via post-stamped.mjs (POST /issues/34174/comments). git push is not counted.",
      "open_questions": [
        {
          "question": "The dispatch suggested declaring the refused save as a narrowing (Clause-② narrowing arm, dogfood battery); the binding claim says Clause-②: no and Metadata-protocol: none, and os-dev rules say copy the claim's lines verbatim. Which stands?",
          "options": [
            "A keep the claim's lines: a runtime-state refusal of a settings value on managed runtimes only, not a change to an authorable metadata key or public schema; matches the sibling managed-door changesets",
            "B re-declare no (narrowing) / narrowed and run the dogfood battery"
          ],
          "recommendation": "A, because the accept-set change is a host-state refusal of one settings value on managed runtimes, the metadata protocol is untouched, and the claim is binding; PR and changeset carry the claim's lines."
        }
      ],
      "security_findings": "none",
      "out_of_scope_findings": [
        "class: a · reach: measured at SettingsService.get (the reader the settings GET route serves; the HTTP route itself not exercised): on a deployment that declared emailAndPassword.enabled false with nothing stored, auth.email_password_enabled answers value true source default while getPublicConfig().emailPassword.enabled answers false, so Setup -> Settings -> Authentication shows the toggle on for a sign-in method that is off (self-hosted too) · evidence: probe on main 4af32b99 printed BEFORE false {value:true,source:default}; plugin-auth registers no live-status provider for the auth namespace · Seam: spec:auth.email_password_enabled (setting default) -> renderer: settings page toggle · dedupe words: email_password_enabled default shown on declared off, auth settings toggle misstates running value, settings live value emailAndPassword declaration"
      ]
    }
  7. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

    Claim note: declaration change against claim 7222972851. The claim said Clause-②: no; contract review 7224378765 (M1) judged the diff owes Clause-②: yes (narrowing) — a save that main stored is now refused on a managed, declared-off runtime, and turning the key off or clearing it now passes without the floor. Metadata-protocol: none unchanged. The PR is reworked to that line with the BREAKING banner, ADR-0087 marker, Skills-docs: line and the dogfood battery; landing then needs an authorized approval (narrowing).

  8. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK
    os-dev-report

    {
      "issue": 34174,
      "status": "done",
      "branch": "claude/issue-34174-managed-password-toggle",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/38028",
      "session": "session_01Q4EjjQkY5yXZrN9BEA3rEK",
      "premise_still_valid": true,
      "summary": "Rework round on contract review 7224378765 (FAIL), new head 5dd302a3. M1: the changeset and the PR body now declare Clause-②: yes (narrowing). The narrowed half: on a managed, declared-off runtime a save that turns email_password_enabled on is refused, a stored on value is not applied, and a Google change no longer counts email and password as a way in. The widened half: off and clear now pass without the floor, plus the new constraint shape and the managedEmailPassword copy key. Metadata-protocol stays none and the level stays patch. The changeset gains a Skills-docs line, the BREAKING banner, a What-to-do line and one ADR-0087 marker, not-required (no-migration-prescription); check-adr-0087-registration reads it as BREAKING+bang+clause-②-narrowing. The PR body gains Skills-docs: none, and N3 is fixed in this PR: content/docs/deployment/self-hosting.mdx and content/docs/permissions/sso.mdx now state the cloud-managed case. The PR title gains `!` (the three precedents on this door carry it). The title and body went through relay issue_patch; the relay requires a signature, so the body now ends with the signature trailer line. S1: in signInMethodFloorPredicate, emailPasswordAfter reads false when emailPasswordHeldOffByHost(deps), and a new case pins { email_password_enabled: true, google_enabled: false } with Google as the last way in being refused at google_enabled. N1 and N2 are left as they are; N4 is #38029.",
      "tests": "All at head 5dd302a3. pnpm --filter @objectstack/plugin-auth typecheck passed. pnpm --filter @objectstack/plugin-auth test: Test Files 295 passed (295), Tests 6298 passed | 10 skipped (6308), VERDICT command-exit 0. S1 ablation via scripts/ablation-replace.mjs, restored to blob == HEAD with git diff HEAD empty: localOffered && !emailPasswordHeldOffByHost(deps) -> localOffered && true gives 1 failed | 7 passed (the new Google case). The first attempt was refused as a no-op by the tool and re-run with a unique marker, which an inline sed then turned into `true` so the file compiled. The earlier two ablation legs (round 1) still stand.",
      "gates": "Local at 5dd302a3: dispatch-gates derived 110 (the docs paths added families); --ran with exit codes: 107 run with exit 0, 3 NOT MEASURED (exit 3, prerequisite). The three: check-plugin-teardown-shape --self-test (needs an unshallowed clone), check:dual-build-cjs-loads and spec check:skill-examples (both need built output outside the closure built here). check:dts-closure (read a tree mid-rebuild) and check:type-check-debt (queue-timeout on this run's own dogfood lock) both re-ran exit 0. check-adr-0087-registration exit 0, recognises the narrowing changeset and the exemption. CI on 5dd302a3, one read: 40 success, 17 skipped, 2 in_progress, 0 failure.",
      "dogfood_battery": "5dd302a3 · os-verify-lock: VERDICT command-exit 0 (held 43m05s) · Test Files 490 passed | 3 skipped (493) · Tests 4144 passed | 68 skipped (4212) · no failures. The first attempt failed in the closure build because `--concurrency=2` passed through to each package's build script; it was re-run with --workspace-concurrency=2.",
      "mcp_calls": "0",
      "api_writes": "2 this round — relay issue_patch PATCH /repos/objectstack-ai/objectstack/issues/38028 (title + body, read-back identical; the first send was refused locally by the validator, nothing sent); this os-dev-report comment POST /repos/objectstack-ai/objectstack/issues/34174/comments. git push is not counted.",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: #38029 · the settings page shows the email_password_enabled default true on a declared-off deployment (seat filed it)"
      ]
    }
  9. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

    Landed by #38028. Follow-up: #38029.

  10. removed
    pm:dispatched
    on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:cloudbugdomain:serverpriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions