Skip to content

Commit

Permalink
Merge pull request #18043 from mozilla/FXA-10777
Browse files Browse the repository at this point in the history
  • Loading branch information
dschom authored Nov 20, 2024
2 parents 7c9c555 + fbba520 commit e482c1b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 32 deletions.
1 change: 1 addition & 0 deletions packages/fxa-customs-server/lib/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 1 addition & 28 deletions packages/fxa-customs-server/lib/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
Expand Down Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit e482c1b

Please sign in to comment.