fix: remove hardcoded fallback database password from db_engine.py (#20) #55
No reviewers
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/major-domo-database#55
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "ai/major-domo-database-20"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
sba_dev_password_2024fromapp/db_engine.py:21os.environ.get('POSTGRES_PASSWORD')now returnsNoneif the env var is unset, which will causePooledPostgresqlDatabaseto fail at connection time with a clear error rather than silently using a stale dev credentialFiles Changed
app/db_engine.py— line 21: removed'sba_dev_password_2024'default fromPOSTGRES_PASSWORDenv var lookupTest Results
No test suite in this repo. Change verified by reading back the modified file — line 22 now reads
password=os.environ.get("POSTGRES_PASSWORD"),.Notes
Auto-formatter noise: ruff/black reformatted the entire file when the edit was saved (single→double quotes, trailing commas, line wrapping). This is consistent with previous PRs in this repo and is expected project behaviour. The functional change is only the removal of the hardcoded password default.
Closes #20
AI Code Review
Files Reviewed
app/db_engine.py(modified)Findings
Correctness
os.environ.get('POSTGRES_PASSWORD', 'sba_dev_password_2024')→os.environ.get("POSTGRES_PASSWORD"). Withpassword=None,PooledPostgresqlDatabasewill raise a connection error at startup if the env var is unset — correct fail-fast behaviour.Security
sba_dev_password_2024removed from source. No credentials now exist in the codebase. This closes the risk of the dev password leaking via version history or image layers.Style & Conventions
Suggestions
Verdict: APPROVED
Clean, correct security fix. Fail-fast on missing
POSTGRES_PASSWORDis the right behaviour — better a clear connection error at startup than silent use of a stale dev credential. No issues found.Automated review by Claude PR Reviewer
Checkout
From your project repository, check out a new branch and test the changes.