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)
Sun, Dec 22, 6:02 PM
Unknown Object (File)
Sun, Dec 22, 6:02 PM
Unknown Object (File)
Sun, Dec 22, 6:02 PM
Unknown Object (File)
Sun, Dec 22, 6:02 PM
Unknown Object (File)
Wed, Dec 11, 10:15 PM
Unknown Object (File)
Fri, Nov 29, 8:31 AM
Unknown Object (File)
Fri, Nov 29, 8:04 AM
Unknown Object (File)
Fri, Nov 29, 6:13 AM
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