Skip to main content

Module deliver

Module deliver 

Source
Expand description

Delivering an alert to one channel, and checking a channel’s target when it is saved.

HTTP channels (Slack, Discord, webhook) are user-supplied URLs, so every request goes through the crawler’s address guard: check_url on the URL, a client whose resolver drops private and internal addresses, no redirects (a public URL that 302s to localhost is an error, never followed), no proxy, and a 10 second timeout.

Structs§

GuardedHttp
The HTTP side of delivery: a client plus the address policy it was built for, so the two can’t drift apart. Build it once per process and keep it (the job context, the web settings page).

Enums§

ChannelKind
ChannelTarget
Where a channel delivers to. Slack and Discord URLs carry a token, and a webhook has a secret, so Debug shows hosts only.
DeliveryError
TargetError

Functions§

deliver
Delivers msg to one channel. HTTP channels check the URL with the address guard first, then post through http’s guarded client.