feat: Add zones for rate limiting by ip, user, session, global (#8508)

This commit is contained in:
Daniel
2023-06-09 21:27:56 +10:00
committed by GitHub
parent e2a7218f74
commit 03fba97e05
9 changed files with 161 additions and 3 deletions

View File

@@ -601,6 +601,11 @@ module.exports.RateLimitOptions = {
'The window of time in milliseconds within which the number of requests set in `requestCount` can be made before the rate limit is applied.',
action: parsers.numberParser('requestTimeWindow'),
},
zone: {
env: 'PARSE_SERVER_RATE_LIMIT_ZONE',
help:
"The type of rate limit to apply. The following types are supported:<br><br>- `global`: rate limit based on the number of requests made by all users <br>- `ip`: rate limit based on the IP address of the request <br>- `user`: rate limit based on the user ID of the request <br>- `session`: rate limit based on the session token of the request <br><br><br>:default: 'ip'",
},
};
module.exports.SecurityOptions = {
checkGroups: {