fix: [role_manager] add password characters

This commit is contained in:
Terrtia 2019-07-05 15:23:16 +02:00
parent add0a95814
commit 8483ec8f90
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0

View file

@ -66,7 +66,7 @@ def login_analyst(func):
############################################################### ###############################################################
############################################################### ###############################################################
def gen_password(length=30, charset="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()"): def gen_password(length=30, charset="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_!@#$%^&*()"):
random_bytes = os.urandom(length) random_bytes = os.urandom(length)
len_charset = len(charset) len_charset = len(charset)
indices = [int(len_charset * (byte / 256.0)) for byte in random_bytes] indices = [int(len_charset * (byte / 256.0)) for byte in random_bytes]