Merge pull request #2009 from frnknstn/throttle_settings

put account create and login throttle parameters in the settings files
This commit is contained in:
Griatch 2020-01-07 10:41:14 +01:00 committed by GitHub
commit 8c4979c7ca
2 changed files with 10 additions and 2 deletions

View file

@ -57,8 +57,10 @@ _CMDSET_ACCOUNT = settings.CMDSET_ACCOUNT
_MUDINFO_CHANNEL = None
# Create throttles for too many account-creations and login attempts
CREATION_THROTTLE = Throttle(limit=2, timeout=10 * 60)
LOGIN_THROTTLE = Throttle(limit=5, timeout=5 * 60)
CREATION_THROTTLE = Throttle(limit=settings.CREATION_THROTTLE_LIMIT,
timeout=settings.CREATION_THROTTLE_TIMEOUT)
LOGIN_THROTTLE = Throttle(limit=settings.LOGIN_THROTTLE_LIMIT,
timeout=settings.LOGIN_THROTTLE_TIMEOUT)
class AccountSessionHandler(object):

View file

@ -651,6 +651,12 @@ CLIENT_DEFAULT_HEIGHT = 45
# (excluding webclient with separate help popups). If continuous scroll
# is preferred, change 'HELP_MORE' to False. EvMORE uses CLIENT_DEFAULT_HEIGHT
HELP_MORE = True
# Set rate limits per-IP on account creations and login attempts
CREATION_THROTTLE_LIMIT = 2
CREATION_THROTTLE_TIMEOUT = 10 * 60
LOGIN_THROTTLE_LIMIT = 5
LOGIN_THROTTLE_TIMEOUT = 5 * 60
######################################################################
# Guest accounts