Skip to content

feat(auth): directSignIn.afterSignOut returns hosted sign-out through the identity provider - #35224

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-t6ao42
Nov 18, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-t6ao42

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

repo:objectstack#5 · os-bill · session_01Utp6CYxMsbSfVbHgmGptah

Fixes #35106

Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: none — the added key is AuthFeaturesConfigSchema.afterSignOut, a field GET /auth/config serves, which no metadata author writes; git grep -n -e directSignIn -e localSignIn -e afterSignOut -- skills answers 0 hits, so no skill teaches this surface

维护者速读

  • 改了什么:直连登录(direct sign-in)新增 afterSignOut: 'hold' | 'identity-provider' 选项(环境变量 OS_AUTH_DIRECT_SIGN_IN_AFTER_SIGN_OUT 优先),/auth/config 在直连登录开启时下发 features.afterSignOut;Console 登出在 identity-provider 且 directSignIn: true 时把身份提供方的登出回跳地址设为直连门 /api/v1/auth/sign-in/direct,否则仍是 /login。
  • 为什么改:cloud#4465 裁决 8、10:托管环境登出后应落在云端登录页,不保留环境自己的登录页;cloud#4471 等这一项发版后设 identity-provider。
  • 风险与回滚:默认 hold,未设新值的部署行为完全不变;非法取值启动即报错(与 localSignIn 同规则)。回滚 = 撤本 PR 或部署把值设回 hold。
  • 先看:ui/packages/auth/src/createAuthClient.ts(signOutReturn 与 signOut)、packages/plugins/plugin-auth/src/direct-sign-in.ts(选项、环境变量、解析)、packages/spec/src/api/auth-endpoints.zod.ts(新字段)。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/auth/src/__tests__/signOutProviderLogout-26618.test.tsx,预期全绿,其中 identity-provider 一例的登出请求体是 { callbackURL: '/api/v1/auth/sign-in/direct' }。
  • 需要你做的:无,席位落地(契约面 L2 审核由席位安排)。

What changes

  • @objectstack/plugin-auth: DirectSignInOptions.afterSignOut ('hold' default, 'identity-provider'), env OS_AUTH_DIRECT_SIGN_IN_AFTER_SIGN_OUT winning field by field like the other direct sign-in settings, an off-vocabulary value throws at resolve time naming the variable and both values. getPublicConfig() serves features.afterSignOut while the direct sign-in setting is on, on the same terms as localSignIn. Type DirectSignInAfterSignOut on the package entry.
  • @objectstack/spec: optional AuthFeaturesConfigSchema.afterSignOut enum; PUBLIC_AUTH_CONFIG_NON_FLAG_KEYS gains 'afterSignOut'; regenerated authorable-surface/api.json and the auth-endpoints reference page.
  • @object-ui/auth: signOut() resolves its callbackURL through signOutReturn: the start door {basePath}/sign-in/direct when the config reads directSignIn: true and afterSignOut: 'identity-provider', else the sign-in page. It reads the config the tab holds; with none, one attempt bounded at 3 s; an unreadable config keeps the sign-in page. The sign-out round-trip note (the hold) is written only when the return is the sign-in page.
  • Docs: content/docs/permissions/sso.mdx (settings table, a "Sign-out through the identity provider" paragraph) and content/docs/deployment/environment-variables.mdx.

Tests

  • direct-sign-in.test.ts: resolve defaults to hold, option and env both ways, off-vocabulary throws (option and env); /auth/config serves hold by default and identity-provider when set, env overriding the option; with the setting off afterSignOut is absent and every other key is unchanged; the bare door hit (what the provider returns to after logout, no cookie, no query) answers 302 off this origin to the identity provider's authorize endpoint, never the door again and never /login (the A4 no-loop pin).
  • sso-oidc-refusal-cause.test.ts: a real OIDC sign-in then sign-out with callbackURL: '/api/v1/auth/sign-in/direct' hands the provider post_logout_redirect_uri = the absolute door on this origin, and the session ends.
  • signOutProviderLogout-26618.test.tsx: hold sends /_console/login and writes the round-trip note; identity-provider sends the door and writes no note; a held config is reused (one config read); CONTROL rows return to /login when directSignIn is false, when no afterSignOut is served, and when the config cannot be read.
  • createAuthClient.test.ts: the plain sign-out test now counts the sign-out POST among the calls (with no config held, sign-out reads /config once first).
  • auth-endpoints.test.ts (spec): the served-features fixture carries afterSignOut, so the parse covers it.

