mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-27 02:52:48 +00:00
feat: enhance password regex for improved security and clarity
This commit is contained in:
parent
86da8918f5
commit
bb4ad680fc
|
|
@ -35,9 +35,12 @@ from django.core.mail import send_mail
|
|||
from django.utils.translation import get_language
|
||||
|
||||
PASSWORD_REGEX = re.compile(
|
||||
r"^(?=.*[a-z])(?=.*[_!@#$%^&*`~.()-+=])"
|
||||
r"(?:(?=.*[A-Z])|(?=.*\d))"
|
||||
r"[a-zA-Z0-9_!@#$%^&*`~.()-+=]{6,20}$"
|
||||
r"^" # 开始
|
||||
r"(?=.*[a-z])" # 至少一个小写字母
|
||||
r"(?=.*[-_!@#$%^&*`~.()+=])" # 至少一个指定的特殊字符
|
||||
r"(?:(?=.*[A-Z])|(?=.*\d))" # 至少一个大写字母 或 数字
|
||||
r"[a-zA-Z0-9-_!@#$%^&*`~.()+=]{6,20}" # 总长度6~20个合法字符
|
||||
r"$" # 结束
|
||||
)
|
||||
|
||||
version, get_key = Cache_Version.SYSTEM.value
|
||||
|
|
|
|||
Loading…
Reference in New Issue