Skip to content

Commit bd6eb59

Browse files
author
szachovy
committed
Fix password charset to be URI-safe
PR #121 strengthened the password but used string.punctuation which includes > + [ ] @ : / and other chars that are invalid or require percent-encoding in a MySQL URI (used in mysql-mgmt --bootstrap and SQLAlchemy connection strings). Restrict to alphanumeric only: 24 chars of [A-Za-z0-9] gives ~143 bits of entropy which is sufficient.
1 parent e594bad commit bd6eb59

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/crypto.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def generate_mysql_root_password() -> str:
6565

6666
@staticmethod
6767
def generate_mysql_superset_password() -> str:
68-
charset = string.ascii_letters + string.digits + "!@#$%&*-_=+[]<>?"
68+
charset = string.ascii_letters + string.digits
6969
return "".join(secrets.choice(charset) for _ in range(24))
7070

7171
@staticmethod

0 commit comments

Comments
 (0)