Merge pull request #519 from singuliere/wip-create-user
randomly generated passwords must obey some constraints
This commit is contained in:
commit
a97673c6b2
@ -69,13 +69,20 @@ if __name__ == "__main__":
|
|||||||
# set a random password for all other users
|
# set a random password for all other users
|
||||||
for name, id in initial_users.items():
|
for name, id in initial_users.items():
|
||||||
if name != username:
|
if name != username:
|
||||||
|
specials = "@$!%*?&-_"
|
||||||
random_pass = "".join(
|
random_pass = "".join(
|
||||||
|
[
|
||||||
|
random.choice(string.ascii_uppercase),
|
||||||
|
random.choice(string.ascii_lowercase),
|
||||||
|
random.choice(string.digits),
|
||||||
|
random.choice(specials),
|
||||||
|
] +
|
||||||
random.choices(
|
random.choices(
|
||||||
string.ascii_uppercase
|
string.ascii_uppercase
|
||||||
+ string.ascii_lowercase
|
+ string.ascii_lowercase
|
||||||
+ string.digits
|
+ string.digits
|
||||||
+ "@$!%*?&-_",
|
+ specials,
|
||||||
k=16,
|
k=14,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
update_user(
|
update_user(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user