|
63 |
if type(mlValue) == type([]): |
63 |
if type(mlValue) == type([]): |
64 |
return [make_lower(x) for x in mlValue] |
64 |
return [make_lower(x) for x in mlValue] |
65 |
return mlValue |
65 |
return mlValue |
66 |
|
66 |
|
|
|
67 |
password_charsets = [ |
68 |
'abcdefghijklmnopqrstuvwxyz', |
69 |
'ABCDEFGHIJKLMNOPQRSTUVWXYZ', |
70 |
'0123456789', |
71 |
'^!\$%&/()=?{[]}+~#-_.:,;<>|\\', |
72 |
] |
73 |
|
74 |
def generate_strong_password(length=20): |
75 |
pwd = [] |
76 |
charset = random.choice(password_charsets) |
77 |
while len(pwd) < length: |
78 |
pwd.append(random.choice(charset)) |
79 |
charset = random.choice(list(set(password_charsets) - set([charset]))) |
80 |
return "".join(pwd) |
81 |
|
67 |
def set_ucs_passwd_user(s4connector, key, ucs_object): |
82 |
def set_ucs_passwd_user(s4connector, key, ucs_object): |
68 |
''' |
83 |
''' |
69 |
set random password to fulfill required values |
84 |
set random password to fulfill required values |
70 |
''' |
85 |
''' |
71 |
ucs_object['password'] = str(int(random.random()*100000000))*8 # at least 8 characters |
86 |
ucs_object['password'] = generate_strong_password() |
72 |
|
87 |
|
73 |
def check_ucs_lastname_user(s4connector, key, ucs_object): |
88 |
def check_ucs_lastname_user(s4connector, key, ucs_object): |
74 |
''' |
89 |
''' |