Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix after #665: assert read-file-bytes stays out of the device-link allowlist

Lizi0cc7bd9e766a
diff --git a/packages/device-link/src/__tests__/allowlist.test.ts b/packages/device-link/src/__tests__/allowlist.test.ts
index 640fbda66e..da454f2630 100644
--- a/packages/device-link/src/__tests__/allowlist.test.ts
+++ b/packages/device-link/src/__tests__/allowlist.test.ts
@@ -123,6 +123,9 @@ describe('REMOTE_INVOKE_ALLOWLIST', () => {
it('放行窄口径文本文件预览(只读 + 大小上限 + forbidden/oversize reason)', () => {
expect(REMOTE_INVOKE_ALLOWLIST.has('text-file:read-preview')).toBe(true);
expect(REMOTE_INVOKE_ALLOWLIST.has('read-file-for-attachment')).toBe(false);
+ // 同理:read-file-bytes 回整个文件的原始字节(PDF 预览用),调用方永远是被控端
+ // 本机 renderer,远程控制端不需要、也不得拿到这条通道。
+ expect(REMOTE_INVOKE_ALLOWLIST.has('read-file-bytes')).toBe(false);
});
it('放行 /goal 远程(goal-host 在被控端,per-session 业务写)', () => {