Add a content security policy and expire mailed export links.

Responses had no CSP, the 48-hour download token never changed, and short share slugs could be guessed without a miss limit.
This commit is contained in:
adilallo committed 2026-11-21 11:46:16 -07:00
1 parent 0fe2624002
commit 75649a9a42
18 files changed
+249 -19

No files matched your search

+4 -1
View File
@@ -49,6 +49,7 @@ describe("sendDueRuleFollowUpEmails", () => {
{
id: "rule-1",
title: "Garden Norms",
exportTokenVersion: 0,
user: { email: "pen@example.com" },
},
]);
@@ -85,7 +86,7 @@ describe("sendDueRuleFollowUpEmails", () => {
it("skips rows with no mailbox and does not mark them sent", async () => {
findManyMock.mockResolvedValueOnce([
{ id: "rule-2", title: "Guest", user: { email: "" } },
{ id: "rule-2", title: "Guest", exportTokenVersion: 0, user: { email: "" } },
]);
const result = await sendDueRuleFollowUpEmails(db as never);
expect(result.skipped).toBe(1);
@@ -98,6 +99,7 @@ describe("sendDueRuleFollowUpEmails", () => {
{
id: "rule-4",
title: "Race",
exportTokenVersion: 0,
user: { email: "pen@example.com" },
},
]);
@@ -112,6 +114,7 @@ describe("sendDueRuleFollowUpEmails", () => {
{
id: "rule-3",
title: "Retry",
exportTokenVersion: 0,
user: { email: "pen@example.com" },
},
]);