Skip to content

Commit

Permalink
Upgrade jsonwebtoken to 9.1.0 (#463)
Browse files Browse the repository at this point in the history
* Upgrade jsonwebtoken to 9.1.0

* Version 0.58.2
  • Loading branch information
chrislearn authored Oct 24, 2023
1 parent 5164bf4 commit e94783f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
36 changes: 18 additions & 18 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["crates/*"]
resolver = "2"

[workspace.package]
version = "0.58.1"
version = "0.58.2"
authors = ["Chrislearn Young <[email protected]>"]
edition = "2021"
rust-version = "1.67"
Expand Down Expand Up @@ -51,7 +51,7 @@ hostname-validator = "1"
hyper = "=1.0.0-rc.4"
indexmap = "2"
inventory = "0.3"
jsonwebtoken = "9"
jsonwebtoken = "9.1"
mime = "0.3"
mime-infer = "2"
moka = "0.12"
Expand Down Expand Up @@ -83,23 +83,23 @@ rustls = "0.21"
rustls-pemfile = "1"
rust-embed = { version = ">= 6, <= 8" }
salvo-utils = { version = "0.0.6", default-features = true }
salvo_macros = { version = "0.58.1", path = "crates/macros", default-features = false }
salvo_core = { version = "0.58.1", path = "crates/core", default-features = false }
salvo_extra = { version = "0.58.1", path = "crates/extra", default-features = false }
salvo-compression = { version = "0.58.1", path = "crates/compression", default-features = false }
salvo-cache = { version = "0.58.1", path = "crates/cache", default-features = false }
salvo-cors = { version = "0.58.1", path = "crates/cors", default-features = false }
salvo-csrf = { version = "0.58.1", path = "crates/csrf", default-features = false }
salvo-flash = { version = "0.58.1", path = "crates/flash", default-features = false }
salvo_macros = { version = "0.58.2", path = "crates/macros", default-features = false }
salvo_core = { version = "0.58.2", path = "crates/core", default-features = false }
salvo_extra = { version = "0.58.2", path = "crates/extra", default-features = false }
salvo-compression = { version = "0.58.2", path = "crates/compression", default-features = false }
salvo-cache = { version = "0.58.2", path = "crates/cache", default-features = false }
salvo-cors = { version = "0.58.2", path = "crates/cors", default-features = false }
salvo-csrf = { version = "0.58.2", path = "crates/csrf", default-features = false }
salvo-flash = { version = "0.58.2", path = "crates/flash", default-features = false }
salvo-http3 = { version = "0.0.4", default-features = false }
salvo-jwt-auth = { version = "0.58.1", path = "crates/jwt-auth", default-features = false }
salvo-oapi = { version = "0.58.1", path = "./crates/oapi", default-features = false }
salvo-oapi-macros = { version = "0.58.1", path = "crates/oapi-macros", default-features = false }
salvo-otel = { version = "0.58.1", path = "crates/otel", default-features = false }
salvo-proxy = { version = "0.58.1", path = "crates/proxy", default-features = false }
salvo-rate-limiter = { version = "0.58.1", path = "crates/rate-limiter", default-features = false }
salvo-serve-static = { version = "0.58.1", path = "crates/serve-static", default-features = false }
salvo-session = { version = "0.58.1", path = "crates/session", default-features = false }
salvo-jwt-auth = { version = "0.58.2", path = "crates/jwt-auth", default-features = false }
salvo-oapi = { version = "0.58.2", path = "./crates/oapi", default-features = false }
salvo-oapi-macros = { version = "0.58.2", path = "crates/oapi-macros", default-features = false }
salvo-otel = { version = "0.58.2", path = "crates/otel", default-features = false }
salvo-proxy = { version = "0.58.2", path = "crates/proxy", default-features = false }
salvo-rate-limiter = { version = "0.58.2", path = "crates/rate-limiter", default-features = false }
salvo-serve-static = { version = "0.58.2", path = "crates/serve-static", default-features = false }
salvo-session = { version = "0.58.2", path = "crates/session", default-features = false }
serde = "1"
serde_json = "1"
serde-xml-rs = "0.6"
Expand Down
4 changes: 3 additions & 1 deletion crates/jwt-auth/src/oidc/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Oidc(OpenID Connect) support module
use std::future::Future;
use std::str::FromStr;
use std::sync::Arc;
use std::time::Duration;
use std::time::SystemTime;
Expand Down Expand Up @@ -333,7 +334,7 @@ struct OidcConfig {

pub(crate) fn decode_jwk(jwk: &Jwk, validation: &Validation) -> Result<(String, DecodingInfo), JwtAuthError> {
let kid = jwk.common.key_id.clone();
let alg = jwk.common.algorithm;
let alg = jwk.common.key_algorithm;

let dec_key = match jwk.algorithm {
jsonwebtoken::jwk::AlgorithmParameters::EllipticCurve(ref params) => {
Expand All @@ -359,6 +360,7 @@ pub(crate) fn decode_jwk(jwk: &Jwk, validation: &Validation) -> Result<(String,
};
match (kid, alg, dec_key) {
(Some(kid), Some(alg), Some(dec_key)) => {
let alg = Algorithm::from_str(alg.to_string().as_str())?;
let info = DecodingInfo::new(dec_key, alg, validation);
Ok((kid, info))
}
Expand Down

0 comments on commit e94783f

Please sign in to comment.