mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-07 18:31:04 +00:00
perf: 优化校验密码规则 特殊字符校验
This commit is contained in:
@@ -95,7 +95,7 @@ def check_password_rules(password, is_org_admin=False):
|
|||||||
if settings.SECURITY_PASSWORD_NUMBER:
|
if settings.SECURITY_PASSWORD_NUMBER:
|
||||||
pattern += '(?=.*\d)'
|
pattern += '(?=.*\d)'
|
||||||
if settings.SECURITY_PASSWORD_SPECIAL_CHAR:
|
if settings.SECURITY_PASSWORD_SPECIAL_CHAR:
|
||||||
pattern += '(?=.*[`~!@#\$%\^&\*\(\)-=_\+\[\]\{\}\|;:\'\",\.<>\/\?])'
|
pattern += '(?=.*[`~!@#$%^&*()\-=_+\[\]{}|;:\'",.<>/?])'
|
||||||
pattern += '[a-zA-Z\d`~!@#\$%\^&\*\(\)-=_\+\[\]\{\}\|;:\'\",\.<>\/\?]'
|
pattern += '[a-zA-Z\d`~!@#\$%\^&\*\(\)-=_\+\[\]\{\}\|;:\'\",\.<>\/\?]'
|
||||||
if is_org_admin:
|
if is_org_admin:
|
||||||
min_length = settings.SECURITY_ADMIN_USER_PASSWORD_MIN_LENGTH
|
min_length = settings.SECURITY_ADMIN_USER_PASSWORD_MIN_LENGTH
|
||||||
|
Reference in New Issue
Block a user