Skip to content

fix(plugin-auth): Setup > Authentication says when email and password sign-in runs other than its switch shows - #38094

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-38029-auth-setting-live-value
Nov 28, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-38029-auth-setting-live-value

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #38029

Clause-②: no
Metadata-protocol: none

维护者速读

  • 自建或托管环境的管理员打开 设置 → 认证 时,若部署本身关闭了邮箱/密码登录而这里没保存任何值,页面顶部会出现一条提示,说明该登录方式实际是关闭的;开关与实际一致时页面不变。
  • 属于登录与认证设置的可信度工作,替管理员解决「开关显示开、实际却关」的误导。
  • 出错时最坏是提示不出现或读取失败提示,开关和保存行为都不受影响;可直接撤回本改动。
  • 无

What changes

With nothing stored, auth.email_password_enabled resolves to the manifest default (true, source: 'default'), while the running auth config takes the deployment's own emailAndPassword.enabled: the settings pass applies only stored or OS_* values, and the manifest default never rules (auth-settings-declared.ts). So a deployment that declares email and password off showed the switch on for a sign-in method that is off.

plugin-auth now registers a live-status provider for the auth namespace (the settings service's registerLiveStatus seam, the one plugin-email uses for mail). On each page read it compares the switch (SettingsService.get with the page's own context) with what runs (getPublicConfig().emailPassword.enabled), after any settings pass a change event started:

  • they agree: nothing is stated (the page is unchanged);
  • off by the deployment's declaration, nothing stored: an info banner, "Email and password sign-in is off on this deployment", saying the switch shows the console default and that a value saved here takes precedence;
  • off on a cloud-managed runtime that holds it off (emailPasswordHeldOffByHost, the same predicate the managed save door and settings pass from the previous change read): "... off on this environment", info with nothing stored, warning over a stored on that is not applied;
  • any other disagreement: a warning naming what runs.

The banner reaches the page through GET /api/settings/auth as the live_status info_banner at the head of manifest.specifiers, in the caller's language (all 11 platform locales, kept in the plugin like the mail statement's copy because it is composed per request).

Why a banner and not the switch's value. The live-status values / served live field admits option-bearing keys only and serves string option values (SettingsNamespacePayloadSchema.live in packages/spec), so a toggle cannot be stated there without a spec contract change; and making values.email_password_enabled resolve to the declaration would change what source: 'default' means on a published shape. Both are contract decisions, not taken here (see Acceptance notes). The card's expected outcome allows "or marks the toggle as host-declared", which this does.

Unchanged: the resolved values, every save and the managed save door from the previous change. A stored value still wins where it is applied (pinned).

Read first (by risk):

  1. packages/plugins/plugin-auth/src/auth-plugin.ts, end of bindAuthSettings: the provider registration and the runPass wrapper the provider awaits.
  2. packages/plugins/plugin-auth/src/auth-settings-live-status.ts, describeEmailPasswordLiveStatus: which case wins.
  3. packages/plugins/plugin-auth/src/auth-settings-live-status.test.ts.

Two-minute check: pnpm --filter @objectstack/plugin-auth exec vitest run --maxWorkers=2 src/auth-settings-live-status.test.ts shows 7 passed.

Tests

New auth-settings-live-status.test.ts (real AuthPlugin, real SettingsService with the shipped auth manifest, real GET /api/settings/:namespace route):

  1. declared off, nothing stored: SettingsService.get and the HTTP values both still answer { value: true, source: 'default' } (the premise), and the page is headed by the info banner, in English and in zh-CN;
  2. CONTROL: declared on, nothing stored: no banner;
  3. stored value still wins: saved on over a declared off (runtime goes on), and saved off over a declared on (runtime goes off): no banner;
  4. cloud-managed, declared off: info banner with nothing stored, warning over a stored on that is not applied;
  5. unit: agreement states nothing; any other disagreement is a warning; every locale carries every sentence.
Premise and reverse verification

The fix was committed first (ee523615); auth-plugin.ts was then restored from the base 815e882b (unstaged, git restore --source) and the new file run: 2 failed, 5 passed. The two failures are cases 1 and 4, each at the banner assertion (expected undefined to match object), after the case-1 assertions that SettingsService.get and the HTTP route answer { value: true, source: 'default' } with the runtime off had passed: the premise, measured on the HTTP route the page reads. Restored with git restore --source=HEAD; git status --porcelain empty afterwards.

Acceptance notes

  • The switch itself still reads on under a declared off with nothing stored, and keys gated on email_password_enabled !== false (password length, complexity, and others) stay visible there; the banner states it. Making the switch show the running value needs either the served live field to admit booleans, or a settings-service seam for a runtime-declared default; both change a published contract and are left for a decision.
  • The same shown-versus-declared gap exists for other auth keys whose deployment declaration differs from the manifest default (for example signup_enabled, require_email_verification); not reached here, the card names only email_password_enabled.

