fix(security): fail closed parsed chat allowlist

This commit is contained in:
Peter Steinberger
2026-02-21 19:51:07 +01:00
parent 09d5f508b1
commit 9632b9bcf0
5 changed files with 199 additions and 5 deletions

View File

@@ -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("");