mirror of
https://github.com/jumpserver/jumpserver.git
synced 2026-01-15 14:47:24 +00:00
perf: Simplify login and MFA limit key templates by removing IP address
This commit is contained in:
@@ -139,7 +139,7 @@ class BlockUtilBase:
|
||||
username = username.lower() if username else ''
|
||||
self.username = username
|
||||
self.ip = ip
|
||||
self.limit_key = self.LIMIT_KEY_TMPL.format(username, ip)
|
||||
self.limit_key = self.LIMIT_KEY_TMPL.format(username)
|
||||
self.block_key = self.BLOCK_KEY_TMPL.format(username)
|
||||
self.key_ttl = int(settings.SECURITY_LOGIN_LIMIT_TIME) * 60
|
||||
|
||||
@@ -236,12 +236,12 @@ class BlockGlobalIpUtilBase:
|
||||
|
||||
|
||||
class LoginBlockUtil(BlockUtilBase):
|
||||
LIMIT_KEY_TMPL = "_LOGIN_LIMIT_{}_{}"
|
||||
LIMIT_KEY_TMPL = "_LOGIN_LIMIT_{}"
|
||||
BLOCK_KEY_TMPL = "_LOGIN_BLOCK_{}"
|
||||
|
||||
|
||||
class MFABlockUtils(BlockUtilBase):
|
||||
LIMIT_KEY_TMPL = "_MFA_LIMIT_{}_{}"
|
||||
LIMIT_KEY_TMPL = "_MFA_LIMIT_{}"
|
||||
BLOCK_KEY_TMPL = "_MFA_BLOCK_{}"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user