Skip to content

feat(plugin-auth): the environment-access refusal carries the host's reason and sentence - #34265

Merged
objectstack-fleet[bot] merged 10 commits into
mainfrom
claude/area-A1-34168
Nov 16, 2026
Merged

objectstack-fleet[bot] merged 10 commits into
mainfrom
claude/area-A1-34168

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

维护者速读

  • 改了什么:云端拒绝某账号进入环境时,宿主可以说明原因(「不是该组织成员」「邀请尚未接受」)和一句给用户看的话;这个原因经环境自己的登录回调一路带到环境登录页,登录页按原因显示对应的本地化句子。应用把用户送来登录时,登录页显示「登录以继续前往 应用名」,而不再只显示对方的域名。
  • 为什么改:cloud#4471 的托管登录需要告诉用户为什么进不去、该怎么做,也需要让用户知道自己正在登录哪个应用。
  • 风险与回滚:宿主仍返回 true/false 时,三种拒绝回复与改动前逐字节一致(有测试钉住),谁能进入没有任何变化。新增一个无需登录的只读接口,只回答应用名,而且只回答已签名请求里点名的那个应用,其余情况一律同一个 404,并按来源地址限流(每 60 秒 10 次)。回滚即还原本 PR;云端只有在用上本版本 plugin-auth 之后才能返回原因对象。
  • 先看:packages/plugins/plugin-auth/src/oauth-client-name.ts(新接口的放行条件)、oauth-callback-refusal-reason.ts(回调上带原因的条件)、ui/apps/console/src/pages/auth/LoginPage.tsx(登录页的两处读取)。
  • 两分钟验证:pnpm --filter @objectstack/plugin-auth exec vitest run --maxWorkers=2 src/oauth-authorize-refusal.test.ts,预期 69 个测试全部通过。
  • 需要你做的:无,席位落地。

Fixes #34168

Clause-②: yes (widening)
Metadata-protocol: none

What changes

All four items of the card.

  • The seam may say why (item 1). AuthManagerOptions.oidcAuthorizeGate may answer OidcAuthorizeGateRefusal ({ allowed: false, reason, message }) in place of false. An object refuses only when it says allowed: false; every other answer keeps the truthiness the gate was always read with, so nothing changes who is admitted.
  • The refusal carries it (item 2), on each door oauth-authorize-refusal.ts already chooses between:
    • the 403 envelope keeps code: ENV_ACCESS_DENIED, gains reason, and its message is the host's sentence;
    • the redirect back to a registered redirect_uri keeps error=access_denied (RFC 6749 §4.1.2.1), sends the host's sentence as error_description, and adds objectstack_error_reason;
    • the readable page shows the host's sentence, HTML-escaped, after the signed-in account.
  • Nothing the host answers is trusted. A reason outside [a-z_]{1,40} is dropped and the refusal stands. A sentence with a control character or an angle bracket, or longer than 300 characters, is replaced by the fixed sentence. On the redirect only, a sentence outside the character set RFC 6749 §4.1.2.1 allows for error_description (printable ASCII without the double quote and the backslash) is also replaced by the fixed sentence.
  • Why objectstack_error_reason. RFC 6749 §8.2 asks an extension parameter that is not registered to carry a vendor prefix, so it cannot collide with a registered name. The card's example, error_reason, is not free: some identity providers already send it with their own values.
  • The reason reaches the environment's sign-in page (item 3). The environment's OAuth callback (GET /callback/:id) rebuilds its error redirect from error and error_description only. One after-hook, carryRefusalReasonOnCallback (oauth-callback-refusal-reason.ts, called from auth-manager-after-hook.ts), puts the reason back on that redirect. It acts only when all of these hold: a GET of the platform identity provider's callback; the request's own query says error=access_denied and carries exactly one reason of the validated shape; the callback answered a redirect whose query says error=access_denied and carries no reason yet. The rest of the location is kept byte for byte. The organization's name is not a field anywhere: it travels only inside the host's sentence.
  • The Console's sentences (item 3). ssoCallbackRefusalMessage takes the reason: not_member and invitation_pending get their own sentences, under access_denied only. An unknown reason, no reason, or a reason beside another error code keeps today's sentence. Three keys are added in all eleven packs (real translations; zh-Hant regenerated by gen:zh-hant): auth.login.errors.ssoAccessDeniedNotMember, auth.login.errors.ssoAccessDeniedInvitationPending, auth.login.ssoHandoffClient.
  • The application's name on a hand-off (item 4). The sign-in page reads the client name only for the client its signed request names. New route GET /api/v1/auth/oauth2/client-name?client_id=CLIENT_ID&oauth_query=SIGNED_QUERY (oauth-client-name.ts, mounted in auth-plugin.ts, ledgered in auth-route-ledger.ts as public):
    • oauth_query must carry a signature this server made and that has not expired, checked by the provider's own verifyOAuthQueryParams; the session is never read;
    • the client is the single client_id inside the verified request, and the URL's client_id must equal it;
    • the answer is { client_name } and nothing else of the client;
    • a signature that does not verify or has expired, a mismatched client_id, an unknown client, a disabled client and a client with no name all answer the same 404; a parameter outside the closed set, a repeated one or a missing one answers 400;
    • it is rate-limited per client address (ADR-0121 D6), counted before anything is read; over the limit it answers 429 RATE_LIMIT_EXCEEDED with Retry-After.
      LoginPage asks it once on a signed hand-off and shows "Sign in to continue to NAME"; any other answer (refusal, network failure, another body shape, no signed request on the URL) keeps "Continue to HOST".
  • The registered-redirect_uri rule is unchanged: the redirect is followed exactly when it was before.

