Fix LiteLLM_JWTAuth annotations access bug

The __init__ method was trying to access self.__annotations__ before
super().__init__() was called, resulting in an empty annotations dict.

Changed to use the class annotations directly: LiteLLM_JWTAuth.__annotations__
instead of self.__annotations__.

This fixes the ValueError:
"Invalid arguments provided: user_email_jwt_field, user_id_upsert,
user_allowed_email_domain. Allowed arguments are: ."

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Julio Quinteros Pro 2026-02-14 15:44:02 -03:00
parent 3f4ba9f03f
commit 90d61432cf

View file

@ -3776,7 +3776,7 @@ class LiteLLM_JWTAuth(LiteLLMPydanticObjectBase):
def __init__(self, **kwargs: Any) -> None:
# get the attribute names for this Pydantic model
allowed_keys = self.__annotations__.keys()
allowed_keys = LiteLLM_JWTAuth.__annotations__.keys()
invalid_keys = set(kwargs.keys()) - allowed_keys
user_roles_jwt_field = kwargs.get("user_roles_jwt_field")