add rate limit to all email-sending endpoints

This commit is contained in:
x032205
2025-05-09 11:29:53 -04:00
parent 428c60880a
commit e9d8979cf4
8 changed files with 33 additions and 6 deletions
+9 -1
View File
@@ -104,6 +104,14 @@ export const publicSshCaLimit: RateLimitOptions = {
export const invalidateCacheLimit: RateLimitOptions = {
timeWindow: 60 * 1000,
hook: "preValidation",
max: 1,
max: 2,
keyGenerator: (req) => req.realIp
};
// Makes spamming "request access" harder, preventing email DDoS
export const requestAccessLimit: RateLimitOptions = {
timeWindow: 60 * 1000,
hook: "preValidation",
max: 10,
keyGenerator: (req) => req.realIp
};