Page MenuHomePhabricator

[tunnelbroker] Implement WebPush client adapter
ClosedPublic

Authored by bartek on Jul 26 2024, 6:22 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 4, 12:48 PM
Unknown Object (File)
Sep 25 2024, 5:16 PM
Unknown Object (File)
Sep 25 2024, 5:15 PM
Unknown Object (File)
Sep 25 2024, 5:15 PM
Unknown Object (File)
Sep 25 2024, 5:13 PM
Unknown Object (File)
Sep 18 2024, 4:51 PM
Unknown Object (File)
Sep 18 2024, 12:26 AM
Unknown Object (File)
Sep 16 2024, 12:07 PM
Subscribers

Details

Summary

Implemented wrapper over web_push client, that handles VAPID signing and proper payload creation for us.
Configured it to use hyper backend, which is the same what we use for other push services (reqwest uses it under the hood).

Test Plan

Cargo build.
Tested together with the rest of the stack

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Jul 26 2024, 6:39 AM
bartek added inline comments.
services/tunnelbroker/src/notifs/web_push/mod.rs
14 ↗(On Diff #42831)

We don't use the config anywhere outside new(), but I decided to keep it, for consistency with other push services.

15–16 ↗(On Diff #42831)

Both are intended to be created once and cloned when used.

  • HyperWebPushClient is generally expensive to create, but cheap to clone
  • VapidSignatureBuilder can pre-compute some values once, basing on the private key. A full signature is then built separately for each request, when keys from SubscriptionInfo (device token) are supplied
This revision is now accepted and ready to land.Jul 29 2024, 2:09 AM