
    ~h                     >   d Z ddlmZ ddlmZ  G d de      Z G d de      Z G d d	e      Z G d
 de      Z G d de      Z	 G d de      Z
 G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Zy)zauthlib.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                   &     e Zd Zd fd	Zd Z xZS )OAuth1Errorc                 *    t         |   d |||       y Nsuper__init__)selfdescriptionuristatus_code	__class__s       Y/opt/mcp/mcp-sentiment/venv/lib/python3.12/site-packages/authlib/oauth1/rfc5849/errors.pyr   zOAuth1Error.__init__   s    {C=    c                 
    g dS )zGet a list of headers.))zContent-Typez!application/x-www-form-urlencoded)zCache-Controlzno-store)Pragmazno-cache )r   s    r   get_headerszOAuth1Error.get_headers   s    
 	
r   )NNN)__name__
__module____qualname__r   r   __classcell__r   s   @r   r   r      s    >
r   r   c                   $    e Zd ZdZdZed        Zy)InsecureTransportErrorinsecure_transportzOAuth 2 MUST utilize https.c                 (    t        |      s |        y r	   r   )clsr   s     r   checkzInsecureTransportError.check   s    "3'%K (r   N)r   r   r   errorr   classmethodr"   r   r   r   r   r      s     E/K r   r   c                       e Zd ZdZy)InvalidRequestErrorinvalid_requestNr   r   r   r#   r   r   r   r&   r&   %   s    Er   r&   c                       e Zd ZdZy)UnsupportedParameterErrorunsupported_parameterNr(   r   r   r   r*   r*   )   s    #Er   r*   c                       e Zd ZdZy)UnsupportedSignatureMethodErrorunsupported_signature_methodNr(   r   r   r   r-   r-   -   s    *Er   r-   c                   "     e Zd ZdZ fdZ xZS )MissingRequiredParameterErrormissing_required_parameterc                 2    d| d}t         |   |       y )Nz	missing "z" in parameters)r   r
   )r   keyr   r   s      r   r   z&MissingRequiredParameterError.__init__4   s!    !#o6[1r   )r   r   r   r#   r   r   r   s   @r   r0   r0   1   s    (E2 2r   r0   c                       e Zd ZdZy)%DuplicatedOAuthProtocolParameterError#duplicated_oauth_protocol_parameterNr(   r   r   r   r5   r5   9   s    1Er   r5   c                       e Zd ZdZdZy)InvalidClientErrorinvalid_client  Nr   r   r   r#   r   r   r   r   r8   r8   =   s    EKr   r8   c                       e Zd ZdZdZdZy)InvalidTokenErrorinvalid_tokenz.Invalid or expired "oauth_token" in parametersr:   N)r   r   r   r#   r   r   r   r   r   r=   r=   B   s    EBKKr   r=   c                       e Zd ZdZdZy)InvalidSignatureErrorinvalid_signaturer:   Nr;   r   r   r   r@   r@   H   s    EKr   r@   c                       e Zd ZdZdZy)InvalidNonceErrorinvalid_noncer:   Nr;   r   r   r   rC   rC   M   s    EKr   rC   c                       e Zd ZdZdZy)AccessDeniedErroraccess_deniedz=The resource owner or authorization server denied the requestN)r   r   r   r#   r   r   r   r   rF   rF   R   s    EQKr   rF   c                       e Zd ZdZdZy)MethodNotAllowedErrormethod_not_allowedi  Nr;   r   r   r   rI   rI   W   s     EKr   rI   N)__doc__authlib.common.errorsr   authlib.common.securityr   r   r   r&   r*   r-   r0   r5   r8   r=   r@   rC   rF   rI   r   r   r   <module>rN      s    3 7

" 

[ + $ $+k +2K 22K 2 
 K 
 
R R
K r   