
    ^h                     D    S r SSKJrJrJr  S\S\4S jrS\S\S\4S jrg)	z*
Checks for LiteLLM service account keys

    )ProxyErrorTypesProxyExceptionUserAPIKeyAuthvalid_tokenreturnc                 H    U R                   (       a  SU R                   ;   a  gg)zb
Checks if the token is a service account

Returns:
    bool: True if token is a service account

service_account_idTF)metadata)r   s    c/home/james-whalen/.local/lib/python3.13/site-packages/litellm/proxy/auth/service_account_checks.py!check_if_token_is_service_accountr   	   s!     ;#7#77    request_datac           	         #    [        U 5      SLa  gSSKJn  SU;   aF  US   nSU;   a;  US   nU H0  nXQ;  d  M
  [        [        R
                  R                  SUSU S3S	9e   g7f)
z
If a virtual key is a service account, checks it's a valid service account

A token is a service account if it has a service_account_id in its metadata

Service Account Specific Checks:
    - Check if required_params is set
Tr   )general_settingsservice_account_settingsenforced_paramsi  zBadRequest please pass param=z> in request body. This is a required param for service account)typecodeparammessage)r   litellm.proxy.proxy_serverr   r   r   bad_request_errorvalue)r   r   r   r   _enforced_paramsr   s         r   service_account_checksr      s      )5TA;!%55#34N#O  8878IJ),(,>>DD #"?w  GE  !F	  * s
   4A%+A%N)	__doc__litellm.proxy._typesr   r   r   boolr   dictr    r   r   <module>r!      sC   
 Q P> d /3	r   