fix(review): accept canary/ptb Discord hosts in loop-escalation webhook validation (#9288) - #9325
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.
❌ 2 Tests Failed:
View the top 2 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
|
Caution 🛑 LoopOver review result - fixes requiredReview updated: 2026-07-27 13:18:52 UTC
Review summary Nits — 2 non-blocking
CI checks failing
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.
|
|
LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-tests)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |
Problem
Closes #9288.
src/review/loop-escalation-wire.ts'sALLOWED_DISCORD_HOSTSlisted onlydiscord.comanddiscordapp.com, while the two sibling Discord-webhook validators in this repo 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. There was no comment justifying a narrower scope, and 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.