зеркало из https://github.com/mozilla/fxa.git
Merge pull request #18043 from mozilla/FXA-10777
This commit is contained in:
Коммит
e482c1b550
|
@ -40,6 +40,7 @@ const ACCOUNT_STATUS_ACTION = {
|
|||
accountStatusCheck: true,
|
||||
sendUnblockCode: true,
|
||||
recoveryKeyExists: true,
|
||||
getCredentialsStatus: true,
|
||||
};
|
||||
|
||||
// Actions that send an email, and hence might make
|
||||
|
|
|
@ -163,7 +163,7 @@ module.exports = function (fs, path, url, convict) {
|
|||
},
|
||||
maxAccountStatusCheck: {
|
||||
doc: 'Number of account status checks within rateLimitIntervalSeconds before throttling',
|
||||
default: 5,
|
||||
default: 20,
|
||||
format: 'nat',
|
||||
env: 'MAX_ACCOUNT_STATUS_CHECK',
|
||||
},
|
||||
|
@ -414,33 +414,6 @@ module.exports = function (fs, path, url, convict) {
|
|||
},
|
||||
tracing: tracingConfig,
|
||||
userDefinedRateLimitRules: {
|
||||
getCredentialsStatusRules: {
|
||||
actions: {
|
||||
doc: 'Array of actions that this rule should be applied to',
|
||||
default: ['getCredentialsStatus'],
|
||||
format: Array,
|
||||
},
|
||||
limits: {
|
||||
max: {
|
||||
doc: 'max actions during `period` that can occur before rate limit is applied',
|
||||
format: 'nat',
|
||||
default: 120,
|
||||
env: 'GET_CREDENTIALS_STATUS_RULE_MAX',
|
||||
},
|
||||
periodMs: {
|
||||
doc: 'period needed before rate limit is reset',
|
||||
format: 'duration',
|
||||
default: '60 seconds',
|
||||
env: 'GET_CREDENTIALS_STATUS_RULE_PERIOD_MS',
|
||||
},
|
||||
rateLimitIntervalMs: {
|
||||
doc: 'how long rate limit is applied',
|
||||
format: 'duration',
|
||||
default: '15 minutes',
|
||||
env: 'GET_CREDENTIALS_STATUS_RULE_LIMIT_INTERVAL_MS',
|
||||
},
|
||||
},
|
||||
},
|
||||
totpCodeRules: {
|
||||
actions: {
|
||||
doc: 'Array of actions that this rule should be applied to',
|
||||
|
|
|
@ -19,16 +19,13 @@ function randomIp() {
|
|||
}
|
||||
|
||||
const config = require('../../lib/config').getProperties();
|
||||
config.userDefinedRateLimitRules.getCredentialsStatusRules.limits.max = 2;
|
||||
config.userDefinedRateLimitRules.getCredentialsStatusRules.limits.periodMs = 1000;
|
||||
config.userDefinedRateLimitRules.getCredentialsStatusRules.limits.rateLimitIntervalMs = 1000;
|
||||
config.userDefinedRateLimitRules.totpCodeRules.limits.periodMs = 1000;
|
||||
config.userDefinedRateLimitRules.totpCodeRules.limits.rateLimitIntervalMs = 1000;
|
||||
config.userDefinedRateLimitRules.tokenCodeRules.limits.max = 2;
|
||||
config.userDefinedRateLimitRules.tokenCodeRules.limits.periodMs = 1000;
|
||||
config.userDefinedRateLimitRules.tokenCodeRules.limits.rateLimitIntervalMs = 1000;
|
||||
|
||||
const ACTIONS = ['verifyTotpCode', 'verifyTokenCode', 'getCredentialsStatus'];
|
||||
const ACTIONS = ['verifyTotpCode', 'verifyTokenCode'];
|
||||
|
||||
const testServer = new TestServer(config);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче