fix(review): accept canary/ptb Discord hosts in loop-escalation webhook validation (#9288) - #9390
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
…ok validation loop-escalation-wire's ALLOWED_DISCORD_HOSTS listed only discord.com and discordapp.com, while its two sibling validators (alerts.ts, notify-discord.ts) accept the wider, correct four-host set. A valid canary.discord.com or ptb.discord.com DISCORD_WEBHOOK_URL was silently dropped as invalid_global_webhook. Align the constant with the siblings; the host allowlist previously had zero test coverage, now covered directly.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9390 +/- ##
===========================================
- Coverage 89.46% 75.42% -14.05%
===========================================
Files 836 276 -560
Lines 109597 58114 -51483
Branches 26100 6208 -19892
===========================================
- Hits 98055 43830 -54225
- Misses 10279 14014 +3735
+ Partials 1263 270 -993
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-27 15:59:22 UTC
Review summary Nits — 2 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Problem
Closes #9288.
src/review/loop-escalation-wire.ts'sALLOWED_DISCORD_HOSTSlisted onlydiscord.comanddiscordapp.com, while the two sibling Discord-webhook validators accept the wider, correct set:src/review/alerts.ts—discord.com,discordapp.com,canary.discord.com,ptb.discord.comsrc/services/notify-discord.ts— the identical four-host setSo
isValidDiscordWebhooksilently rejected a validcanary.discord.comorptb.discord.comDISCORD_WEBHOOK_URL— the notification was dropped asinvalid_global_webhookwith no indication to the operator. The host allowlist had zero test coverage.Fix
Align
ALLOWED_DISCORD_HOSTSwith the four-host set the siblings already use (with a comment noting the byte-faithful parity). No other change toisValidDiscordWebhook's protocol/path validation;alerts.tsandnotify-discord.tsare untouched. The validator is exported so the allowlist can be tested directly.Test
test/unit/loop-escalation-wire.test.tsadds direct coverage: all four hosts (including canary/ptb, case-insensitively) are accepted, while non-Discord hosts, non-https, wrong paths, and malformed URLs are still rejected. Reverting the constant drops the canary/ptb assertions.