Remove hardcoded Discord webhook URL from dependencies.py #19

Open
opened 2026-02-20 06:49:32 +00:00 by cal · 1 comment
Owner

app/dependencies.py:484 — The send_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

`app/dependencies.py:484` — The `send_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
cal added the
ai-working
label 2026-03-06 02:00:59 +00:00
cal removed the
ai-working
label 2026-03-06 02:02:33 +00:00
Author
Owner

PR #56 opened: #56

Fix: Replaced the hardcoded Discord webhook URL literal in send_webhook_message() with os.environ.get("DISCORD_WEBHOOK_URL"). Added an early-return guard that logs an error and returns False if the env var is not set. os was already imported — no new dependencies.

Note: DISCORD_WEBHOOK_URL will need to be added to docker-compose.prod.yml and the dev server environment for the function to send messages.

PR #56 opened: https://git.manticorum.com/cal/major-domo-database/pulls/56 **Fix**: Replaced the hardcoded Discord webhook URL literal in `send_webhook_message()` with `os.environ.get("DISCORD_WEBHOOK_URL")`. Added an early-return guard that logs an error and returns `False` if the env var is not set. `os` was already imported — no new dependencies. Note: `DISCORD_WEBHOOK_URL` will need to be added to `docker-compose.prod.yml` and the dev server environment for the function to send messages.
cal added the
ai-pr-opened
label 2026-03-06 02:02:39 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cal/major-domo-database#19
No description provided.