Skip to content

fix: load database credentials from environment - #179

Open
huba-bh wants to merge 1 commit into
OpenHUTB:mainfrom
huba-bh:fix/database-credentials-env
Open

huba-bh wants to merge 1 commit into
OpenHUTB:mainfrom
huba-bh:fix/database-credentials-env

Conversation

@huba-bh

@huba-bh huba-bh commented Oct 18, 2026

Copy link
Copy Markdown

Summary\n- Load MySQL connection settings through a small configuration helper.\n- Require TRAFFIC_TWIN_DB_USER and TRAFFIC_TWIN_DB_PASSWORD from the environment instead of embedding a root password in source.\n- Document optional host, port, and database settings.\n- Add unit and AST regression tests that prevent a password literal from being passed to connect() again.\n\n## Impact\nThe repository published a reusable database password and encouraged every deployment to use the same privileged account (CWE-798). The secret should also be rotated and removed from deployment history after this change is adopted.\n\n## Validation\n- python -m unittest discover -s tests -p test_database_config.py -v\n- 5 tests passed in Ubuntu 22.04 under VMware.

@donghaiwang
donghaiwang requested a review from liuao08 October 18, 2026 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants