Repository navigation
feat(auth): directSignIn.afterSignOut returns hosted sign-out through the identity provider - #35224
Conversation
… the identity provider (WIP) Claude-Session: https://claude.ai/code/session_01Utp6CYxMsbSfVbHgmGptah Co-authored-by: Claude <noreply@anthropic.com>
…hangeset 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>
…fter sign-out Claude-Session: https://claude.ai/code/session_01Utp6CYxMsbSfVbHgmGptah Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 178 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 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
|
…ol added, spec minor Claude-Session: https://claude.ai/code/session_01Utp6CYxMsbSfVbHgmGptah Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ Contract reviewServed-tier: PR #35224 (card #35106), net diff
① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
Security probes, each tried to break.
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 Docs and changeset, sentence by sentence against the code.
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):
Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ 维护者速读
席位核对 — ACCEPT · repo:objectstack#5 · head
|
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 fieldGET /auth/configserves, which no metadata author writes;git grep -n -e directSignIn -e localSignIn -e afterSignOut -- skillsanswers 0 hits, so no skill teaches this surface维护者速读
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。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' }。What changes
@objectstack/plugin-auth:DirectSignInOptions.afterSignOut('hold'default,'identity-provider'), envOS_AUTH_DIRECT_SIGN_IN_AFTER_SIGN_OUTwinning 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()servesfeatures.afterSignOutwhile the direct sign-in setting is on, on the same terms aslocalSignIn. TypeDirectSignInAfterSignOuton the package entry.@objectstack/spec: optionalAuthFeaturesConfigSchema.afterSignOutenum;PUBLIC_AUTH_CONFIG_NON_FLAG_KEYSgains'afterSignOut'; regeneratedauthorable-surface/api.jsonand theauth-endpointsreference page.@object-ui/auth:signOut()resolves itscallbackURLthroughsignOutReturn: the start door{basePath}/sign-in/directwhen the config readsdirectSignIn: trueandafterSignOut: '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.content/docs/permissions/sso.mdx(settings table, a "Sign-out through the identity provider" paragraph) andcontent/docs/deployment/environment-variables.mdx.Tests
direct-sign-in.test.ts: resolve defaults tohold, option and env both ways, off-vocabulary throws (option and env);/auth/configservesholdby default andidentity-providerwhen set, env overriding the option; with the setting offafterSignOutis 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 withcallbackURL: '/api/v1/auth/sign-in/direct'hands the providerpost_logout_redirect_uri= the absolute door on this origin, and the session ends.signOutProviderLogout-26618.test.tsx:holdsends/_console/loginand writes the round-trip note;identity-providersends the door and writes no note; a held config is reused (one config read); CONTROL rows return to/loginwhendirectSignInis false, when noafterSignOutis 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/configonce first).auth-endpoints.test.ts(spec): the served-features fixture carriesafterSignOut, so the parse covers it.Acceptance notes
end_session_endpoint, or a password sign-in), thecallbackURLis never used and the Console ends on the held sign-in page under either value, as the card scopes it ("the Console's sign-outcallbackURL").callbackURL. The Console sends nostateon sign-out, so a conforming provider appends nothing to the return address.features.directSignInreadstrue; otherwise it is not mounted (404) or cannot start, so the Console keeps/login.Metadata-protocol: added(patch round): the new optional enum onAuthFeaturesConfigSchemamovespackages/spec/authorable-surface/api.json, so the kind isaddedand@objectstack/specis gradedminor;@objectstack/plugin-authand@object-ui/authstaypatch. The key addition is intended (the card's spec field).identity-providerand 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): A1afterSignOutappears only insso-oidc-refusal-cause.test.tsconstants; A2 Console sign-out hard-coded the sign-in page ascallbackURL; A3localSignInis served fromgetPublicConfig()and declared inauth-endpoints.zod.tsandPUBLIC_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