-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add aesgcm support back, and fix some firefox bugs (#44)
* Add back support for the legacy aesgcm cypher. It appears some services still rely on it, so here it is. Unlike the old pre 0.8.0 version, we now rely on Mozilla's ECE crate, which is much better tested. * Add aesgcm tests. * update example. * Update docs. * Always add a dummy JWT subs filed, since without it FireFox gives 401 errors. This isn't actually required by the standard, so this quite surprising to me. * Better clarify that aesgcm should not be used unless truly needed. * Bump to 0.9.5 * Format Rust code using rustfmt --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
5f1af38
commit 994b683
Showing
7 changed files
with
146 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[package] | ||
name = "web-push" | ||
description = "Web push notification client with support for http-ece encryption and VAPID authentication." | ||
version = "0.9.4" | ||
version = "0.9.5" | ||
authors = ["Julius de Bruijn <[email protected]>", "Andrew Ealovega <[email protected]>"] | ||
license = "Apache-2.0" | ||
homepage = "https://github.com/pimeys/rust-web-push" | ||
|
@@ -26,7 +26,7 @@ serde = "^1.0" | |
serde_json = "^1.0" | ||
serde_derive = "^1.0" | ||
jwt-simple = "0.11.2" | ||
ece = "^2.1" | ||
ece = "^2.2" | ||
pem = "1.1.0" | ||
sec1_decode = "^0.1.0" | ||
base64 = "^0.13" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,13 @@ impl VapidSigner { | |
claims.custom.remove("exp"); | ||
} | ||
|
||
// Add sub if not provided as some browsers (like firefox) require it even though the API doesn't say its needed >:[ | ||
if !claims.custom.contains_key("sub") { | ||
claims = claims.with_subject("mailto:[email protected]".to_string()); | ||
} | ||
|
||
log::trace!("Using jwt: {:?}", claims); | ||
|
||
let auth_k = key.public_key(); | ||
|
||
//Generate JWT signature | ||
|