Expand description
Web Push delivery (kernel spec §6; plan 10b-ii): drain the notice queue
(push::Notices), apply each notice’s hat policy, and send it to every
subscription of the owner’s, encrypted to the browser (RFC 8291) and
signed with the collector’s VAPID key (RFC 8292).
Requests go out through a Transport. The collector’s is the shared
egress client, public addresses only (kernel spec §7.1, plan 8b): spawn
takes it from an Egress itself, so no caller can hand delivery another.
Tests use a fake one, or an InternalNetwork client to a push service on
loopback.
Structs§
- Delivery
- Delivers notices: see the module docs.
- Push
Request - One push, ready to send.
- Retry
Policy - When to try again, and how long to wait.
Enums§
Constants§
- MAX_
IN_ FLIGHT - Subscriptions sent to at once, per notice.
- MAX_
PLAINTEXT - The most plaintext one push carries: RFC 8291’s 4096-byte body, less the 86-byte header, the 16-byte tag and the padding delimiter.
- PAD_TO
- The plaintext is padded with spaces to a multiple of this, so its size tells the push service little of the title (plan 10a’s review).
- PUSH_
TTL_ SECS - How long a push service keeps a notification it could not deliver yet (kernel spec §6: one hour).
Traits§
- Transport
- Sends one push request. The collector’s sends through the egress client
(
PublicOnly); never one that reaches a private address.
Functions§
- padded
payloadas JSON, padded with trailing spaces (still valid JSON) to the next multiple ofPAD_TO, at mostMAX_PLAINTEXT.Errfor one that cannot fit, which the notices’ caps rule out.- payload_
for - The notice’s payload under
policy, orNonefor a muted hat (kernel spec §6;Notice’s documented rules): - spawn
- Start the collector’s delivery: a queue, and a task draining it through
egress’s public-only client (kernel spec §6, §7.1: Web Push never reaches a private address). The queue’s sending end isAppState::push.