o
    Df                     @   s   d 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G dd de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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 )a  
    authlib.oauth1.rfc5849.errors
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    RFC5849 has no definition on errors. This module is designed by
    Authlib based on OAuth 1.0a `Section 10`_ with some changes.

    .. _`Section 10`: https://oauth.net/core/1.0a/#rfc.section.10
    )AuthlibHTTPErroris_secure_transportc                       s&   e Zd Zd fdd	Zdd Z  ZS )OAuth1ErrorNc                    s   t  d ||| d S Nsuper__init__)selfdescriptionuristatus_code	__class__ V/home/ubuntu/webapp/venv/lib/python3.10/site-packages/authlib/oauth1/rfc5849/errors.pyr	      s   zOAuth1Error.__init__c                 C   s   g dS )zGet a list of headers.))zContent-Typez!application/x-www-form-urlencoded)zCache-Controlzno-store)Pragmazno-cacher   )r
   r   r   r   get_headers   s   zOAuth1Error.get_headers)NNN)__name__
__module____qualname__r	   r   __classcell__r   r   r   r   r      s    r   c                   @   s    e Zd ZdZdZedd ZdS )InsecureTransportErrorinsecure_transportzOAuth 2 MUST utilize https.c                 C   s   t |s|  d S r   r   )clsr   r   r   r   check   s   zInsecureTransportError.checkN)r   r   r   errorr   classmethodr   r   r   r   r   r      s
    r   c                   @      e Zd ZdZdS )InvalidRequestErrorinvalid_requestNr   r   r   r   r   r   r   r   r   %       r   c                   @   r   )UnsupportedParameterErrorunsupported_parameterNr!   r   r   r   r   r#   )   r"   r#   c                   @   r   )UnsupportedSignatureMethodErrorunsupported_signature_methodNr!   r   r   r   r   r%   -   r"   r%   c                       s    e Zd ZdZ fddZ  ZS )MissingRequiredParameterErrormissing_required_parameterc                    s   d| d}t  j|d d S )Nz	missing "z" in parameters)r   r   )r
   keyr   r   r   r   r	   4   s   z&MissingRequiredParameterError.__init__)r   r   r   r   r	   r   r   r   r   r   r'   1   s    r'   c                   @   r   )%DuplicatedOAuthProtocolParameterError#duplicated_oauth_protocol_parameterNr!   r   r   r   r   r*   9   r"   r*   c                   @      e Zd ZdZdZdS )InvalidClientErrorinvalid_client  Nr   r   r   r   r   r   r   r   r   r-   =       r-   c                   @   s   e Zd ZdZdZdZdS )InvalidTokenErrorinvalid_tokenz.Invalid or expired "oauth_token" in parametersr/   N)r   r   r   r   r   r   r   r   r   r   r2   B   s    r2   c                   @   r,   )InvalidSignatureErrorinvalid_signaturer/   Nr0   r   r   r   r   r4   H   r1   r4   c                   @   r,   )InvalidNonceErrorinvalid_noncer/   Nr0   r   r   r   r   r6   M   r1   r6   c                   @   r,   )AccessDeniedErroraccess_deniedz=The resource owner or authorization server denied the requestN)r   r   r   r   r   r   r   r   r   r8   R   r1   r8   c                   @   r,   )MethodNotAllowedErrormethod_not_allowedi  Nr0   r   r   r   r   r:   W   r1   r:   N)__doc__authlib.common.errorsr   authlib.common.securityr   r   r   r   r#   r%   r'   r*   r-   r2   r4   r6   r8   r:   r   r   r   r   <module>   s     	
