fix: remove hardcoded Discord webhook URL from dependencies.py (#19) #56
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#56
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "ai/major-domo-database-19"
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
send_webhook_message()inapp/dependencies.py:484os.environ.get("DISCORD_WEBHOOK_URL")—oswas already importedFalseinstead of crashing at request timeFiles Changed
app/dependencies.py— line 484: hardcoded URL → env var readTest Results
No test suite. Verified fix by reading back the modified file — the webhook URL literal is gone and the function correctly falls back to
Falsewhen the env var is absent.Other observations
DISCORD_WEBHOOK_URLwill need to be added todocker-compose.prod.ymland the dev server env forsend_webhook_message()to function.AI Code Review
Files Reviewed
app/dependencies.py(modified)Findings
Correctness
os.environ.get("DISCORD_WEBHOOK_URL")replaces the hardcoded URL;oswas already imported at module level.if not webhook_url: ... return False) correctly handles bothNone(env var unset) and""(set to empty string) — both are falsy.loggeris module-level (logger = logging.getLogger("discord_app"), line 14) and in scope at the call site.boolremains consistent — all paths returnTrueorFalse.send_webhook_messageare unchanged.Security
7RXG_D5IqovA3Jwa9YOobUjVcVMuLc6cQyezABcWuXaHo5Fvz1en10M7J43o3OJ3bzGW) is removed from HEAD. No credentials remain in the source.Style & Conventions
Suggestions
DISCORD_WEBHOOK_URLtodocker-compose.prod.ymland the dev server.envsosend_webhook_message()is functional (noted in PR body — just confirming it's the right call).Verdict: APPROVED
Clean security fix. The credential is correctly moved to an environment variable with an appropriate fail-fast guard. Rotate the Discord webhook token to fully close the exposure from git history.
Automated review by Claude PR Reviewer
Checkout
From your project repository, check out a new branch and test the changes.