pimeys / rust-web-push

A Web Push library for Rust
Apache License 2.0
113 stars 21 forks source link

Implement aes128gcm, remove legacy code, add exactor agnostic client, update docs, and more. #30

Closed andyblarblar closed 3 years ago

andyblarblar commented 3 years ago

This PR finishes and builds upon the work done in #23 by fully implementing Aes128Gcm and making numerus other improvements to the API. This PR should reduce this crate's complexity considerably though the ece delegation and removal of legacy APIs. My hope is that these changes should make it easier to maintain this crate long term now that the web push API is stable and rust async is much more mature.

Changelog 📝

Additions

[+] - Full aes128gcm support via ece crate. Credit to @tiesselune for this. See #23 for more. Closes #3. [+] - Isahc based default client to remove Tokio dependency. Separate changes from #25 but similar effect, although Isahc works on any executor as it uses curl under the hood. [+] - Cargo feature to enable the old hyper client. [+] - Generic build_request() to allow for custom clients using the http crate's generic request body. This function is also exported now. This should enable someone to make a say, ureq web push client crate, without our input. [+] - Add function to create a VAPID builder without a sub, allowing for key material to be reused. [+] - Method to get the public key bytes from a Vapid signature (useful for sending the key to client without messing with openssl). [+] - Improved tests and added one to actually test the encryption itself. [+] - Expand documentation throughout the code base, and update docs to accurately reflect the current web push API. [+] - Bump to v0.8

Deletions

[-] - Remove all aesgcm code. This significantly reduces maintenance by reducing tests and removes concerns of deprecation. This is possible because of aes128gcm's universal support. [-] - Remove old GCM/FCM code. This is redundant now that web push is standardized.

Breaking Changes ⚠

Notes

The documentation generation for docs.rs will probably need to be modified now that features are being used.

All tests pass and confirmed working on Chrome, Firefox, and chromium Edge. You can see it working (potentially, my project still has some bugs 😅) in a personal project here.

Sorry if I'm breaking GitHub etiquette with this PR, these changes were originally designed for myself, so the PR ended up being gigantic. Credit again to @tiesselune for doing the bulk of the ece transition, this PR is really just expanding on his work.

pimeys commented 3 years ago

Oh wow! Sorry, I've been on vacations and currently catching up at work. I'll take a look into this later today hopefully, so we get it merged and new release out.

pimeys commented 3 years ago

v0.8.0 published.