o
    ;ήct                     @   s\   d dl mZ d dl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d	S )
    )Optional)OpenIdConnect)SecurityBase)HTTPException)Request)HTTP_403_FORBIDDENc                	   @   sN   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 )r   NT)scheme_namedescription
auto_erroropenIdConnectUrlr   r	   r
   c                C   s&   t ||d| _|p| jj| _|| _d S )N)r   r	   )OpenIdConnectModelmodel	__class____name__r   r
   )selfr   r   r	   r
    r   K/tmp/pip-target-vg8gfxp4/lib/python/fastapi/security/open_id_connect_url.py__init__   s
   
zOpenIdConnect.__init__requestreturnc                    s,   |j d}|s| jrttddd S |S )NAuthorizationzNot authenticated)status_codedetail)headersgetr
   r   r   )r   r   authorizationr   r   r   __call__   s   zOpenIdConnect.__call__)	r   
__module____qualname__strr   boolr   r   r   r   r   r   r   r   
   s    
r   N)typingr   fastapi.openapi.modelsr   r   fastapi.security.baser   starlette.exceptionsr   starlette.requestsr   starlette.statusr   r   r   r   r   <module>   s    