From 4bf4be3a0fd0febd8f1326a97163716265a50ec3 Mon Sep 17 00:00:00 2001 From: phuongnd96 Date: Sat, 30 Mar 2024 10:09:38 +0700 Subject: [PATCH] fix: still verify kid on single pub key fetched --- litellm/proxy/auth/handle_jwt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/auth/handle_jwt.py b/litellm/proxy/auth/handle_jwt.py index 4689ffe7b..35b884b58 100644 --- a/litellm/proxy/auth/handle_jwt.py +++ b/litellm/proxy/auth/handle_jwt.py @@ -114,7 +114,8 @@ class JWTHandler: public_key: Optional[dict] = None if len(keys) == 1: - public_key = keys[0] + if kid is None or key["kid"] == kid: + public_key = keys[0] elif len(keys) > 1: for key in keys: if kid is not None and key["kid"] == kid: