o
    ưiW                     @   sN   d Z ddlmZ ddlmZ ddlmZmZ dededeeef fdd	Z	d
S )zh
Example custom auth function.

This will allow all keys starting with "my-custom-key" to pass through.
    )Union)Request)ProxyExceptionUserAPIKeyAuthrequestapi_keyreturnc                    sJ   z| dr
W dS |dkrtdddddtd ty$   tdw )	Nzmy-custom-keyzsk-P1zJMdsqCPNN54alZd_ETwzinvalid-api-keyzInvalid API keyZinvalid_request_errorr   i  )messagetypeparamcode)
startswithr   	Exception)r   r    r   U/home/app/Keep/.python/lib/python3.10/site-packages/litellm/proxy/custom_auth_auto.pyuser_api_key_auth   s   
r   N)
__doc__typingr   Zfastapir   Zlitellm.proxy._typesr   r   strr   r   r   r   r   <module>   s    
