From b06ee3eaef9966391246ac399a54841458a7cb30 Mon Sep 17 00:00:00 2001
From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com>
Date: Sun, 23 Nov 2025 13:20:26 +0100
Subject: [PATCH 1/2] fix
---
src/Options/Definitions.js | 3 ++-
src/Options/docs.js | 2 +-
src/Options/index.js | 18 ++++++++----------
3 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/src/Options/Definitions.js b/src/Options/Definitions.js
index 1ae9512823..dbc129287c 100644
--- a/src/Options/Definitions.js
+++ b/src/Options/Definitions.js
@@ -690,7 +690,8 @@ module.exports.RateLimitOptions = {
zone: {
env: 'PARSE_SERVER_RATE_LIMIT_ZONE',
help:
- "The type of rate limit to apply. The following types are supported:
- `global`: rate limit based on the number of requests made by all users
- `ip`: rate limit based on the IP address of the request
- `user`: rate limit based on the user ID of the request
- `session`: rate limit based on the session token of the request
:default: 'ip'",
+ 'The type of rate limit to apply. The following types are supported:
- `global`: rate limit based on the number of requests made by all users
- `ip`: rate limit based on the IP address of the request
- `user`: rate limit based on the user ID of the request
- `session`: rate limit based on the session token of the request
',
+ default: 'ip',
},
};
module.exports.SecurityOptions = {
diff --git a/src/Options/docs.js b/src/Options/docs.js
index cdbd06de45..d4253d2d89 100644
--- a/src/Options/docs.js
+++ b/src/Options/docs.js
@@ -122,7 +122,7 @@
* @property {String[]} requestMethods Optional, the HTTP request methods to which the rate limit should be applied, default is all methods.
* @property {String} requestPath The path of the API route to be rate limited. Route paths, in combination with a request method, define the endpoints at which requests can be made. Route paths can be strings, string patterns, or regular expression. See: https://expressjs.com/en/guide/routing.html
* @property {Number} requestTimeWindow The window of time in milliseconds within which the number of requests set in `requestCount` can be made before the rate limit is applied.
- * @property {String} zone The type of rate limit to apply. The following types are supported:
- `global`: rate limit based on the number of requests made by all users
- `ip`: rate limit based on the IP address of the request
- `user`: rate limit based on the user ID of the request
- `session`: rate limit based on the session token of the request
:default: 'ip'
+ * @property {String} zone The type of rate limit to apply. The following types are supported:- `global`: rate limit based on the number of requests made by all users
- `ip`: rate limit based on the IP address of the request
- `user`: rate limit based on the user ID of the request
- `session`: rate limit based on the session token of the request
*/
/**
diff --git a/src/Options/index.js b/src/Options/index.js
index 81dbc3c536..772e76c542 100644
--- a/src/Options/index.js
+++ b/src/Options/index.js
@@ -370,16 +370,14 @@ export interface RateLimitOptions {
/* Optional, the URL of the Redis server to store rate limit data. This allows to rate limit requests for multiple servers by calculating the sum of all requests across all servers. This is useful if multiple servers are processing requests behind a load balancer. For example, the limit of 10 requests is reached if each of 2 servers processed 5 requests.
*/
redisUrl: ?string;
- /*
- The type of rate limit to apply. The following types are supported:
-
- - `global`: rate limit based on the number of requests made by all users
- - `ip`: rate limit based on the IP address of the request
- - `user`: rate limit based on the user ID of the request
- - `session`: rate limit based on the session token of the request
-
- :default: 'ip'
- */
+ /* The type of rate limit to apply. The following types are supported:
+
+ - `global`: rate limit based on the number of requests made by all users
+ - `ip`: rate limit based on the IP address of the request
+ - `user`: rate limit based on the user ID of the request
+ - `session`: rate limit based on the session token of the request
+
+ :DEFAULT: ip */
zone: ?string;
}
From 1d4c5311e490e98823316958e267c2077f651bbd Mon Sep 17 00:00:00 2001
From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com>
Date: Sun, 23 Nov 2025 13:53:06 +0100
Subject: [PATCH 2/2] add default
---
src/Options/Definitions.js | 2 +-
src/Options/docs.js | 2 +-
src/Options/index.js | 1 +
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/Options/Definitions.js b/src/Options/Definitions.js
index dbc129287c..6eeff0ed57 100644
--- a/src/Options/Definitions.js
+++ b/src/Options/Definitions.js
@@ -690,7 +690,7 @@ module.exports.RateLimitOptions = {
zone: {
env: 'PARSE_SERVER_RATE_LIMIT_ZONE',
help:
- 'The type of rate limit to apply. The following types are supported:- `global`: rate limit based on the number of requests made by all users
- `ip`: rate limit based on the IP address of the request
- `user`: rate limit based on the user ID of the request
- `session`: rate limit based on the session token of the request
',
+ 'The type of rate limit to apply. The following types are supported:- `global`: rate limit based on the number of requests made by all users
- `ip`: rate limit based on the IP address of the request
- `user`: rate limit based on the user ID of the request
- `session`: rate limit based on the session token of the request
Default is `ip`.',
default: 'ip',
},
};
diff --git a/src/Options/docs.js b/src/Options/docs.js
index d4253d2d89..03fa9cc981 100644
--- a/src/Options/docs.js
+++ b/src/Options/docs.js
@@ -122,7 +122,7 @@
* @property {String[]} requestMethods Optional, the HTTP request methods to which the rate limit should be applied, default is all methods.
* @property {String} requestPath The path of the API route to be rate limited. Route paths, in combination with a request method, define the endpoints at which requests can be made. Route paths can be strings, string patterns, or regular expression. See: https://expressjs.com/en/guide/routing.html
* @property {Number} requestTimeWindow The window of time in milliseconds within which the number of requests set in `requestCount` can be made before the rate limit is applied.
- * @property {String} zone The type of rate limit to apply. The following types are supported:- `global`: rate limit based on the number of requests made by all users
- `ip`: rate limit based on the IP address of the request
- `user`: rate limit based on the user ID of the request
- `session`: rate limit based on the session token of the request
+ * @property {String} zone The type of rate limit to apply. The following types are supported:- `global`: rate limit based on the number of requests made by all users
- `ip`: rate limit based on the IP address of the request
- `user`: rate limit based on the user ID of the request
- `session`: rate limit based on the session token of the request
Default is `ip`.
*/
/**
diff --git a/src/Options/index.js b/src/Options/index.js
index 772e76c542..11ab00a00f 100644
--- a/src/Options/index.js
+++ b/src/Options/index.js
@@ -377,6 +377,7 @@ export interface RateLimitOptions {
`user`: rate limit based on the user ID of the request
`session`: rate limit based on the session token of the request
+ Default is `ip`.
:DEFAULT: ip */
zone: ?string;
}