Merge pull request #18043 from mozilla/FXA-10777

This commit is contained in:
Dan Schomburg 2024-11-20 08:42:47 -08:00 коммит произвёл GitHub
Родитель 7c9c5559d5 fbba52068a
Коммит e482c1b550
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
3 изменённых файлов: 3 добавлений и 32 удалений

Просмотреть файл

@ -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);