mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 04:37:40 +00:00
fix(security): enforce trusted sender auth for discord moderation
This commit is contained in:
@@ -329,4 +329,22 @@ describe("message tool sandbox passthrough", () => {
|
||||
const call = mocks.runMessageAction.mock.calls[0]?.[0];
|
||||
expect(call?.sandboxRoot).toBeUndefined();
|
||||
});
|
||||
|
||||
it("forwards trusted requesterSenderId to runMessageAction", async () => {
|
||||
mockSendResult({ to: "discord:123" });
|
||||
|
||||
const tool = createMessageTool({
|
||||
config: {} as never,
|
||||
requesterSenderId: "1234567890",
|
||||
});
|
||||
|
||||
await tool.execute("1", {
|
||||
action: "send",
|
||||
target: "discord:123",
|
||||
message: "hi",
|
||||
});
|
||||
|
||||
const call = mocks.runMessageAction.mock.calls[0]?.[0];
|
||||
expect(call?.requesterSenderId).toBe("1234567890");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user