Skip to content

Commit e9884e1

Browse files
docs(adr-0135): on D6, an SSO link and a sign-in that would change an account's address follow the proven-domain rule (#33356)
## 维护者速读 - 改了什么:仅在 `docs/adr/0135-identity-and-access-architecture.md` 的 D6 下新增一条带日期的说明:开启 SSO 域名验证后,"已验证域名"规则除了管新建账号,也管隐式关联到已有账号,以及会改写已关联账号已存邮箱的登录(无法判定时也拒绝);不改写任何东西的登录与用户自己发起的显式关联不判定。D6 正文"已有账号不复查"一句加注例外并指向该说明;"本文件不新增条款"一句改为指向 D6 的两条说明。 - 为什么改:#33307 把同一条规则延伸到这两条路径,而 D6 原文写着"已有账号不复查"。授权来源是维护者 2026-11-14 的裁决(安全车道决策卡,选项 B「只拦会改邮箱的登录」,由 review#2 记录 6884303063 转述);记录 6880992920 是要求留下此说明的复核。 - 风险与回滚:纯文档,不改代码、不发布;回滚即还原本 PR。 - 先看:`docs/adr/0135-identity-and-access-architecture.md` 中 D6 末尾新增的 2026-11-14 说明。 - 两分钟验证:打开该文件搜索 "Note (2026-11-14",预期看到一段说明,写明链接与改邮箱登录按同一已验证域名规则判定。 - 需要你做的:以授权账号审批本 PR(Tier H 受管面 `docs/adr/**`);审批即确认 D6 记录该裁决的写法。请在 #33307 合并后再落地。 ## What changes `docs/adr/0135-identity-and-access-architecture.md`, D6 only: - A dated note (2026-11-14). With SSO domain verification on, the proven-domain account rule also decides two more cases. An implicit link to an existing account is made only at a proven domain. A sign-in into an already-linked account is refused when it would change the stored address to one outside the proven domains, and refused where whether it would change the address cannot be determined. - What the note leaves unjudged: a sign-in that changes nothing is admitted, and an explicit link is not judged. - The rule's own refusal answers `EMAIL_DOMAIN_NOT_ALLOWED`; an input the gate cannot read is refused by the gate's general refusal. - The authority is the maintainer's ruling of 2026-11-14, relayed in review record 6884303063. Record 6880992920 is cited as the review that required the note. #33307 implements the rule. - In the D6 body, "Accounts that already exist are not re-checked" now names its two exceptions and points to the note. - "What this record does NOT settle": the exception now points at the proven-domain account rule the D6 notes name, plural. No code, no published package, so `skip-changeset`. ## Verification - At `d2d02d8838`, the `dispatch-gates --commands` derivation for this diff (21 families), reconciled with `--ran`: 21 run, 0 not measured. ## Acceptance notes - This is a governed surface (Tier H). It lands only after an authorized approval, and only after #33307 has merged. If #33307's head moves the rule again, re-read the note. --- _Generated by [Claude Code](https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f)_ <!-- signed: security#1 · sunhaolin · session_017xRBcT1w3zpekijraHJE4f --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5abcad0 commit e9884e1

1 file changed

Lines changed: 22 additions & 3 deletions

File tree

‎docs/adr/0135-identity-and-access-architecture.md‎

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,8 @@ compared exactly (a subdomain counts only when it is itself listed and verified,
263263
counts only for the host the provider proved), failing closed, and relaxed by no audience posture,
264264
invitation or JIT toggle (plugin-auth's rule at better-auth's `user.validateUserInfo` gate,
265265
`packages/plugins/plugin-auth/src/sso-account-at-proven-domain.ts#refuseSsoAccountOutsideProvenDomain`).
266-
Accounts that already exist are not re-checked. With the rule that a domain is claimed by one
266+
Accounts that already exist are not re-checked, except on an implicit link or a sign-in that
267+
would change the stored address (see the 2026-11-14 note). With the rule that a domain is claimed by one
267268
provider at most, held where a provider is registered and where its domain list is edited
268269
(`packages/plugins/plugin-auth/src/sso-provider-lifecycle.ts#findSsoDomainClaim`), an SSO provider
269270
creates a new account at a domain only when it is the one provider that claims that domain and has
@@ -282,6 +283,24 @@ register-then-login flow. The surface is
282283
> as a URL or with a port proves nothing). That ruling, not this file, is its authority; #32669
283284
> implements it. Cloud ADR-0024's own text is not amended here.
284285
286+
> **Note (2026-11-14, objectstack) — the same rule for an implicit link and for an address change.**
287+
> The proven-domain account rule above also decides the two other ways an SSO sign-in reaches an
288+
> account, so "accounts that already exist are not re-checked" now holds only for a sign-in that
289+
> neither links implicitly nor would change the stored address. With domain verification on: an
290+
> implicit link to an account that already exists is made only when the asserted address is at a
291+
> domain the provider has proven, compared exactly as for creation; and a sign-in into an
292+
> already-linked account is refused when it would change the stored address to one that is not
293+
> at such a domain, and refused where whether it would change the address cannot be determined. A
294+
> sign-in that reports an address outside the proven domains but changes nothing is admitted, and
295+
> a link the user starts from their own session (an explicit link) is not judged. The rule's own
296+
> refusal answers `EMAIL_DOMAIN_NOT_ALLOWED`, the code creation answers; an input the gate cannot
297+
> read is refused by the gate's general refusal. The authority is the maintainer's ruling of
298+
> 2026-11-14 on the security lane's decision card (option B, "only a sign-in that would change the
299+
> address is refused"), relayed in contract review record 6884303063; record 6880992920 is the
300+
> review that required this note. That ruling, not this file, is its authority; #33307 implements
301+
> it, in plugin-auth's rule at the same `user.validateUserInfo` gate
302+
> (`packages/plugins/plugin-auth/src/implicit-account-linking.ts`).
303+
285304
⚠️ **The SCIM half of "SSO + SCIM per production environment" is not restated here.** Its
286305
mechanism record is `cloud ADR-0071`, mirrored into this repository by its own card; this file
287306
records only that the same environment-side posture applies to it — the SCIM models are bridged
@@ -331,8 +350,8 @@ spelling. The re-pointing is per-site and semantic.
331350

332351
## What this record does NOT settle
333352

334-
- **Anything cloud ADR-0024 did not decide.** This file adds no clause, except the one the D6
335-
note on the proven-domain account rule names as this repository's own. Where the mechanism in
353+
- **Anything cloud ADR-0024 did not decide.** This file adds no clause, except the proven-domain
354+
account rule the D6 notes name as this repository's own. Where the mechanism in
336355
this tree is richer than the decision (the ADR-0092 write guard, the ADR-0095 tenant wall, the
337356
ADR-0091 validity window), that richness belongs to those records, and is cited here only as the
338357
thing D4 and D5 lean on.

0 commit comments

Comments
 (0)