Acceptance notes

  • With no provider logout to follow (a provider without end_session_endpoint, or a password sign-in), the callbackURL is never used and the Console ends on the held sign-in page under either value, as the card scopes it ("the Console's sign-out callbackURL").
  • The door's query set stays closed to callbackURL. The Console sends no state on sign-out, so a conforming provider appends nothing to the return address.
  • The direct door is used only while features.directSignIn reads true; otherwise it is not mounted (404) or cannot start, so the Console keeps /login.
  • Metadata-protocol: added (patch round): the new optional enum on AuthFeaturesConfigSchema moves packages/spec/authorable-surface/api.json, so the kind is added and @objectstack/spec is graded minor; @objectstack/plugin-auth and @object-ui/auth stay patch. The key addition is intended (the card's spec field).
  • Cloud side (cloud#4471): set identity-provider and register the absolute door address as a post-logout redirect URI once a release carrying this ships.

Verification

Readings A1–A4 (at ec227fc7, before the change): A1 afterSignOut appears only in sso-oidc-refusal-cause.test.ts constants; A2 Console sign-out hard-coded the sign-in page as callbackURL; A3 localSignIn is served from getPublicConfig() and declared in auth-endpoints.zod.ts and PUBLIC_AUTH_CONFIG_NON_FLAG_KEYS; A4 the door never reads the request's cookie or session and always starts a fresh provider sign-in, pinned above.

Local gate and test readings are added in the report comment on #35106.


Generated by Claude Code

… the identity provider (WIP)

Claude-Session: https://claude.ai/code/session_01Utp6CYxMsbSfVbHgmGptah
Co-authored-by: Claude <noreply@anthropic.com>
…urface for afterSignOut

Claude-Session: https://claude.ai/code/session_01Utp6CYxMsbSfVbHgmGptah
Co-authored-by: Claude <noreply@anthropic.com>
@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 18, 2026
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/plugin-auth, @objectstack/spec, touching 21 documentable anchor(s). ⚠️ 2 changed file(s) yielded no anchor (packages/plugins/plugin-auth/src/index.ts, packages/spec/authorable-surface/api.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

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

  • content/docs/deployment/environment-variables.mdx (via OS_AUTH_DIRECT_SIGN_IN_AFTER_SIGN_OUT (literal, a string literal in afterSignOut))
  • content/docs/permissions/sso.mdx (via afterSignOut (symbol, a field of const object DIRECT_SIGN_IN_ENV; a field of interface DirectSignInOptions), getPublicConfig (symbol, a method of class AuthManager), OS_AUTH_DIRECT_SIGN_IN_AFTER_SIGN_OUT (literal, a string literal in afterSignOut), afterSignOut (literal, a string literal in PUBLIC_AUTH_CONFIG_NON_FLAG_KEYS), localSignIn (literal, a string literal in PUBLIC_AUTH_CONFIG_NON_FLAG_KEYS))
What this run could not see
  • 2 changed file(s) yielded no anchor (packages/plugins/plugin-auth/src/index.ts, packages/spec/authorable-surface/api.json) — pages documenting those are invisible to this run
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 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; 123 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 — 178 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 ec227fc7b18dbaea7ea635677db39063fb803206 → packageMentionDocs.

Which tree this was computed on

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

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

⚠️ 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 ec227fc7b18dbaea7ea635677db39063fb803206 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

…ol added, spec minor

Claude-Session: https://claude.ai/code/session_01Utp6CYxMsbSfVbHgmGptah
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: f0bc42a26f5743d251483bc71d1ef59da46cbb3a
Local-runs: none
Scope: packages/spec/src/api/auth-endpoints.zod.ts, packages/spec/src/kernel/public-auth-features.ts + packages/plugins/plugin-auth/src/direct-sign-in.ts, packages/plugins/plugin-auth/src/auth-manager.ts, packages/plugins/plugin-auth/src/auth-plugin.ts, packages/plugins/plugin-auth/src/index.ts, ui/packages/auth/src/createAuthClient.ts, ui/packages/auth/src/types.ts
Security-touching: yes

PR #35224 (card #35106), net diff ec227fc7..f0bc42a2, 18 files. Inputs: the card body and its three comments (triage 6968438363, claim 6985038352, dev report 6986638086), the PR body and file list, the net diff, the check-runs on the head. Nothing was built or run; code outside the diff was read on the head, and the vendor's better-auth@1.7.12 dist/api/routes/sign-out.mjs and dist/plugins/generic-oauth/index.mjs were read from the published tarball (the checkout has no node_modules). All file:line citations are on the head.

Security-touching: yes because the changed hunks decide where a browser goes after an explicit sign-out (the post_logout_redirect_uri the Console asks for), add a value to the unauthenticated GET /auth/config, and add a boot refusal on an auth setting. The PR carries no security label; whether it takes one is the adopting seat's call.

① Derived judgments

  1. AuthFeaturesConfigSchema.afterSignOut is an added optional key: right. packages/spec/src/api/auth-endpoints.zod.ts:300-305 adds z.enum(['hold', 'identity-provider']).optional() beside localSignIn (:295). The object is a plain z.object (:271), not strict, so an older parser strips the key and a newer parser accepts its absence. No existing key, enum member, default or description of another key moved. Accept set strictly grows.
  2. PUBLIC_AUTH_CONFIG_NON_FLAG_KEYS gains one member: right, and no flag iteration changes. packages/spec/src/kernel/public-auth-features.ts:432. Every consumer on the head: packages/spec/src/api/auth-endpoints.test.ts:196-200 (declared keys equal flags plus this list; the new key is on both sides), packages/plugins/plugin-auth/src/public-feature-registry.test.ts:47-52 (every non-boolean served key must be in the list; needed for the new string value) and turnstile-sign-up.test.ts:327 (a toContain). The boolean-flag loops read PUBLIC_AUTH_FEATURE_NAMES or typeof value === 'boolean' (public-feature-registry.test.ts:43-44, auth-endpoints.test.ts:206), never "every key not in the non-flag list". No runtime code reads the list (the other hits are comments), and no non-test code iterates the served features object: readAuthFamilies reads features.admin alone (packages/spec/src/api/discovery.zod.ts:325), the Console reads named keys. The list is a readonly tuple, so its literal type widens by one member; a consumer exhaustively switching on that union does not exist in the tree.
  3. /auth/config for existing consumers: unchanged with direct sign-in off, one added key with it on: right. packages/plugins/plugin-auth/src/auth-manager.ts:6019 spreads afterSignOut only under directSignIn.enabled, the same condition as localSignIn (:6015). Pinned by direct-sign-in.test.ts:575 (absent when off) and the strip-and-compare at :577-581 (every other key equal on and off).
  4. DirectSignInOptions.afterSignOut and the env variable: added optional input, right. direct-sign-in.ts:90, :111, resolved at :193-208 with the env winning and hold as the default. The off-vocabulary refusal (:194-201) is a new throw, but only for a value that had no meaning before this PR; it runs before the enabled return, like localSignIn (:186-192), and at construction (auth-manager.ts:2104), so "refuses to boot" is true with direct sign-in on or off. Not a narrowing of any previously accepted configuration: an unset option and an unset or empty variable resolve to hold.
  5. ResolvedDirectSignIn gains a required afterSignOut on its enabled arm (direct-sign-in.ts:104): output position, right. It is the return type of the public AuthManager.directSignInSetting() (auth-manager.ts:6124); readers gain a field. The package entry exports only the three type names (index.ts:105); DirectSignInHost, whose setting a caller would have to produce, is not on the entry or in the exports map.
  6. @object-ui/auth: AuthPublicConfig.features.afterSignOut added optional (ui/packages/auth/src/types.ts:338): right. One behaviour change reaches every deployment, not only those that set the new value: when the tab holds no config, signOut() now issues one GET /config (3 s bound) before the sign-out POST (createAuthClient.ts:673, :812), which is why createAuthClient.test.ts:151-160 had to change. It is disclosed in the changeset's @object-ui/auth bullet; the changeset's opening sentence "nothing changes until a deployment sets the new value" is true of where sign-out returns, not of that request.
  7. Generated outputs: right. packages/spec/authorable-surface/api.json:213 gains api/AuthFeaturesConfig:afterSignOut; content/docs/references/api/auth-endpoints.mdx gains the row in both tables, text equal to the describe.

② Semver level

  • Clause-②: yes (widening) is the right reading: every change in ① is an addition; nothing is removed, refused or changed in meaning for a consumer of /auth/config, AuthFeaturesConfigSchema or DirectSignInOptions. No (narrowing) arm is owed.
  • Metadata-protocol: added is the right kind and @objectstack/spec minor the right level. The rule (.github/workflows/pr-automation.yml, "WHICH LEVEL", from line 757) grades by what the authorable-surface shard records: a key entered is added, and added takes minor. The shard moved, so none is refused (none-baseline-moved); that is exactly what the first Check Changeset run said. @objectstack/plugin-auth and @object-ui/auth at patch match the same rule ("services, the console ... feat: and fix!: alike" grade patch); the level axis needs one package at minor, and spec carries it.
  • scripts/check-adr-0087-registration.mjs: the changeset declares no breaking change and no major, so no ADR-0087 disposition marker is owed. The successful run's log says so: "this PR adds no declared-breaking changeset (1 non-breaking changeset(s) seen)" and "LEVEL AXIS: this PR declares clause-② yes (widening) and metadata-protocol added ... the declared widening is accounted for".
  • The PR body and the changeset (.changeset/35106-direct-sign-in-after-sign-out.md, lines 9-10) carry the same two lines.
  • Check-runs on the head. 74 runs: 62 success, 11 skipped, 1 failure. The failure is Check Changeset job 135003372449 (workflow run 44361374290, pull_request, this head). Its log reads declaration line: Clause-②: yes (widening), metadata-protocol line: Metadata-protocol: none, "Moved: packages/spec/authorable-surface/api.json": it judged the PR body as it stood before the body was patched to added. The head's changeset already said added. Check Changeset job 135003961745 (workflow run 44361538052, pull_request, same head, created after the first) read the patched body and is success. The seat's reading is confirmed: one superseded red of the same check on the same head, cleared the way the workflow itself describes ("the body is re-read on edited, so that red clears with no push"). A re-run of 135003372449 would replay its stale event payload and fail again, so it is not a route to an all-green list; the later run is the verdict. No other red, none in progress.

③ Boundary flags

  • Dev open_questions: empty. security_findings: none: agreed, see ④.
  • Dev out_of_scope_findings (noted, not filed): with no provider logout to follow, callbackURL is never used and the Console ends on its own sign-in page under either value. Answered: accepted, inside the card. The card's Ask scopes the change to "the Console's sign-out callbackURL", and content/docs/permissions/sso.mdx:873-875 says it. It does mean cloud#4465 rulings 8 and 10 ("no environment sign-in page is kept") hold only for a session whose provider answers a logout URL; cloud#4471 should read that before it closes. No card owed here.
  • Claim line vs PR. The claim (6985038352) reads Metadata-protocol: none; the PR body and the changeset read added after the patch round the dev report describes. The gate reads the PR body and the changeset, and both are right; the claim line is stale, not a defect of the head.
  • File surface. All 18 paths are inside the claimed surface (plugin-auth src, the two spec files plus the generated shard, ui/packages/auth/src/**, docs, the changeset). No governed path.
  • Skills-docs: none. Agreed: no hit for afterSignOut, localSignIn or directSignIn under skills/ or ui/skills/ on the head.
  • SQL push-down. No data access is added: no query, no id materialisation, no in-app join.
  • Author. objectstack-fleet[bot]; no off-relay author to name.

④ Design judgment

packages/spec/src/api/auth-endpoints.zod.ts and packages/spec/src/kernel/public-auth-features.ts against the card and their first consumer. The card asks for afterSignOut: 'hold' | 'identity-provider', default hold, with the direct door as the sign-out callbackURL under the second value. The schema declares exactly that pair, optional, and "absent means hold"; the producer serves it on localSignIn's terms (auth-manager.ts:6019); the first consumer reads it only together with directSignIn === true (createAuthClient.ts:678). An older Console against this server ignores the key and holds; this Console against an older server reads it absent and holds. The design holds in both directions.

Security probes, each tried to break.

  • Open redirect / caller-chosen target. The PR adds no server input. The return address is a constant composed in client code from the app's own configured basePath (createAuthClient.ts:679), chosen by a server-served enum, not by a URL parameter or user input. The sign-out POST's callbackURL was already a body member and its checks are unchanged and outside the diff: for a sys_sso_provider OIDC session trustedPostLogoutUri keeps it only when isTrustedOrigin passes and makes it absolute on context.baseURL (sso-sign-out-of-idp.ts:371-379, used at :460); for an oidcProviders entry the vendor resolves it against baseURL (vendor sign-out.mjs:63, generic-oauth/index.mjs:169-173), and the provider's own registered post-logout list is the final check, which is why the docs tell the operator to register the door. The door itself takes no new parameter: its closed set is still callbackURL (direct-sign-in.ts:118, :443-451), through keptReturnPath (:454) and the same-origin check at :483. Reached bare, as the provider reaches it after logout, it returns the sign-in to the Console root (:481).
  • Redirect loop. The door has four answers and none is the door: 302 to the vendor-returned absolute authorization URL (:504-506), 302 to the Console's /login?error=... (:458-465), 400, 404. /login with error on the URL decides hold and does not navigate (ui/apps/console/src/pages/auth/directSignIn.ts:79). The A4 pin (direct-sign-in.test.ts:461-475) asserts the bare door answers 302 off this origin to the provider's authorize endpoint, with neither /sign-in/direct nor /login in the location. The Console sends no state on sign-out (createAuthClient.ts:814), so a conforming provider appends nothing and the door's closed query set does not refuse the return.
  • Fresh provider sign-in. The door hands the vendor's start a new request carrying only content-type, origin and the forwarded client address (direct-sign-in.ts:376-380, :491-497): no cookie, no authorization. Unchanged by this PR and pinned as above.
  • Absolute return address. sso-oidc-refusal-cause.test.ts:623-636 pins that callbackURL: '/api/v1/auth/sign-in/direct' reaches the provider as the absolute door on this origin and that the session is gone.
  • Hold note. Under identity-provider the round-trip note is not written (createAuthClient.ts:838), which is right: the note is honoured only on a load of the sign-in page path, and this return never loads it.
  • Unauthenticated /auth/config. The one new value is a two-member enum describing where sign-out returns, served only while direct sign-in is on. It names no secret, address, user or tenant, and the behaviour it describes is observable to anyone who signs out. Nothing sensitive is newly served.
  • Typo safety. An off-vocabulary value refuses the boot (direct-sign-in.ts:194-201, auth-manager.ts:2104) instead of resolving to either return; pinned at direct-sign-in.test.ts:129-132.

Residual, stated so nobody reads more into the pins than they hold. "The provider asks for credentials" rests on the provider having really ended its session before it redirects. A provider that redirects to the post-logout address without ending its session would sign the person straight back in through the door. That is not a loop and is the same outcome as pressing the held page's button under hold, one click earlier; the card accepts the premise in its Ask ("the provider's session has already ended"). The door does not ask the provider for prompt=login, and the card does not ask it to.

Docs and changeset, sentence by sentence against the code.

  • content/docs/deployment/environment-variables.mdx:108: values, default, "wins over directSignIn.afterSignOut", "any other value refuses to boot": all true (direct-sign-in.ts:193-208, auth-manager.ts:2104).
  • content/docs/permissions/sso.mdx:776-777, :782, :791: true; "see No loops below" resolves to :834.
  • content/docs/permissions/sso.mdx:865-875: the return to GET /api/v1/auth/sign-in/direct, the registration instruction, "the Console uses the door only while features.directSignIn reads true", and the no-provider-logout case are true (createAuthClient.ts:678-680, :836-840). One loose phrase, N3 below.
  • content/docs/references/api/auth-endpoints.mdx:66 and :219: equal to the schema describe; see N1.
  • Changeset: the option, env precedence, default, the refusal "naming the variable and both values" (direct-sign-in.ts:196-199), the /auth/config terms, both value bullets, the 3-second single read (createAuthClient.ts:657, :673) and the export statement (index.ts:105; DIRECT_SIGN_IN_AFTER_SIGN_OUT and DIRECT_SIGN_IN_ENV.afterSignOut in direct-sign-in.ts:98, :111, not on the entry) are true. The opening "nothing changes until a deployment sets the new value" is qualified in ① item 6.

Findings. No must-fix, no should-fix.

Nits (no effect on correctness or the contract; fix only on a prose face, or carry as accepted deviations or a follow-up card, since a fix elsewhere moves the head):

  • N1 (nit) — the schema describe names the wrong reader: "The sign-in page reads identity-provider only while directSignIn reads true" (auth-endpoints.zod.ts:304, mirrored at auth-endpoints.mdx:66, :219). The reader is the Console's sign-out (createAuthClient.ts:670-681); the sign-in page never reads afterSignOut. ui/packages/auth/src/types.ts:335-336 words it correctly. Accepted deviation; correct it the next time the file moves.
  • N2 (nit) — signOutReturn awaits a config read that is still in flight without the 3-second bound (createAuthClient.ts:673: configPromise ? await configPromise : ...), so a sign-out pressed while getConfig() is inside its retry ladder (:634-654) waits for that ladder before the sign-out POST. The jsdoc at :667-668 and the changeset say "with none, one bounded attempt", which is true as far as it goes. Rare and bounded by the ladder; follow-up candidate.
  • N3 (nit, prose) — sso.mdx:873-875 says that when features.directSignIn does not read true "the sign-out ends on the held sign-in page as above". With directSignIn false the page decides off (directSignIn.ts:75) and shows the ordinary sign-in page, not the held one. "ends on the sign-in page" would be exact.
  • N4 (nit) — the tab's held config can be older than the deployment: a tab that read identity-provider before a restart that turned direct sign-in off sends the door as the return, and the provider then lands the browser on the unmounted door's 404 JSON (auth-plugin.ts:4056-4061). The session is ended either way; a transition-only edge.
  • N5 (nit) — the comment at auth-manager.ts:2101-2103 still says only the local sign-in path refuses the boot; the same call now refuses an off-vocabulary afterSignOut too.
  • N6 (nit) — the absolute-return pin covers the sys_sso_provider arm only. The oidcProviders arm (the vendor's own createEndSessionURL, the arm a hosted environment signed in through the cloud takes) was read in the vendor source and resolves the same way, but no test in the repo pins it with the door as the return. Follow-up candidate before cloud#4471 relies on it.

Implemented-by: claude/project-thread-t6ao42
Reviewed-by: session_01Utp6CbUb7TcZK1XUAddUmQ

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ

维护者速读

  • 改了什么:直连登录新增 afterSignOut: 'hold' | 'identity-provider'(环境变量 OS_AUTH_DIRECT_SIGN_IN_AFTER_SIGN_OUT 优先)。/auth/config 在直连登录开启时下发这个值。Console 登出时,若是 identity-provider,身份提供方登出后回到直连门 /api/v1/auth/sign-in/direct,直接走云端登录;否则仍回 /login。
  • 为什么改:cloud#4465 裁决 8、10,托管环境登出后应落在云端登录页;cloud#4471 等这个发版后设 identity-provider。
  • 风险与回滚:默认 hold,不设新值的部署行为不变;唯一普遍变化是标签页没缓存配置时,登出前多读一次 /config(3 秒上限)。非法取值启动即报错。回滚即 revert,或部署把值设回 hold。
  • 先看:ui/packages/auth/src/createAuthClient.ts 的 signOutReturn;packages/plugins/plugin-auth/src/direct-sign-in.ts。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/auth/src/__tests__/signOutProviderLogout-26618.test.tsx,全绿。
  • 需要你做的:无,席位落地(非受管面、327 行,达档合同审查 PASS comment 6987769127)。席位意见:只加不改,回跳目标由服务端枚举决定、调用方选不了,直连门不会回环,可落。

席位核对 — ACCEPT · repo:objectstack#5 · head f0bc42a26f5743d251483bc71d1ef59da46cbb3a · 2026-11-18T18:29Z

  • 形态: 18 files, +301/−26; check-governed-merges --pr 35224: 0 of 18 paths governed, 327 lines ≤ 3000 → ordinary queue landing. Fixes #35106 on the first content line. Clause-②: yes (widening), Metadata-protocol: added, Skills-docs: none (0 hits under skills/, reason given). Changeset: spec minor, plugin-auth and @object-ui/auth patch. Report 6986638086.
  • 前提实测: A1–A4 read at ec227fc7 by the dev; L2 confirms on the head: the door's start request carries no cookie and answers only the provider authorize URL, /login?error=…, 400 or 404 (A4 pinned in direct-sign-in.test.ts).
  • 差异由席位读过: option + env resolve with off-vocabulary throw; getPublicConfig() serves features.afterSignOut only with direct sign-in on; spec optional enum + PUBLIC_AUTH_CONFIG_NON_FLAG_KEYS member; Console signOut() picks its callbackURL from the served config, writes the hold note only for the sign-in-page return.
  • 合同审查: L2 at CONTRACT_REVIEW_TIER, PASS, comment 6987769127, same head. Widening only; no runtime consumer iterates the non-flag list. Security-touching: yes (sign-out return target, unauthenticated config value, boot refusal), no finding: no caller-chosen target, no loop, nothing sensitive served.
  • Pins: resolve/env/throw cases; /auth/config served values; bare door hit → provider authorize (no loop); real OIDC sign-out hands the provider the absolute door as post_logout_redirect_uri; Console hold vs identity-provider vs CONTROL rows.
  • 门禁: check-runs on head f0bc42a2: 62 success, 11 skipped, 1 failure = Check Changeset 135003372449, which read the PR body before the patch round (Metadata-protocol: none); the later Check Changeset 135003961745 on the same head read added and is success. Lint & Repo Gates, TypeScript Type Check success. Dev local: 124 derived, 120 exit 0, 4 NOT MEASURED as container prerequisite refusals, each covered by a CI job.
  • 接受的偏差: the claim comment still reads Metadata-protocol: none; the PR body and changeset read added, which the gate reads.
  • 范围外去向: L2 nits N1–N6 (schema describe names the sign-in page as reader; in-flight config wait is unbounded; one sso.mdx phrase; stale-config 404 edge; one stale comment; the oidcProviders arm has no absolute-return pin) are listed on Auth direct sign-in: an afterSignOut option so hosted sign-out returns through the identity provider (objectstack#34168 item 3, not shipped; blocks cloud#4471) #35106; N6 is owed before cloud#4471 relies on that arm.
  • 落地条款: K = 4 first-parent commits on main since merge base ec227fc7 (< 15); mergeable_state clean; fix(plugin-auth): an invitation mail sent outside a better-auth endpoint still carries the mailbox proof #35226's one-line auth-manager.ts change on main does not overlap these hunks. Seat lands: pr_ready + automerge_enable in this stroke. On MERGED: close-out on Auth direct sign-in: an afterSignOut option so hosted sign-out returns through the identity provider (objectstack#34168 item 3, not shipped; blocks cloud#4471) #35106, unsubscribe.

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/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants