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