mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-06-18 23:38:20 +00:00
Upgrade jsonwebtoken dependency.
Since v9 setting the audience is mandatory.
This commit is contained in:
20
Cargo.lock
generated
20
Cargo.lock
generated
@ -2282,13 +2282,14 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "jsonwebtoken"
|
name = "jsonwebtoken"
|
||||||
version = "8.3.0"
|
version = "9.2.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378"
|
checksum = "5c7ea04a7c5c055c175f189b6dc6ba036fd62306b58c66c9f6389036c503a3f4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.21.5",
|
"base64 0.21.5",
|
||||||
"pem 1.1.1",
|
"js-sys",
|
||||||
"ring 0.16.20",
|
"pem",
|
||||||
|
"ring 0.17.7",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"simple_asn1",
|
"simple_asn1",
|
||||||
@ -2905,15 +2906,6 @@ version = "0.1.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
|
checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "pem"
|
|
||||||
version = "1.1.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8"
|
|
||||||
dependencies = [
|
|
||||||
"base64 0.13.1",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pem"
|
name = "pem"
|
||||||
version = "3.0.2"
|
version = "3.0.2"
|
||||||
@ -3354,7 +3346,7 @@ name = "rcgen"
|
|||||||
version = "0.12.0"
|
version = "0.12.0"
|
||||||
source = "git+https://github.com/rustls/rcgen.git?rev=5ed5fccd3effd4da391492f5f01f98c955b9a4c4#5ed5fccd3effd4da391492f5f01f98c955b9a4c4"
|
source = "git+https://github.com/rustls/rcgen.git?rev=5ed5fccd3effd4da391492f5f01f98c955b9a4c4#5ed5fccd3effd4da391492f5f01f98c955b9a4c4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"pem 3.0.2",
|
"pem",
|
||||||
"ring 0.17.7",
|
"ring 0.17.7",
|
||||||
"time",
|
"time",
|
||||||
"x509-parser",
|
"x509-parser",
|
||||||
|
@ -101,7 +101,7 @@ anyhow = "1.0"
|
|||||||
# Authentication
|
# Authentication
|
||||||
pbkdf2 = { version = "0.12", features = ["simple"] }
|
pbkdf2 = { version = "0.12", features = ["simple"] }
|
||||||
rand_core = { version = "0.6", features = ["std"] }
|
rand_core = { version = "0.6", features = ["std"] }
|
||||||
jsonwebtoken = "8.3"
|
jsonwebtoken = "9.2"
|
||||||
rustls = "0.21"
|
rustls = "0.21"
|
||||||
rustls-native-certs = "0.6"
|
rustls-native-certs = "0.6"
|
||||||
rustls-pemfile = "1.0"
|
rustls-pemfile = "1.0"
|
||||||
|
@ -55,6 +55,7 @@ impl AuthClaim {
|
|||||||
|
|
||||||
pub fn decode(token: &str, secret: &[u8]) -> Result<Self> {
|
pub fn decode(token: &str, secret: &[u8]) -> Result<Self> {
|
||||||
let mut val = Validation::new(Algorithm::HS256);
|
let mut val = Validation::new(Algorithm::HS256);
|
||||||
|
val.set_audience(&["chirpstack"]);
|
||||||
val.required_spec_claims = HashSet::new(); // make the 'exp' optional
|
val.required_spec_claims = HashSet::new(); // make the 'exp' optional
|
||||||
|
|
||||||
let claim = decode::<AuthClaim>(token, &DecodingKey::from_secret(secret), &val)?;
|
let claim = decode::<AuthClaim>(token, &DecodingKey::from_secret(secret), &val)?;
|
||||||
|
Reference in New Issue
Block a user