Commit f92ba8b9 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_subscription_request: Generate a password that always comply with the Authentication Policy

The password is re-set anyway later, however it is required to comply to Authentication Policy, generating an acceptable value.
parent e675f4cd
Pipeline #9570 failed with stage
in 0 seconds
...@@ -23,13 +23,20 @@ person = portal.person_module.newContent( ...@@ -23,13 +23,20 @@ person = portal.person_module.newContent(
portal_type="Person", portal_type="Person",
first_name=name) first_name=name)
password = [random.choice(string.upper(string.ascii_letters)),
random.choice(string.lower(string.ascii_letters)),
random.choice(string.digits),
random.choice("$!*#%$.;:,")]
chars = string.ascii_letters + string.digits + '!@#$%^&*()' chars = string.ascii_letters + string.digits + '!@#$%^&*()'
password.extend([random.choice(chars) for _ in range(26)])
random.shuffle(password)
login = person.newContent( login = person.newContent(
portal_type="ERP5 Login", portal_type="ERP5 Login",
reference=person.getUserId(), reference=person.getUserId(),
# Please generate a LAAARGE random password. password=''.join(password))
password=''.join(random.choice(chars) for i in range(13)))
login.validate() login.validate()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment