bank: wrap pleasechangeme with random prefix and suffix
This commit is contained in:
parent
8318a590e9
commit
2519c8844b
1 changed files with 4 additions and 4 deletions
|
|
@ -129,11 +129,11 @@ def _rand_username() -> str:
|
|||
|
||||
|
||||
def _rand_password() -> str:
|
||||
# Always embed "pleasechangeme" so users know to set their own later.
|
||||
# Suffix: readable, no ambiguous 0/O/1/l.
|
||||
# Embed "pleasechangeme" with random material before and after.
|
||||
alphabet = "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789"
|
||||
suffix = "".join(secrets.choice(alphabet) for _ in range(8))
|
||||
return "pleasechangeme" + suffix
|
||||
prefix = "".join(secrets.choice(alphabet) for _ in range(4))
|
||||
suffix = "".join(secrets.choice(alphabet) for _ in range(6))
|
||||
return prefix + "pleasechangeme" + suffix
|
||||
|
||||
|
||||
def create_personal_account() -> dict:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue