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 ⚠
WebPushClient::new() now returns a Result as the Isahc client has a fallible constructor. This has been applied to both clients to keep the API the same, although the hyper client is infallible.
Removal of all gcm/fcm methods on builders. I believe the FCM crate may be a valid upgrade path if FCM is heavily used.
Removal of ContentEncoding::AesGcm. Because all tested APIs support (and in the case of Edge only supports) Aes128Gcm, consumers should simply replace the variant with ContentEncoding::Aes128Gcm.
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.
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.
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 ⚠
WebPushClient::new()
now returns aResult
as the Isahc client has a fallible constructor. This has been applied to both clients to keep the API the same, although the hyper client is infallible.ContentEncoding::AesGcm
. Because all tested APIs support (and in the case of Edge only supports) Aes128Gcm, consumers should simply replace the variant withContentEncoding::Aes128Gcm
.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.