mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-03 20:00:25 +00:00
security(feishu): bind doc create grants to trusted requester context (#31184)
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
28
src/agents/openclaw-tools.plugin-context.test.ts
Normal file
28
src/agents/openclaw-tools.plugin-context.test.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
const resolvePluginToolsMock = vi.fn(() => []);
|
||||
|
||||
vi.mock("../plugins/tools.js", () => ({
|
||||
resolvePluginTools: (params: unknown) => resolvePluginToolsMock(params),
|
||||
}));
|
||||
|
||||
import { createOpenClawTools } from "./openclaw-tools.js";
|
||||
|
||||
describe("createOpenClawTools plugin context", () => {
|
||||
it("forwards trusted requester sender identity to plugin tool context", () => {
|
||||
createOpenClawTools({
|
||||
config: {} as never,
|
||||
requesterSenderId: "trusted-sender",
|
||||
senderIsOwner: true,
|
||||
});
|
||||
|
||||
expect(resolvePluginToolsMock).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
context: expect.objectContaining({
|
||||
requesterSenderId: "trusted-sender",
|
||||
senderIsOwner: true,
|
||||
}),
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user