
    }	                         d Z ddlmZ ddlmZ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y)zoauthlib.oauth1.rfc5849.errors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error used both by OAuth 1 clients and provicers to represent the spec
defined error responses for all four core grant types.
    )unicode_literals)add_params_to_uri	urlencodec                   N     e Zd ZdZdZd fd	Zd Zed        Zed        Z	 xZ
S )OAuth1ErrorN c                     |xs | j                   | _         d| j                  d| j                   }|r|dt        |      z   z  }t        t        |   |       || _        || _        y)a  
        description:    A human-readable ASCII [USASCII] text providing
                        additional information, used to assist the client
                        developer in understanding the error that occurred.
                        Values for the "error_description" parameter MUST NOT
                        include characters outside the set
                        x20-21 / x23-5B / x5D-7E.

        uri:    A URI identifying a human-readable web page with information
                about the error, used to provide the client developer with
                additional information about the error.  Values for the
                "error_uri" parameter MUST conform to the URI- Reference
                syntax, and thus MUST NOT include characters outside the set
                x21 / x23-5B / x5D-7E.

        state:  A CSRF protection value received from the client.

        request:  Oauthlib Request object
        (z)  N)descriptionerrorreprsuperr   __init__uristatus_code)selfr   r   r   requestmessage	__class__s         1lib/third_party/oauthlib/oauth1/rfc5849/errors.pyr   zOAuth1Error.__init__   s`    ( #6d&6&6D::t'7'78GtG}$$g	+t%g.DH"D    c                 .    t        || j                        S N)r   	twotuples)r   r   s     r   in_urizOAuth1Error.in_uri-   s    S$..11r   c                     d| j                   fg}| j                  r|j                  d| j                  f       | j                  r|j                  d| j                  f       |S )Nr   error_description	error_uri)r   r   appendr   )r   r   s     r   r   zOAuth1Error.twotuples0   sU    tzz"#Ell')9)9:;xxllK*+Lr   c                 ,    t        | j                        S r   )r   r   )r   s    r   
urlencodedzOAuth1Error.urlencoded9   s    T^^$$r   )NNi  N)__name__
__module____qualname__r   r   r   r   propertyr   r"   __classcell__)r   s   @r   r   r      s?    
%+#:2   % %r   r   c                       e Zd ZdZdZy)InsecureTransportErrorinsecure_transport_protocolz%Only HTTPS connections are permitted.N)r#   r$   r%   r   r    r   r   r)   r)   >   s    
'%7+r   r)   c                       e Zd ZdZy)InvalidSignatureMethodErrorinvalid_signature_methodNr#   r$   r%   r   r+   r   r   r-   r-   C   s    
$%r   r-   c                       e Zd ZdZy)InvalidRequestErrorinvalid_requestNr/   r+   r   r   r1   r1   G   s    
%r   r1   c                       e Zd ZdZy)InvalidClientErrorinvalid_clientNr/   r+   r   r   r4   r4   K   s    
%r   r4   N)__doc__
__future__r   oauthlib.commonr   r   	Exceptionr   r)   r-   r1   r4   r+   r   r   <module>r:      sO   
 ( 8/%) /%d8[ 8
%+ %+  r   