
    rOi                     N    d dl Z d dlmZmZ d dlZ G d dej
                        Zy)    N)	AwaitableCallablec                       e Zd Zdeg ef   eg ee   f   z  fdZdefdZdej                  dej                  fdZ
defdZdej                  dej                  fdZy	)

BearerAuthauth_token_providerc                     d | _         d | _        t        j                  |      r|| _         y t	        |      r|| _        y t        d      )Nz3auth_token_provider must be a callable or awaitable)async_token
sync_tokenasyncioiscoroutinefunctioncallable
ValueError)selfr   s     e/volume1/homes/robertsu/coba/app/.venv/lib/python3.12/site-packages/qdrant_client/auth/bearer_auth.py__init__zBearerAuth.__init__   sH     AE48&&':;2D+,"5 !VWW    returnc                 P    | j                   t        d      | j                         S )Nz&Synchronous token provider is not set.)r
   r   r   s    r   _sync_get_tokenzBearerAuth._sync_get_token   s%    ??"EFF  r   requestc              #   X   K   | j                         }d| |j                  d<   | y wNzBearer Authorization)r   headersr   r   tokens      r   sync_auth_flowzBearerAuth.sync_auth_flow   s.     $$&-4UG+<(s   (*c                 v   K   | j                   | j                          d {   S | j                         S 7 w)N)r	   r   r   s    r   _async_get_tokenzBearerAuth._async_get_token!   s8     '))+++##%% ,s    979c                n   K   | j                          d {   }d| |j                  d<   | y 7 wr   )r    r   r   s      r   async_auth_flowzBearerAuth.async_auth_flow'   s6     ++---4UG+<( .s   535N)__name__
__module____qualname__r   strr   r   r   httpxRequestr   r    r"    r   r   r   r      s{    X%b#g."in:L1MMX! !
emm  
& &U]] u}} r   r   )r   typingr   r   r'   Authr   r)   r   r   <module>r,      s     & # #r   