From 1434ad3cc600955a5e7cfd14d78ee3afed539bfa Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Thu, 21 May 2026 03:51:23 +0000 Subject: [PATCH] fix(jwt): guard litellm_jwtauth access in auth_jwt global path JWTHandler() can be constructed without update_environment() being called (tests do this directly), in which case self.litellm_jwtauth does not exist. Accessing it raises AttributeError before getattr can fall back. Use the same safe pattern other call sites use. --- litellm/proxy/auth/handle_jwt.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/auth/handle_jwt.py b/litellm/proxy/auth/handle_jwt.py index c6dd0281fa8..d0e23dd2c70 100644 --- a/litellm/proxy/auth/handle_jwt.py +++ b/litellm/proxy/auth/handle_jwt.py @@ -1058,7 +1058,9 @@ class JWTHandler: ) decode_kwargs = self._build_decode_kwargs( - has_issuer_config=bool(getattr(self.litellm_jwtauth, "issuers", None)) + has_issuer_config=bool( + getattr(getattr(self, "litellm_jwtauth", None), "issuers", None) + ) ) public_key = await self.get_public_key(kid=kid)