�
&�`� � � � d Z ddlmZmZ G d� de� Z G d� de� Z G d� de� Z G d � d
e� Z G d� de� Z y
)z�
oauthlib.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.
� )�add_params_to_uri� urlencodec �R � � e Zd ZdZdZ d� fd� Zd� Zed� � Zed� � Z � xZ
S )�OAuth1ErrorN� c �� �� |xs | j | _ dj | j | j � }|r|dt |� z z
}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�format�error�repr�super�__init__�uri�status_code)�selfr
r r �request�message� __class__s ��@/usr/lib/python3/dist-packages/oauthlib/oauth1/rfc5849/errors.pyr zOAuth1Error.__init__ sf �� �* '�:�$�*:�*:����"�"�4�:�:�t�/?�/?�@����s�T�'�]�*�*�G�
����!����&��� c �. � t || j � S �N)r � twotuples)r r s r �in_urizOAuth1Error.in_uri- s � � ��d�n�n�5�5r c �� � d| j fg}| 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 zOAuth1Error.twotuples0 sU � ��4�:�:�&�'������L�L�-�t�/?�/?�@�A��8�8��L�L�+�t�x�x�0�1��r c �, � t | j � S r )r r )r s r �
urlencodedzOAuth1Error.urlencoded9 s � �����(�(r )NNi� N)�__name__�
__module__�__qualname__r r
r r �propertyr r! �
__classcell__)r s @r r r sE �� ��E��K�?B��'�<6� �� �� �)� �)r r c � � e Zd ZdZdZy)�InsecureTransportError�insecure_transport_protocolz%Only HTTPS connections are permitted.N)r" |