
    љi                     H    S SK Jr  S SKJrJrJr  S SKJrJr   " S S5      r	g)    )Optional)HTTPExceptionstatusDepends)
HTTPBearerHTTPAuthorizationCredentialsc                   ^    \ rS rSrSS\\   4S jjr\" \" SS95      4S\	S\\   4S	 jjr
S
rg)
BearerAuth   Napi_keyc                 ,    Xl         [        SS9U l        g )NF
auto_error)r   r   bearer_scheme)selfr   s     G/home/james-whalen/.local/lib/python3.13/site-packages/aiavatar/auth.py__init__BearerAuth.__init__   s    '59    Fr   credentialsreturnc                    #    U R                   (       d  g U(       d  [        [        R                  SSS0S9eUR                  U R                   :w  a  [        [        R                  SSS0S9eUR                  $ 7f)NzAuthorization header requiredzWWW-AuthenticateBearer)status_codedetailheadersz"Invalid authentication credentials)r   r   r   HTTP_401_UNAUTHORIZEDr   )r   r   s     r   __call__BearerAuth.__call__   sz     
 || "886+X6  ""dll2"88;+X6  &&&s   A6A8)r   r   )N)__name__
__module____qualname____firstlineno__r   strr   r   r   r   r   __static_attributes__ r   r   r
   r
      sB    : : 5<JRW<X4Y'1' 
#' 'r   r
   N)
typingr   fastapir   r   r   fastapi.securityr   r   r
   r&   r   r   <module>r*      s     2 2 E' 'r   