Repository navigation
fix(ui): plugin same-server reads and me/localization carry the stored bearer - #37489
Conversation
…; me/localization carries the stored bearer The share dialog and the chatbot hooks (agents, models, pending actions, in-chat approvals) send through SchemaRendererProvider's apiFetch, the field selector read goes through createAuthenticatedFetch, and the me/localization boot read states the stored bearer in its init on all three legs (index.html, the seed, the provider). Claude-Session: https://claude.ai/code/session_01Utp6Ca6EBDpTBZk8v46Jjv Co-authored-by: Claude <noreply@anthropic.com>
…rer reads under a bearer-only session Claude-Session: https://claude.ai/code/session_01Utp6Ca6EBDpTBZk8v46Jjv Co-authored-by: Claude <noreply@anthropic.com>
… bearer-only session; changesets Claude-Session: https://claude.ai/code/session_01Utp6Ca6EBDpTBZk8v46Jjv Co-authored-by: Claude <noreply@anthropic.com>
… signed-out answer Claude-Session: https://claude.ai/code/session_01Utp6Ca6EBDpTBZk8v46Jjv Co-authored-by: Claude <noreply@anthropic.com>
…er has Claude-Session: https://claude.ai/code/session_01Utp6Ca6EBDpTBZk8v46Jjv Co-authored-by: Claude <noreply@anthropic.com>
…ollection Claude-Session: https://claude.ai/code/session_01Utp6Ca6EBDpTBZk8v46Jjv Co-authored-by: Claude <noreply@anthropic.com>
…ugin-bearer-fetch
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head f66978d · 2026-11-26T09:13Z |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract reviewServed-tier: PR #37489 · card #37225 · declaration face ( ① Derived judgmentsSecurity (auth plumbing).
Card acceptance. Each listed site is converted or recorded (6 converted plus localization; the 8 "already on host apiFetch" and 2 injection-only readings hold at the head). The localization share key is pinned against the real Findings.
No must-fix. ② Semver level
Four changesets, all ③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X 席位核对Head-sha:
|
…arrow changeset scope The seed and the provider now read the stored token through TokenStorage, so a storage-blocked embed still sends the token sign-in kept in memory (index.html stays on localStorage). Pinned with a memory-fallback case. The changesets now name the scope actually fixed (same-origin), say that split-origin requests still go without the token, and note header precedence. The field selector encodes the object name into its path. Claude-Session: https://claude.ai/code/session_01Utp6Ca6EBDpTBZk8v46Jjv Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract reviewServed-tier: PR #37489 · card #37225 · declaration face ( Check-runs on this head: 62 runs — 46 success, 15 skipped, 1 cancelled, 0 failed. The cancelled one is the first ① Derived judgmentsSecurity, re-read on the delta. Nothing in the first record's reading changes. The delta moves one token read from The delta.
Cards, each read against the finding it carries. All five are open,
Findings, status at this head.
No must-fix. Every should-fix is closed or carried by an open card. ② Semver level
Four changesets, all ③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X 席位核对Head-sha:
|
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Security label: |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X
Landing on seat ACCEPT 7189296371, which sits on the same-head delta PASS 7189281366. The maintainer named this PR on the seat thread's decision card: 「合并 #37489」 on 「合并已 ACCEPT 的非受管 PR #37489(插件请求带登录令牌)吗?」, 2026-11-26T10:35Z. Action: ready + auto-merge. Closes #37225 on merge. |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 45803113341 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
Fixes #37225
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
The renderer packages' same-server reads sent the bare global fetch with the cookie only, so a session held by its bearer token alone was answered as anonymous. Every site the card lists is now converted or recorded with its reason:
SchemaRendererContext.apiFetch(the console builds it ascreateAuthenticatedFetch({ sameOriginOnly: true })), falling back to the global fetch with no host.credentials: 'include'stays, so cookie sessions are unchanged. No renderer package gains a dependency on@object-ui/auth(layering perui/AGENTS.md; no cycle introduced).fetchFieldSelectorOptions) goes throughcreateAuthenticatedFetch(); app-shell already depends on auth.index.htmlseed request,languageSeed.fetchAndCacheSeed, andLocalizationFetchProvider. Both TS legs build the init through one helper,meLocalizationInit(preferred), so the in-flight share key (inflightGetKey) still matches between the seed and the provider. The helper reads the token throughTokenStorage.get(), so a storage-blocked embed still sends the token sign-in kept in memory;index.htmlruns before the bundle and stays onlocalStorage(rework round 1, S5).encodeURIComponent-encoded into/api/v1/objects/NAME/fields(rework round 1, N3; not separately pinned, since the helper is module-private).sameServerFetch.bearer.ratchet.test.ts): it now scans everyui/packages/*/srcplus the console, and names the nine renderer packages explicitly so a dropped root fails loudly. A new arm counts a global fetch on a written/api/literal with no init, or with an inline init withoutcredentials, as bare. The allow list stays shrink-only: the LocalizationFetchProvider row is removed (now 0 found), and two rows are added for sites read and recorded:auth/LoginForm.tsx(SSO sign-in, before any session exists) andpermissions/MePermissionsProvider.tsx(thefetcher ?? fetchfallback; the console passes the authenticated fetch).Sites recorded but not converted, because they already ride the host's authenticated fetch (
apiFetch ?? fetch, with the reason in their header docs): useRecordCrudVerdicts, useRowApprovalLocks, useRecordEditable, stageChangeStarts, queueClaim, ObjectChart, DatasetWidget, ReportDateRange. Injection only, with no bare fallback: preferenceOptions, ShareableObjectRefField.Tests
New pins (bearer-only server double, each with a cookie-only control)
app-shell/src/console/rendererFetch.bearerSession-37225.test.tsx: ShareDialog list, useAgents, useAiModels, usePendingActions (list + approve) and useHitlInChat (decide), each mounted in aSchemaRendererProviderthat carries the console's composition. With a stored token, the request carriesAuthorization: Bearer TOKENbesidecredentials: 'include'. CONTROL, with no token: cookie-only, the 401 is refused, and it reaches the session-ended event.FieldSelectorWidget.loadFailure.test.tsx: a new describe for the bearer-only session, plus a cookie-only control.console/src/__tests__/sessionCheckBootDedup.test.tsx: a cold load sends one me/localization request carrying the bearer; the share key of the slot equalsmeLocalizationInit('zh-CN')and contains the authorization header; on a later boot with a cached seed, the provider alone sends the bearer. CONTROL, no token: two requests, neither carrying Authorization. CONTROL, a token stored after parse: the second request carries it.headers(the authenticated fetch readsset-auth-tokenoff every response), and two gained the module-top collection importscheck:test-source-aliasasks for.Readings (head f66978d)
pnpm --dir ui exec vitest run scripts/: 172 passed, 2 skipped.Ablations (restored through ablation-replace; blob equals HEAD; git diff HEAD empty)
meLocalizationInit: the 4 bearer cases go red and the cookie control stays green. 4 failed / 49 passed.storedToken()reverted fromTokenStorage.get()to the directlocalStorageread: only the new memory-fallback pin goes red. 1 failed / 53 passed.Acceptance notes
createAuthenticatedFetch. The renderer packages instead send through the host'sapiFetch. In the console that host fetch iscreateAuthenticatedFetch({ sameOriginOnly: true }), sosameOriginOnlyand the settle signal are applied once, at the host, and the renderer packages stay free of an auth dependency. The cost: a host that mounts no provider stays cookie-only.Authorizationa caller passes, and that the host's tenant and language headers ride these calls (N1)./api/v1/objects/NAME/fields. No server route registers that path, and no form in either tree declares the widget, so it is dormant. Read only, not filed.VITE_AI_BASE_URL/ server URL goes bare through thesameOriginOnlyhost fetch, as the card allows.Follow-up cards (rework round 1)
same-origin) and thereacthost fallbacks: 同服务器令牌棘轮:别名、拼接 URL、spread 参数等写法数漏,react 宿主回退仍走裸 fetch(接 #37225) #37505data-objectstackuploads andmetadata-clientbypassing the injected fetch: data-objectstack:上传文件和 metadata-client 绕过注入的 fetch,纯令牌会话下被当匿名(接 #37225) #37506createAuthClient(auth lane): @object-ui/auth:createAuthClient 里 3 处同服务器请求不带令牌,逐个判定(接 #37225) #37507Verification
Two minutes:
pnpm --dir ui exec vitest run --maxWorkers=2 packages/app-shell/src/console/rendererFetch.bearerSession-37225.test.tsx. Expect 7 passed: each bearer case carriesBearer stored-session-token, and each control goes out cookie-only.Read first, by risk:
ui/apps/console/src/languageSeed.ts:meLocalizationInit. The share key between the seed and the provider depends on both legs building the same headers.ui/packages/app-shell/src/sameServerFetch.bearer.ratchet.test.ts: the widened roots and the new bare-literal arm.ui/apps/console/index.html: the early seed script reads the token in a try block.Generated by Claude Code