mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-08-11 11:02:41 +00:00
Merge pull request #12343 from jumpserver/pr@dev@perf_password_rules
perf: 优化校验密码规则 特殊字符校验
This commit is contained in:
commit
d92736e624
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user