Remove hardcoded Discord webhook URL from dependencies.py
#19
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#19
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
app/dependencies.py:484— Thesend_webhook_message()function contains a full Discord webhook URL (including the secret token) hardcoded as a string literal. Discord webhook URLs contain a private token. This is committed to version control.Priority: high | Labels: security
PR #56 opened: #56
Fix: Replaced the hardcoded Discord webhook URL literal in
send_webhook_message()withos.environ.get("DISCORD_WEBHOOK_URL"). Added an early-return guard that logs an error and returnsFalseif the env var is not set.oswas already imported — no new dependencies.Note:
DISCORD_WEBHOOK_URLwill need to be added todocker-compose.prod.ymland the dev server environment for the function to send messages.