You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Activity
baozhoutao commentedon Jul 20, 2026
定性确认:遗漏(bug),不是故意设计
对照代码逐条查证后,结论是 发送端接线遗漏,issue 的根因分析成立:
ApiDataSource诞生的 commit(3856bdd4e)就带fetch/defaultHeaders构造参数,resolveDataSource也原样透传;但全仓库 grep 下来没有任何调用方传过这两个参数——唯一生产调用点ObjectGantt.tsx第三参缺省,useViewData的adapterOptions无任何使用者。设计了插座、没插插头。createAuthenticatedFetch()(packages/auth/src/createAuthenticatedFetch.ts)就是干这事的:附Authorization: Bearer+X-Tenant-ID+Accept-Language。console 在AdapterProvider.tsx把它注入了 ObjectStackAdapter(原生链路),ApiDataSource 这条链路被漏掉。若「api 数据源不带凭证」是刻意行为,不会出现同一宿主两条链路一条接了一条没接。docs/adr/与 plugin 文档中 provider:'api' 示例对鉴权只字未提。影响面比 issue 描述再多两项
裸 fetch 不止丢
Authorization,还丢:X-Tenant-ID—— 多租户环境下 provider:'api' 端点连租户路由头都没有;Accept-Language—— 服务端本地化同样双轨。修复注意点(同源守卫)
provider:'api' 的 URL 可指向任意第三方外部 API,库层默认裸 fetch 是安全的(盲附 bearer 会泄漏平台 token)。但现有
createAuthenticatedFetch的判断是/\/api\//i.test(url),对https://third-party.com/api/x这类跨域绝对 URL 也会附 token——接给 ApiDataSource 时必须加一道同源(或平台 baseUrl 前缀)守卫,否则修 401 的同时引入 token 外泄面。修复方向(即将开工)
按 issue 建议落地:
SchemaRendererContext增加可选宿主级认证 fetch(apiFetch),useViewData/ObjectGantt在provider:'api'时默认取用,console 宿主接线为带同源守卫的认证 fetch;上下文未提供时维持现状(裸 fetch + cookie),向后兼容。feat(data): thread the host's authenticated fetch into provider:'api'…
fix(app-shell): action runtime builds sameOriginOnly authenticated fe…