perf: 优化系统用户生成密码的复杂度 (#5648)

* perf: 优化系统用户生成密码的复杂度

* perf: 修改 common.random_string

Co-authored-by: ibuler <ibuler@qq.com>
Co-authored-by: Bai <bugatti_it@163.com>
This commit is contained in:
fit2bot
2021-03-01 18:40:07 +08:00
committed by GitHub
parent 1036d1c132
commit 6f3ead3c42
5 changed files with 37 additions and 14 deletions

View File

@@ -11,7 +11,7 @@ from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from common.utils.common import timeit
from common.utils import random_string
from common.utils import (
ssh_key_string_to_obj, ssh_key_gen, get_logger, lazyproperty
)
@@ -205,8 +205,8 @@ class AuthMixin:
self.save()
@staticmethod
def gen_password():
return str(uuid.uuid4())
def gen_password(length=36):
return random_string(length, special_char=True)
@staticmethod
def gen_key(username):