mirror of
https://github.com/Significant-Gravitas/AutoGPT-Code-Ability.git
synced 2026-11-10 08:01:27 -10:00
* refactor to use just one db cred generator * add the actual file * codium suggestions using secrets instead
10 lines
347 B
Python
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
|