Files
Aarushi 36c6b0022b refactor to use just one db cred generator (#241)
* refactor to use just one db cred generator

* add the actual file

* codium suggestions using secrets instead
2024-04-25 15:42:45 +00:00

10 lines
347 B
Python

import string
import secrets
def generate_db_credentials(username_prefix="user", password_length=16):
username = f"{username_prefix}{secrets.randbelow(9999)}"
characters = string.ascii_letters + string.digits + "!@#$%^&*()"
password = "".join(secrets.choice(characters) for i in range(password_length))
return username, password