Tests

  • packages/plugins/plugin-auth/src/oauth-authorize-refusal.test.ts, over the file's real-AuthManager harness (real better-auth, the real oauth-provider):
    • items 1 and 2 as in round 1: the boolean CONTROL (envelope body, redirect parameters in order, page SHA-256 equal to the merge base's), reason and sentence pins on each door, the admitted set unchanged, the resume pass;
    • the client-name read: the matched client is served exactly { success: true, data: { client_name } }; a mismatched client_id is refused and the other client's name never appears; an unknown client, a disabled client, a signed request whose client_id was changed, and an expired one each get the same refusal as a mismatch; three malformed requests answer 400; the window's reads from one address answer, the next is refused with 429, RATE_LIMIT_EXCEEDED, Retry-After and no-store, and another address still answers;
    • the callback carry: an environment AuthManager with the platform identity provider and a second one, fed the provider's real refusal parameters. The reason lands on /_console/login beside error and error_description; CONTROL: a boolean refusal lands with no reason; not carried for a reason of another shape, a reason beside another error, a reason from the other identity provider, or two reasons.
  • auth-route-ledger.conformance.test.ts: the new route in the objectstack list.
  • Console: LoginPage.access-denied-32992.test.tsx gains a describe for the two reasons, an unknown reason and a reason beside another code. New LoginPage.handoff-client-name-34168.test.tsx: the name is shown and asked with the URL's client and the whole signed request; the host line stays on a 404, a network failure and a body of another shape; CONTROL: no signed request, nothing asked.
Ablations (each mutation landed on disk through scripts/ablation-replace.mjs; every restore read blob == HEAD and git diff HEAD empty; the subjects resolve from src, no build between legs)
Ablation (round 2, at fb0d4b052) Result
client-name: URL client_id no longer has to equal the signed one 1 failed (the mismatch pin)
client-name: disabled check removed 1 failed (disabled)
client-name: signature verification removed 1 failed (expired)
callback: platform-provider check removed 1 failed (other identity provider)
callback: reason shape check removed 1 failed (reason of another shape)
callback: exactly-one-reason check loosened 1 failed (two reasons)
callback: both access_denied checks removed (request held, redirect ablated) 1 failed (reason beside another error)
Console: reason read under any error code 1 failed (reason beside another code)
Console: client-name body shape loosened 1 failed (body of another shape)
client-name: rate limit removed (round 3, at 749c7a2ca) 1 failed (the rate-limit pin: expected 200 to be 429)

Round 1 (items 1 and 2) ablations stand as reported there: reason pattern 6 failed, sentence markup 2, sentence length 1, RFC charset 1, object truthiness 1, page escape 1.

Acceptance notes

  • A host may return the refusal object only once it runs this plugin-auth release or later: an older plugin-auth reads any object as truthy, which admits. The changeset says so.
  • The new route is rate-limited per client address: a fixed window of 10 reads per 60 seconds, counted before anything is read, in the kernel cache service when one is registered, as the signed-out invitation preview is (ADR-0121 D6). Over the limit it answers 429 RATE_LIMIT_EXCEEDED with Retry-After and Cache-Control: no-store.
  • The new route is an unauthenticated door, which ADR-0138 D2 asks to be recorded in an ADR amendment; docs/adr/** is outside this card's file surface, so that note is left to the seat.
  • The callback carry covers the GET callback. A provider that answers by form_post reaches POST /callback/:id, which the vendor re-issues as a GET rebuilt from its own known fields, so the reason would not survive that hop. The platform identity provider answers by query redirect, so this path is not exercised today.
  • The new types (OidcAuthorizeGateRefusal and the rest) are exported from their modules, not re-exported from the package index.
  • No packages/spec/src/** file is touched.

Verification

Round 3 (749c7a2ca) adds the rate limit and touches plugin-auth only, so the plugin-auth suite and typecheck were re-read there; the Console, i18n and derived-gate readings below are from fb0d4b052, whose ui/ tree is unchanged at 749c7a2ca.

plugin-auth suite and typecheck
  • After pnpm --filter '@objectstack/plugin-auth^...' build and the package's own build, under os-verify-lock: pnpm --filter @objectstack/plugin-auth test exit 0, Test Files 278 passed (278), Tests 5668 passed, 10 skipped.
  • pnpm --filter @objectstack/plugin-auth typecheck exit 0: all three legs (tsc --noEmit, tsconfig.examples.json, check:test-typecheck: "OK — @objectstack/plugin-auth's test layer compiles").
  • At fb0d4b052 the full workspace build (119 tasks) and pnpm check:dual-build-cjs-loads were green; round 3 adds no export and no new file.
Console and i18n

From ui/: pnpm exec vitest run over apps/console/src/pages/auth/, all-locales-key-parity, untranslated-identity-4376, en-zh-key-parity and the product-neutral ratchet: Test Files 39 passed (39), Tests 429 passed (429). turbo run type-check --filter=@object-ui/console: exit 0, 75 tasks successful. node scripts/check-i18n-en-drift.mjs: exit 0, "No en value changed in this range."

Derived gates

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack at fb0d4b052: 83 families, each run with stdin closed after the full build, reconciled with --ran (83 derived, 83 run). 82 exit 0, among them pnpm check:auth-mount-ledger and pnpm check:dual-build-cjs-loads ("123 published require entry point(s) across 72 package(s) load"). 1 NOT MEASURED: pnpm check:type-check-debt exit 3 (PREREQUISITE NOT MET: its own closure build did not get a turn on the shared verify lock), and two further locked tries timed out in the queue (exit 99); read from CI. PR-body gate: check-closing-keyword-parity --body on this body binds only Fixes #34168.

Merge-tree (throwaway bare clone, no merge driver)

git merge-tree --write-tree of 749c7a2ca against origin/main (951eceeee): exit 0, no conflicted path. #34257 has no pushed branch, so there is nothing to probe against.

Clause-② re-measured

yes (widening) holds: the gate option's return type widens, the envelope gains an optional reason, the redirects gain an optional parameter, one public, rate-limited read route is added, and three i18n keys are added. Nothing narrows: a boolean answer is byte-identical, and every existing route answers as before.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QsR2jVPGBoi3MCGoKbW1Hv

…s reason

oidcAuthorizeGate may answer { allowed: false, reason, message } in place of
false. The 403 envelope gains the validated reason and the host's sentence,
the redirect back sends the sentence as error_description plus the
objectstack_error_reason parameter, and the page shows the sentence escaped.
A boolean answer is delivered exactly as before.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jVPGBoi3MCGoKbW1Hv
…ct and the page

A boolean gate is pinned byte for byte as served at the merge base (CONTROL);
a refusal object's reason and sentence are pinned on each door, a reason
outside [a-z_]{1,40} is dropped, and a sentence that is not plain text within
the bound is replaced by the fixed sentence.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jVPGBoi3MCGoKbW1Hv
@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 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/plugin-auth, touching 54 documentable anchor(s).

57 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 0241df4d6b2dc9611b382c9269665e9493101e80.

⛔ 15 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 12 name(s) were too generic to anchor anything (single lowercase words)
  • 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 — 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 0241df4d6b2dc9611b382c9269665e9493101e80 → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json 0241df4d6b2dc9611b382c9269665e9493101e80

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

…ame the client on a hand-off

The environment's OAuth callback now keeps the host's validated refusal
reason on its redirect to the Console sign-in page, which maps not_member
and invitation_pending to their own sentences. The sign-in page reads the
client name only for the client its signed request names, through a new
plugin-auth read, and keeps the host line on any other answer.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jVPGBoi3MCGoKbW1Hv
@github-actions github-actions Bot added size/xl and removed size/m labels Nov 16, 2026
… callback answers with

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jVPGBoi3MCGoKbW1Hv
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jVPGBoi3MCGoKbW1Hv

Contract review

Served-tier: TIER_DEFAULT
Head-sha: fb0d4b052dde4dfccfc8ad85dd11fe4af3af6f52
Local-runs: none
Scope: plugin-auth (auth-manager.ts, auth-manager-before-hook.ts, auth-manager-after-hook.ts, auth-plugin.ts, auth-route-ledger.ts, oauth-authorize-refusal.ts, oauth-callback-refusal-reason.ts, oauth-client-name.ts), Console sign-in page and its two helpers, three i18n keys in eleven packs, tests, .changeset/34168-authorize-gate-refusal-reason.md

① Derived judgments

  • The face owed is the Clause-②: yes (widening) declaration alone: no packages/spec/src/** file, no governed path (check-governed-merges --pr 34265: 0 of 27 paths governed, 1291 lines), no narrowing line.
  • The gate seam widens its answer type only. An object refuses exactly when it says allowed: false; every other answer keeps the truthiness it was read with, so the admitted set is unchanged (pinned, with a boolean CONTROL whose three refusal replies are byte-identical to the merge base).
  • Every host value is validated before it is served: a reason outside the closed shape is dropped and the refusal stands; a sentence that fails the length, markup or (on the redirect) RFC 6749 §4.1.2.1 character rules is replaced by the fixed sentence. The page escapes it.
  • The callback carry only re-attaches a reason the refusal itself sent, on the platform identity provider's callback, under access_denied on both sides, and keeps the rest of the location byte for byte. Each condition has a red ablation in the body.
  • The new public read answers one field, and only for the client its signed request names; every other case answers one identical 404. The session is never read. It is ledgered public and the mount-ledger gate passes.
  • Each changeset sentence was checked against the diff: the refusal object, the envelope reason, the redirect parameter, the escaped page sentence, the validation rules, the callback carry, the two Console sentences, the client-name route, the unchanged boolean path, and the upgrade note.

② Semver level

patch for plugin-auth, console and i18n: an optional field, an optional redirect parameter, one read route and three keys are added; nothing an older caller sends or reads moves.

③ Boundary flags

  • Access boundary: who is admitted does not change. The new unauthenticated read discloses only a client's display name, only to a holder of a request this server signed for that client.
  • No served→refused change, so no !, BREAKING banner or ADR-0087 marker owed.
  • Open to the seat: the ADR-0138 D2 record of the new unauthenticated route and its ADR-0121 D6 posture (docs/adr/** is outside this card's surface).
  • Pins in card-named files; the round-2 ablations each go red on exactly one pin.

Implemented-by: claude/area-A1-34168
Reviewed-by: session_01QsR2jVPGBoi3MCGoKbW1Hv

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jVPGBoi3MCGoKbW1Hv

Request: review · PR #34265 · S1/A1 · Fixes #34168 · head fb0d4b0 · 2026-11-16T05:58Z

The area declares this head final. It carries all four items of the card:

  • the authorize gate may say why it refuses, and each refusal door carries the reason and the host's sentence, validated and escaped;
  • the environment's callback carries the reason on to its sign-in page, which shows a sentence for not_member and invitation_pending;
  • the sign-in page reads the client name only for the client its signed request names, and shows "Sign in to continue to NAME".

Clause-②: yes (widening), no spec face, not governed (0 of 27 paths, 1291 lines). The contract record is TIER_DEFAULT PASS 6908656441 at this head.

One read is owed: review-a's ACCEPT read at this head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTjrNnh6b2BkCXFugM
Review claim (review-a, S1) · head fb0d4b0 · 2026-11-16T06:00Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jVPGBoi3MCGoKbW1Hv

Superseded · PR #34265 · 2026-11-16T06:01Z

  • The contract record 6908656441 is withdrawn: an area does not record its own PR. The review thread writes the TIER_DEFAULT record with its review read.
  • The review request 6908671938 is withdrawn: by the seat's ruling, the new read route takes a rate limit in this PR first. A new request follows at the next final head.

…r client address

The read counts a fixed window per established client address before it
reads anything, in the same counter store the signed-out invitation preview
uses, and answers 429 RATE_LIMIT_EXCEEDED with Retry-After over the limit.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jVPGBoi3MCGoKbW1Hv
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTjrNnh6b2BkCXFugM

Claim withdrawn · review-a · head fb0d4b0 · 2026-11-16T06:02Z

The request was withdrawn (6908710779): a rate limit on the new read route comes first. At the next head the area declares final, review-a gives the L1 read and the TIER_DEFAULT record in one pass, reading the delta from fb0d4b0.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jVPGBoi3MCGoKbW1Hv

Request: review · PR #34265 · S1/A1 · Fixes #34168 · head 749c7a2 · 2026-11-16T07:32Z

The area declares this head final, green on every check (58 success, 12 skipped by path). It replaces the withdrawn request 6908671938. Since then, by the seat's ruling, the new signed-out read is rate-limited per client address with the invitation-preview window, pinned and ablated; one changeset sentence and the body follow. The ADR-0138 D2 text rides #34257 (claim amendment 6908701438).

It carries all four items of the card:

  • the authorize gate may say why it refuses, and each refusal door carries the reason and the host's sentence, validated and escaped;
  • the environment's callback carries the reason on to its sign-in page, which shows a sentence for not_member and invitation_pending;
  • the sign-in page reads the client name only for the client its signed request names.

Clause-②: yes (widening), no spec face, not governed.

Owed in one pass from the review thread: the review read and the TIER_DEFAULT contract record at this head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTjrNnh6b2BkCXFugM
Review claim (review-a, S1) · head 749c7a2 · 2026-11-16T07:32Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTjrNnh6b2BkCXFugM

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 749c7a2ca3fb18acbfa87c9e6b22e576824c4563
Local-runs: none

The face is the Clause-②: yes (widening) declaration alone. The diff touches no published schema and no governed path (packages/plugins/plugin-auth, ui/apps/console, ui/packages/i18n), and it declares no narrowing. Inputs: card #34168, the PR body and changeset, the net diff against merge base babda9d3, and the head's check-runs.

① Derived judgments

  • The gate's answer widens, and admission does not move: right. oidcAuthorizeGate may answer { allowed: false, reason, message } in place of false. An object refuses only on allowed === false. A boolean, and any other object, keeps the truthiness the gate was always read with, so nobody is admitted or refused differently. A boolean answer is byte-identical on all three doors, and the CONTROL pins say so.
  • Host text is never trusted as markup or as a URL part: right. reason must match [a-z_]{1,40}; otherwise it is dropped and the refusal stands. A message longer than 300 characters, or one holding a control character or an angle bracket, is replaced by the fixed sentence. On the redirect it must also fit the RFC 6749 §4.1.2.1 error_description charset. The page HTML-escapes it. The vendor-prefixed objectstack_error_reason follows RFC 6749 §8.2.
  • The callback carries one validated reason only: right. The platform-IdP callback keeps a valid objectstack_error_reason on its redirect to the Console sign-in page only under access_denied on both sides, with exactly one reason of the validated shape. The rest of the location is kept byte for byte. The Console maps not_member and invitation_pending to its own sentences in all eleven packs; anything else keeps the existing access_denied sentence.
  • The new signed-out route is closed and bounded: right. GET /oauth2/client-name answers a name only for the client its signed request names. Every other state gets one uniform 404, a parameter outside the closed set gets 400, and every answer is no-store. The route is ledgered public. At this head it is rate-limited per established client address, as ADR-0121 D6 asks of a door that admits an anonymous caller: 10 reads per 60 s, counted before anything is parsed or read, answering 429 RATE_LIMIT_EXCEEDED with Retry-After. That is line for line the signed-out invitation preview's window, with its own counter subject, wired in the same unconditional init() block.

② Semver level

Metadata-protocol: none holds: nothing a metadata author writes changes. Clause-②: yes (widening) holds: a host gains an answer shape and a client gains optional keys and one route; nothing accepted before is refused. This is not a protocol change, so patch is right on @objectstack/plugin-auth, @object-ui/console and @object-ui/i18n, the three packages moved. Check Changeset is green. No migration entry or ADR-0087 disposition is owed, and no Skills-docs: line is owed.

③ Boundary flags

  • Version skew is the one hazard, and the changeset states it. An older plugin-auth reads any object as an admission, so a host must not return the refusal object before it runs this release. The upgrade note says so.
  • Owed outside this diff: an ADR note for the new unauthenticated door. The PR's acceptance notes say ADR-0138 D2 asks for one and leave it to the seat, because docs/adr/** is outside the card's surface. It needs a carrier. It does not block this PR.
  • The callback carry covers the GET callback only. A form_post provider would lose the reason on the vendor's re-issued GET. The platform IdP answers by query redirect, so no caller reaches that path today.

Implemented-by: claude/area-A1-34168
Reviewed-by: session_01QsR2jTjrNnh6b2BkCXFugM

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTjrNnh6b2BkCXFugM

Review — PASS

Head-sha: 749c7a2ca3fb18acbfa87c9e6b22e576824c4563
Reviewer: review-a (S1) · 2026-11-16T07:36Z
Implemented-by: S1 area dev (claude/area-A1-34168)
Reviewed-by: session_01QsR2jTjrNnh6b2BkCXFugM
Diff base: babda9d3 (merge base with origin/main); 27 files, +1357/−29. I read the diff up to fb0d4b05 before the rate-limit round; this read covers that whole diff plus the round-3 delta (1a07deec, 749c7a2c).

What holds

  • Items 1 and 2: the gate's refusal can say why, without moving admission. gateAnswerRefuses refuses an object only on allowed === false and keeps truthiness for every other answer. refusalDetailOf validates the reason (^[a-z_]{1,40}$) and the sentence (at most 300 characters, no control characters or angle brackets, and on the redirect the RFC 6749 error_description charset), and falls back to the fixed sentence otherwise. The page escapes it. The boolean CONTROL pins hold the envelope, the redirect parameter order and the page bytes equal to the merge base's.
  • Item 3: the callback carry is narrow. It is a GET of the platform identity provider's callback, with error=access_denied on both the request and the redirect, exactly one reason of the validated shape, and no reason already present. The location is otherwise kept byte for byte. Each condition has its own ablation, and each ablation reds exactly its pin. The Console reads the reason only under access_denied, and all eleven packs carry real translations (zh-Hant generated).
  • Item 4: the application-name route. The signature is verified by the provider's own verifyOAuthQueryParams. The URL client_id must equal the single signed one. The client is read under system context for name and disabled only. Every failure gets one 404, the parameter set is closed, and every answer is no-store. The session is never read. The Console asks once, renders the name as text through i18n, and keeps the host line on any other answer.
  • Round 3: the seat's rate-limit ruling is met. answerOAuthClientName counts the per-address fixed window (10 per 60 s) before parsing, in the counter store the signed-out invitation preview uses, under its own subject. It answers 429 RATE_LIMIT_EXCEEDED with Retry-After and no-store. The counters are wired in the same unconditional init() block as the preview's, and the route fails closed (500) if they were never wired. The new pin covers the window, the 429 and a second address that still answers. Removing the limit reds it ("expected 200 to be 429").

Must

None.

Should

None for this PR. One carrier is owed outside the diff: the ADR-0138 D2 note recording the new unauthenticated door, which the PR leaves to the seat because docs/adr/** is outside the card. It is in the contract record's boundary flags.

Nits

  1. useHandoffClientName fetches with credentials: 'include', though the route never reads the session. 'omit' would state that intent.
  2. Callers whose address the server could not establish share one unestablished bucket, so behind a misconfigured proxy they can exhaust each other's window. That is the invitation preview's existing posture, and the page degrades to the host line, so the impact is cosmetic.
  3. The callback carry does not survive a form_post provider (stated in the PR). No caller reaches that path today.

Gates

70 check runs at this head (latest run of each): every one is success or skipped, none failed or pending. This includes Test Core 1–8/8, Test UI 1–16/16, Type Check UI, Lint UI, Build & E2E UI, Build Core, TypeScript Type Check, Lint & Repo Gates, Governed Surface Queue Guard and Check Changeset. The PR body records the plugin-auth suite (5668 passed) and typecheck at this head, and merge-tree against origin/main is clean.

The TIER_DEFAULT contract record for the widening is comment 6910359938 (PASS), written in the same pass.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jVPGBoi3MCGoKbW1Hv

席位核对 · ACCEPT · Head-sha: 749c7a2 · 2026-11-16T07:38Z

  • Review. review-a's read is PASS at this head (6910374232), with no Must or Should; three nits, none blocking.
  • Contract face. Clause-②: yes (widening), Metadata-protocol: none, no spec file. The TIER_DEFAULT record is PASS at this head (6910359938), written by the review thread. The area's own record 6908656441 is withdrawn (6908710779).
  • Card relation. Fixes #34168, all four items. The seat's rulings are met: the sign-in page reads the client name only for the client its signed request names; the new signed-out read is rate-limited per client address in this PR (ADR-0121 D6). The ADR-0138 D2 text for that read rides One-step invitation acceptance: the invitation mail carries a proof only the mailbox receives, and the accept page creates the account, verifies the address and accepts in one step #34257's ADR note (claim amendment 6908701438); a stand-alone ADR card is filed if One-step invitation acceptance: the invitation mail carries a proof only the mailbox receives, and the accept page creates the account, verifies the address and accepts in one step #34257 slips past the next release cut.
  • Changeset sentences checked against the diff (.changeset/34168-authorize-gate-refusal-reason.md):
    • The gate may answer { allowed: false, reason, message } in place of false (auth-manager.ts, the before-hook's refusal reading).
    • The 403 envelope keeps ENV_ACCESS_DENIED, gains reason, and carries the host's sentence; the redirect keeps error=access_denied, carries the sentence as error_description and adds objectstack_error_reason; the page shows the sentence escaped (oauth-authorize-refusal.ts, the per-door pins).
    • A reason outside the closed shape is dropped and the refusal stands; a sentence failing the markup, length or redirect character rules is replaced by the fixed sentence (pins and the round-1 ablations).
    • The platform identity provider's callback keeps a valid reason on its redirect to the sign-in page; the page shows its own sentence for not_member and invitation_pending, and keeps today's sentence otherwise (oauth-callback-refusal-reason.ts, ssoCallbackRefusal.ts, three keys in eleven packs, the callback and Console pins).
    • The sign-in page reads the client name only for the client its signed request names and says "Sign in to continue to NAME"; any other answer keeps the host line (oauth-client-name.ts, LoginPage.tsx, the hand-off pins).
    • The read is rate-limited per client address, 10 per 60 seconds; over the limit 429 RATE_LIMIT_EXCEEDED with Retry-After (the round-3 pin and its ablation).
    • Unchanged: a boolean answer is byte for byte as before on all three doors; who is admitted; which redirect_uri is followed (the boolean CONTROL and the admitted-set pin).
    • The upgrade note: an older plugin-auth reads any object as an admission.
  • Governed. check-governed-merges --pr 34265 reads NOT governed: 0 of 27 paths, +1357/−29.
  • Base. The Test Core affected-set diff base is 0241df4d. K is 4 first-parent commits to origin/main c9346317, below 15, so no branch update is owed.
  • Checks on this head. 58 success, 12 skipped (path-filtered), 0 red, 0 pending. The mergeable state is clean.
  • Landing. Area S1 lands it, on the maintainer's line in the area thread (2026-11-15T11:06Z). pr_ready and automerge_enable follow in this stroke.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 16, 2026 07:38
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/xl 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.

Auth: the environment-access refusal carries the host's reason, and the cloud sign-in page names the organization (client_name) on an OAuth hand-off

1 participant