Ë
    tPêjê  ã                   óT   — d dl Z d dlmZ d dlmZmZ d dlmZ dededefd„Z	d	efd
„Z
y)é    N)ÚRequest)ÚGenerateKeyRequestÚUserAPIKeyAuth)ÚFinalÚrequestÚapi_keyÚreturnc              ƒ   ó�   K  — 	 t        j                  d«      › d�}||k(  rt        |¬«      S t        ‚# t        $ r t        ‚w xY w­w)NÚLITELLM_MASTER_KEYz-1234)r   )ÚosÚgetenvr   Ú	Exception)r   r   Úmodified_master_keys      úr/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/litellm/proxy/example_config_yaml/custom_auth.pyÚuser_api_key_authr   	   sO   è ø€ ðÜ(*¯	©	Ð2FÓ(GÐ'HÈÐ%NÐØÐ)Ò)Ü!¨'Ô2Ð2ÜˆøÜò Üˆðüs   ‚A„(3 ¬A­3 ³AÁAÚdatac              ƒ   óÒ  K  — | j                  «       }|j                  d«      }|j                  d«       |j                  d«       |j                  d«       |j                  d«       |j                  d«       |j                  d«       |j                  d«       |j                  d	«       |j                  d
«       |j                  d«       |�t        |«      dkD  rddiS dddœS ­w)a  
    Asynchronously decides if a key should be generated or not based on the provided data.

    Args:
        data (GenerateKeyRequest): The data to be used for decision making.

    Returns:
        bool: True if a key should be generated, False otherwise.
    Úteam_idÚdurationÚmodelsÚaliasesÚconfigÚspendÚuser_idÚmax_parallel_requestsÚmetadataÚ	tpm_limitÚ	rpm_limitr   ÚdecisionTz7This violates LiteLLM Proxy Rules. No team id provided.)r   Úmessage)ÚjsonÚgetÚlen)r   Ú	data_jsonr   s      r   Úgenerate_key_fnr%      sÎ   è ø€ ð —y‘y“{€Ið —]‘] 9Ó-€GØ‡M�M�*ÔØ‡M�M�(ÔØ‡M�M�)ÔØ‡M�M�(ÔØ‡M�M�'ÔØ‡M�M�)ÔØ‡M�MÐ)Ô*Ø‡M�M�*ÔØ‡M�M�+ÔØ‡M�M�+ÔàÐœs 7›|¨aÒ/à˜ð
ð 	
ð
 ØPñ
ð 	
ùs   ‚C%C')r   Úfastapir   Úlitellm.proxy._typesr   r   Útypingr   Ústrr   r%   © ó    r   ú<module>r,      s8   ðÛ 	å ç CÝ ð Wð °sð ¸~ó ð"
Ð 2ô "
r+   