Skip to content

Commit 6c79f6a

Browse files
authored
feat: Add request rate limiter based on IP address (parse-community#8174)
1 parent 0eac5dc commit 6c79f6a

13 files changed

+713
-50
lines changed

package-lock.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"cors": "2.8.5",
3333
"deepcopy": "2.1.0",
3434
"express": "4.18.2",
35+
"express-rate-limit": "6.6.0",
3536
"follow-redirects": "1.15.2",
3637
"graphql": "16.6.0",
3738
"graphql-list-fields": "2.0.2",
@@ -48,6 +49,7 @@
4849
"mongodb": "4.10.0",
4950
"mustache": "4.2.0",
5051
"parse": "3.4.2",
52+
"path-to-regexp": "0.1.7",
5153
"pg-monitor": "1.5.0",
5254
"pg-promise": "10.12.1",
5355
"pluralize": "8.0.0",
@@ -97,8 +99,8 @@
9799
"mock-mail-adapter": "file:spec/dependencies/mock-mail-adapter",
98100
"mongodb-runner": "4.8.1",
99101
"mongodb-version-list": "1.0.0",
100-
"node-fetch": "3.2.10",
101102
"node-abort-controller": "3.0.1",
103+
"node-fetch": "3.2.10",
102104
"nyc": "15.1.0",
103105
"prettier": "2.0.5",
104106
"semantic-release": "17.4.6",

resources/buildConfigDefinitions.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const nestedOptionEnvPrefix = {
4444
SecurityOptions: 'PARSE_SERVER_SECURITY_',
4545
SchemaOptions: 'PARSE_SERVER_SCHEMA_',
4646
LogLevels: 'PARSE_SERVER_LOG_LEVELS_',
47+
RateLimitOptions: 'PARSE_SERVER_RATE_LIMIT_',
4748
};
4849

4950
function last(array) {
@@ -111,7 +112,9 @@ function processProperty(property, iface) {
111112
}
112113
let defaultValue;
113114
if (defaultLine) {
114-
defaultValue = defaultLine.split(' ')[1];
115+
const defaultArray = defaultLine.split(' ');
116+
defaultArray.shift();
117+
defaultValue = defaultArray.join(' ');
115118
}
116119
let type = property.value.type;
117120
let isRequired = true;

0 commit comments

Comments
 (0)