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.
This commit is contained in:
mateo-berri 2026-05-21 03:51:23 +00:00 • committed by Claude
parent 86cf3efd16
commit 1434ad3cc6
No known key found for this signature in database

View file

@ -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)