feat: Add request rate limiter based on IP address (#8174)

This commit is contained in:
Daniel
2023-01-06 23:39:02 +11:00
committed by GitHub
parent 0eac5dc6d4
commit 6c79f6a69e
13 changed files with 713 additions and 50 deletions

View File

@@ -44,6 +44,7 @@ const nestedOptionEnvPrefix = {
SecurityOptions: 'PARSE_SERVER_SECURITY_',
SchemaOptions: 'PARSE_SERVER_SCHEMA_',
LogLevels: 'PARSE_SERVER_LOG_LEVELS_',
RateLimitOptions: 'PARSE_SERVER_RATE_LIMIT_',
};
function last(array) {
@@ -111,7 +112,9 @@ function processProperty(property, iface) {
}
let defaultValue;
if (defaultLine) {
defaultValue = defaultLine.split(' ')[1];
const defaultArray = defaultLine.split(' ');
defaultArray.shift();
defaultValue = defaultArray.join(' ');
}
let type = property.value.type;
let isRequired = true;