o
    ưi                     @   s8   d dl mZ d dlmZ d dlmZ G dd deZdS )    )Request)OpenID)CustomLoggerc                   @   s"   e Zd ZdZdedefddZdS )CustomSSOLoginHandlerz
    Custom logger for the UI SSO sign in

    Use this to parse the request headers and return a OpenID object

    Useful when you have an OAuth proxy in front of LiteLLM
    and you want to use the headers from the proxy to sign in the user
    requestreturnc              	      s.   t |j}t|d|dddddddS )Nzx-litellm-user-idzx-litellm-user-emailZTestzhttps://test.com/test.pngtest)idemailZ
first_name	last_nameZdisplay_nameZpictureprovider)dictheadersr   get)selfr   Zrequest_headers_dict r   ^/home/app/Keep/.python/lib/python3.10/site-packages/litellm/integrations/custom_sso_handler.pyhandle_custom_ui_sso_sign_in   s   
z2CustomSSOLoginHandler.handle_custom_ui_sso_sign_inN)__name__
__module____qualname____doc__r   r   r   r   r   r   r   r      s    r   N)Zfastapir   Zfastapi_sso.sso.baser   Z"litellm.integrations.custom_loggerr   r   r   r   r   r   <module>   s    