diff --git a/Cargo.toml b/Cargo.toml index e736eb03a..0a2d9eafc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ members = ["crates/*"] resolver = "2" [workspace.package] -version = "0.58.1" +version = "0.58.2" authors = ["Chrislearn Young "] edition = "2021" rust-version = "1.67" @@ -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" @@ -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" diff --git a/crates/jwt-auth/src/oidc/mod.rs b/crates/jwt-auth/src/oidc/mod.rs index 3994a8220..8c6e67b81 100644 --- a/crates/jwt-auth/src/oidc/mod.rs +++ b/crates/jwt-auth/src/oidc/mod.rs @@ -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; @@ -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) => { @@ -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)) }