o
    ;ήc
                     @   s   d dl mZ d dlmZmZ d dlmZ d dlmZ d dl	m
Z
 d dlmZ G dd deZG d	d
 d
eZG dd deZG dd deZdS )    )Optional)APIKeyAPIKeyIn)SecurityBase)HTTPException)Request)HTTP_403_FORBIDDENc                   @   s   e Zd ZdS )
APIKeyBaseN)__name__
__module____qualname__ r   r   ?/tmp/pip-target-vg8gfxp4/lib/python/fastapi/security/api_key.pyr	   
   s    r	   c                	   @   N   e Zd Zdddddedee dee defdd	Zd
edee fddZdS )APIKeyQueryNTscheme_namedescription
auto_errornamer   r   r   c                C   8   t di dtji||d| _|p| jj| _|| _d S Nin)r   r   r   )r   r   querymodel	__class__r
   r   r   selfr   r   r   r   r   r   r   __init__      
zAPIKeyQuery.__init__requestreturnc                    0   |j | jj}|s| jrttddd S |S NzNot authenticated)status_codedetail)query_paramsgetr   r   r   r   r   r   r    api_keyr   r   r   __call__      zAPIKeyQuery.__call__	r
   r   r   strr   boolr   r   r*   r   r   r   r   r          
r   c                	   @   r   )APIKeyHeaderNTr   r   r   r   r   c                C   r   r   )r   r   headerr   r   r
   r   r   r   r   r   r   r   *   r   zAPIKeyHeader.__init__r    r!   c                    r"   r#   )headersr'   r   r   r   r   r   r(   r   r   r   r*   8   r+   zAPIKeyHeader.__call__r,   r   r   r   r   r0   )   r/   r0   c                	   @   r   )APIKeyCookieNTr   r   r   r   r   c                C   r   r   )r   r   cookier   r   r
   r   r   r   r   r   r   r   E   r   zAPIKeyCookie.__init__r    r!   c                    r"   r#   )cookiesr'   r   r   r   r   r   r(   r   r   r   r*   S   r+   zAPIKeyCookie.__call__r,   r   r   r   r   r3   D   r/   r3   N)typingr   fastapi.openapi.modelsr   r   fastapi.security.baser   starlette.exceptionsr   starlette.requestsr   starlette.statusr   r	   r   r0   r3   r   r   r   r   <module>   s    