mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 22:28:27 +00:00
fix(security): fail closed parsed chat allowlist
This commit is contained in:
@@ -71,6 +71,14 @@ describe("imessage targets", () => {
|
||||
expect(ok).toBe(true);
|
||||
});
|
||||
|
||||
it("denies when allowFrom is empty", () => {
|
||||
const ok = isAllowedIMessageSender({
|
||||
allowFrom: [],
|
||||
sender: "+1555",
|
||||
});
|
||||
expect(ok).toBe(false);
|
||||
});
|
||||
|
||||
it("formats chat targets", () => {
|
||||
expect(formatIMessageChatTarget(42)).toBe("chat_id:42");
|
||||
expect(formatIMessageChatTarget(undefined)).toBe("");
|
||||
|
||||
Reference in New Issue
Block a user