Verification

Local runs
  • pnpm turbo run build --filter='@objectstack/plugin-auth^...' --concurrency=2: 35 tasks successful.
  • pnpm --filter @objectstack/plugin-auth typecheck: passed (tsc --noEmit, the examples project, check:test-typecheck OK).
  • pnpm --filter @objectstack/plugin-auth test: Test Files 296 passed (296); Tests 6305 passed, 10 skipped (6315); lock verdict command-exit 0.
  • Derived gate families at 022ffdfd (node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands, 77): --ran reconciliation 77 derived, 74 run with exit 0, 3 NOT MEASURED (exit 3, prerequisite): node scripts/check-plugin-teardown-shape.mjs --self-test (its pinned fixture needs an unshallowed clone), pnpm check:dual-build-cjs-loads (reads built output of packages outside the closure built here), pnpm check:type-check-debt (its closure build did not get a turn on the shared verify lock, queue-timeout behind a sibling run). CI runs all three families' scans in its own jobs; they are read from this PR's check-runs, not re-run here.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint is the run CI owns (Lint & Repo Gates), not repeated locally.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (not touched)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

21 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run.

What this run could not see
  • 4 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 f72f335393f40e27194c56911e6de46052cb6f4c → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 612c8df7eaabb91d71037b36af9058b5f4bbfb57 — the merge of head 022ffdfd80121895dba020055859236842bfc094 into base f72f335393f40e27194c56911e6de46052cb6f4c, 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 612c8df7eaabb91d71037b36af9058b5f4bbfb57 && git checkout 612c8df7eaabb91d71037b36af9058b5f4bbfb57
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin f72f335393f40e27194c56911e6de46052cb6f4c 022ffdfd80121895dba020055859236842bfc094 && git checkout -B drift-repro f72f335393f40e27194c56911e6de46052cb6f4c && git merge --no-ff 022ffdfd80121895dba020055859236842bfc094

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

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

@github-actions github-actions Bot added 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 28, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

维护者速读

席位核对 — ACCEPT · repo:objectstack#6 · head 022ffdfd80121895dba020055859236842bfc094

  • Shape: draft → main, Fixes #38029, four files in packages/plugins/plugin-auth plus a patch changeset.
  • Premise measured on main 815e882b (after fix(plugin-auth)!: a cloud-managed runtime keeps email and password off when its deployment declares it off #38028) by the dev (report 7232213655): with emailAndPassword.enabled: false declared and nothing stored, SettingsService.get and GET /api/settings/auth answer { value: true, source: 'default' } while getPublicConfig().emailPassword.enabled is false.
  • Diff read by the seat: a registerLiveStatus('auth', …) provider (the seam plugin-email uses for mail), optional on the structural settings surface, registration failure logged not thrown; it awaits the settings pass a change event started, then describeEmailPasswordLiveStatus compares the shown value with the running one: agreement states nothing; declared off with nothing stored is info; held off by the host (emailPasswordHeldOffByHost, fix(plugin-auth)!: a cloud-managed runtime keeps email and password off when its deployment declares it off #38028's predicate) is info, warning over a stored on; any other disagreement is warning. Copy in all 11 locales, composed per request. Resolved values, saves and the managed save door unchanged.
  • Declarations: Clause-②: no, Metadata-protocol: none, patch. The banner rides the existing live_status payload shape; no published schema or governed path touched, so no contract review is owed (same reading as 7219466980 / the fix(console): the profile password card shows a password refusal in the session's language #38025 record).
  • Tests: new real-plugin, real-settings-service, real-route file, 7 cases incl. CONTROL (declared on) and stored-value-wins both ways; reverse check on base failed exactly the two banner cases after the premise assertions passed. Package suite 296 files / 6305 passed.
  • Gates: check-runs at head 37 success, 16 skipped, 0 failed; mergeable clean.
  • Seat ruling on the dev's open question: A (banner) here; the switch showing the running value (option B, a runtime-declared default seam that redefines source: 'default') is filed as Settings: auth switches show the manifest default, not the deployment declaration that runs, when nothing is stored #38098 for triage. The likely same gap on signup_enabled / require_email_verification is recorded there.
  • Landing: --land.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

Landing: seat ACCEPT 7232512706 at head 022ffdfd80121895dba020055859236842bfc094; Clause-②: no, Metadata-protocol: none, no contract review owed. Check-runs green.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 28, 2026 02:40
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 28, 2026
Merged via the queue into main with commit 2d8b7fa Nov 28, 2026
54 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-38029-auth-setting-live-value branch November 28, 2026 03:05
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 size/l 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.

Setup › Authentication shows "email and password" on when the deployment declared it off

2 participants