From 941c297942f64bd840ee723a00c063fe4efdd479 Mon Sep 17 00:00:00 2001 From: "Kjell W. Kongsvik" Date: Fri, 25 Apr 2025 22:23:30 +0200 Subject: [PATCH] fix: no panic if key_algorithm is not set in JWK It is note set here: https://login.windows.net/common/discovery/keys --- src/jwk.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/jwk.rs b/src/jwk.rs index 49c58003..f9831d52 100644 --- a/src/jwk.rs +++ b/src/jwk.rs @@ -414,7 +414,10 @@ pub struct Jwk { impl Jwk { /// Find whether the Algorithm is implemented and supported pub fn is_supported(&self) -> bool { - self.common.key_algorithm.unwrap().to_algorithm().is_ok() + match self.common.key_algorithm { + Some(alg) => alg.to_algorithm().is_ok(), + _ => false, + } } }