|
75 |
return mlValue |
75 |
return mlValue |
76 |
|
76 |
|
77 |
|
77 |
|
|
|
78 |
password_charsets = [ |
79 |
'abcdefghijklmnopqrstuvwxyz', |
80 |
'ABCDEFGHIJKLMNOPQRSTUVWXYZ', |
81 |
'0123456789', |
82 |
'^!\$%&/()=?{[]}+~#-_.:,;<>|\\', |
83 |
] |
84 |
|
85 |
|
86 |
def generate_strong_password(length=24): |
87 |
pwd = [] |
88 |
charset = random.choice(password_charsets) |
89 |
while len(pwd) < length: |
90 |
pwd.append(random.choice(charset)) |
91 |
charset = random.choice(list(set(password_charsets) - set([charset]))) |
92 |
return "".join(pwd) |
93 |
|
94 |
|
78 |
def set_ucs_passwd_user(connector, key, ucs_object): |
95 |
def set_ucs_passwd_user(connector, key, ucs_object): |
79 |
''' |
96 |
''' |
80 |
set random password to fulfill required values |
97 |
set random password to fulfill required values |
81 |
''' |
98 |
''' |
82 |
ucs_object['password'] = str(int(random.random() * 100000000)) * 20 # at least 20 characters |
99 |
ucs_object['password'] = generate_strong_password() |
83 |
|
100 |
|
84 |
|
101 |
|
85 |
def check_ucs_lastname_user(connector, key, ucs_object): |
102 |
def check_ucs_lastname_user(connector, key, ucs_object): |