Skip to content

Commit d24a502

Browse files
docs(plugin-auth): boot reachability report and self-hosting page state the admission order the audience gate reads (#36724)
Fixes #36355 repo:objectstack#7 · os-alice · session_011y7As6FyXmJyGyHNKXUkV7 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:自托管运维者在启动日志里那条「无人能登录」报错,以及自托管部署文档,对邀请恢复路径的描述更准确;行为不变。 - 为什么做:上一轮受众策略调整后,文案仍说「邀请先于策略判断」,与代码实际顺序不符,属于其后续文字修正。 - 出错会怎样:只是文字,最坏是说法仍不够精确;可直接撤回,不影响任何准入结果。 - 要你做什么:无 ## What changes Prose only, no logic, no condition, no test change. - `packages/plugins/plugin-auth/src/boot-sign-in-reachability.ts` (N1): the module docblock no longer says `decideAudienceAdmission` short-circuits on `hasPendingInvitation` before the posture switch. It now states the order the function has at main: the posture's own rule is read first (`isAdmittedByPostureRule`: `open`, and an on-allowlist `email_domain` address), then the invitation branch (which admits under `invite_only` and for an off-allowlist address). The `no_sign_in_account_at_boot` message gets the same correction: the verdict-level claim "that ONE creation is admitted under EVERY audience posture" is kept (its pin stays green), and the mechanism now says which branch admits it under which posture. The line-62 rider rule is untouched: the no-mail-transport rider stays scoped to `invite_only`, and nothing states the verification forcing for every non-`invite_only` posture. - `content/docs/deployment/self-hosting.mdx` (N3): "Under `open` every address is admitted by the posture, invitation or not" gains the half-clause the #36312 changeset states: except a social-provider sign-in whose address the provider did not verify while email verification is in force, refused `403 SELF_REGISTRATION_CLOSED` (`admissionRestsOnAddress` reads `open` as resting on the address exactly while `resolveEmailVerificationRequirement('open', …)` is true). - Same page, the recovery paragraph's "The invitation carve-out admits that one creation under every posture" carried the same imprecision as N1; the module docblock says that page and the message "must keep agreeing", so it is reworded the same way in this PR (same file, inside the claimed surface). - `.changeset/36355-auth-boot-reachability-admission-order.md`: `patch` for `@objectstack/plugin-auth`. The message string ships in `dist` (`files: ["dist", "README.md", "CHANGELOG.md"]`). ## Tests No test changes. No test pins the reworded sentence verbatim: the "under EVERY audience posture" text appears only in a `describe`/`it` title, and the pins under it assert the admission verdict for every posture, which this PR does not move. Every `toContain` pin on the message still holds. Read first: `boot-sign-in-reachability.ts` message hunk (around the "That ONE creation" line), the risk being a `toContain` pin that spans a reworded line; then the docblock bullet; then the doc paragraph. ## Acceptance notes - Verdict-level claims are unchanged in both files; only the mechanism sentences move. - `check:skill-examples`, `check:dual-build-cjs-loads` exited 3 locally (PREREQUISITE NOT MET: they read built output of packages outside this diff's closure) and `check-plugin-teardown-shape --self-test` exited 3 on a shallow checkout. NOT MEASURED locally; CI runs them on a full build. ## Verification Two-minute check: `pnpm --filter @objectstack/plugin-auth exec vitest run src/boot-sign-in-reachability.test.ts` — expect 51 passed. <details><summary>Local readings at d1105b6</summary> - `pnpm --filter @objectstack/plugin-auth exec vitest run --maxWorkers=2 src/boot-sign-in-reachability.test.ts`: Test Files 1 passed (1), Tests 51 passed (51). - Under the verify lock, `pnpm --filter @objectstack/plugin-auth build && … typecheck && … test`: VERDICT command-exit 0; Test Files 293 passed (293), Tests 6265 passed, 10 skipped (6275). - `dispatch-gates --commands` derived 91 families; all run, 88 exit 0, 3 exit 3 (NOT MEASURED, above); `--ran` reconciliation: 91 accounted, 88 run, 3 NOT-MEASURED. - `check-nul-bytes`: OK. `overlap-check`: VERDICT clean exit 0 (main, #36311, #35129 merge cleanly). </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_011y7As6FyXmJyGyHNKXUkV7 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 0de93df commit d24a502

3 files changed

Lines changed: 31 additions & 10 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/plugin-auth': patch
3+
---
4+
5+
docs(plugin-auth): the `no_sign_in_account_at_boot` boot report now states the admission order the audience gate actually reads
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The recovery remedy in the boot report still holds — a pending `sys_invitation` row gets that one sign-up admitted under every audience posture — but its sentence said the invitation carve-out is what admits it everywhere. The audience gate reads the posture's own rule first: under `open`, and for an address on the `email_domain` allowlist, the posture admits the sign-up, invitation or not; the invitation admits it under `invite_only` and for an address off the allowlist. The message now says so. No admission behaviour changes.

‎content/docs/deployment/self-hosting.mdx‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -715,8 +715,10 @@ dead end this section describes.
715715
directly against the store the deployment reads, then have that person register
716716
through the ordinary sign-up endpoint, sending the row's `id` as `invitationId`
717717
beside the email — under `invite_only` a sign-up is admitted only by the
718-
invitation it presents. The invitation carve-out admits that one creation under
719-
every posture, so the `invite_only` default stays where it is. One
718+
invitation it presents. That one creation is admitted under every posture — by
719+
the invitation under `invite_only` and off an `email_domain` list, by the
720+
posture's own rule, read first, under `open` and on the list — so the `invite_only` default stays where
721+
it is. One
720722
`sys_invitation` row:
721723

722724
| Column | Value |
@@ -829,7 +831,10 @@ refused `403 SELF_REGISTRATION_CLOSED`, whatever the list or an invitation
829831
says ([Authentication](/docs/permissions/authentication#2-handle-callback)).
830832
Once the provider verifies the address, the next sign-in is admitted.
831833
Under `open` every address is admitted by the posture, invitation or not, so an
832-
invited sign-up likewise receives the declared set beside its invitation.
834+
invited sign-up likewise receives the declared set beside its invitation — except
835+
a sign-in through a social provider whose address the provider did not verify
836+
while email verification is in force, which is refused
837+
`403 SELF_REGISTRATION_CLOSED` as above.
833838

834839
**A sign-up the posture admits needs its declared set, invited or not.** When
835840
`selfRegistrationPermissionSet` cannot be resolved (no such set, or the set is

‎packages/plugins/plugin-auth/src/boot-sign-in-reachability.ts‎

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,15 @@
3838
* carries is a claim about behaviour, and each is pinned in the sibling suite
3939
* rather than merely string-matched:
4040
*
41-
* - **The invitation row is the way out.** `decideAudienceAdmission` short-
42-
* circuits on `hasPendingInvitation` BEFORE the posture switch, so a
43-
* self-serve creation holding a pending, unexpired `sys_invitation`
44-
* (`audience-posture.ts`, "The invitation carve-out") is admitted under
45-
* every posture in `AUDIENCE_POSTURES`. No door needs widening. Under
41+
* - **The invitation row is the way out.** A self-serve creation holding a
42+
* pending, unexpired `sys_invitation` (`audience-posture.ts`, "The
43+
* invitation carve-out") is admitted under every posture in
44+
* `AUDIENCE_POSTURES`, though not always BY the invitation:
45+
* `decideAudienceAdmission` reads the posture's own rule first, so under
46+
* `open`, and for an address on the `email_domain` allowlist, the posture
47+
* admits it, invitation or not; the invitation admits it under
48+
* `invite_only` and for an address off the allowlist. No door needs
49+
* widening. Under
4650
* `invite_only` a sign-up holds it only by presenting it — the row's `id`
4751
* as the body's `invitationId` (`presented-invitation.ts`) — so the
4852
* message has the operator give the row an id of their own and send it
@@ -546,8 +550,10 @@ export function resolveNoSignInAccountReport(
546550
'lowercases the address it searches for, so a mixed-case row is never found), then have that ' +
547551
"person register through the ordinary sign-up endpoint, sending that row's 'id' as " +
548552
"'invitationId' beside the email: under 'invite_only' a sign-up is admitted only by the " +
549-
'invitation it presents. The invitation carve-out admits that ' +
550-
'ONE creation under EVERY audience posture, so no door needs widening — but it is an ADMISSION ' +
553+
'invitation it presents. That ONE creation is admitted under EVERY audience posture — by the ' +
554+
"invitation under 'invite_only' and for an address off the 'email_domain' list, by the posture's " +
555+
"own rule, read first, under 'open' and on the list — so no door needs widening; but the " +
556+
'carve-out is an ADMISSION ' +
551557
'verdict, not a verification bypass: the INVITED login meets the same email-verification rule as ' +
552558
"any sign-up. Under 'email_domain' verification is always ON; under 'open' it is ON unless the " +
553559
'DEPLOYMENT has itself declared it off (emailAndPassword.requireEmailVerification: false, or ' +

0 commit comments

Comments
 (0)