Page MenuHomePhabricator

[tunnelbroker] Implement WebPush client adapter
ClosedPublic

Authored by bartek on Jul 26 2024, 6:22 AM.
Tags
None
Referenced Files
F3387265: D12893.id42831.diff
Fri, Nov 29, 8:31 AM
F3387175: D12893.id42889.diff
Fri, Nov 29, 8:04 AM
F3386782: D12893.diff
Fri, Nov 29, 6:13 AM
Unknown Object (File)
Fri, Nov 8, 10:36 PM
Unknown Object (File)
Fri, Nov 8, 1:43 PM
Unknown Object (File)
Fri, Nov 8, 12:22 PM
Unknown Object (File)
Fri, Nov 8, 12:22 PM
Unknown Object (File)
Mon, Nov 4, 12:48 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
No Lint Coverage
Unit
No Test Coverage

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

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

15–16

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