Current File : //usr/lib/python3/dist-packages/oauthlib/oauth2/rfc6749/__pycache__/errors.cpython-312.pyc |
�
�Mc�2 � � � d Z ddlZddlmZmZ G d� de� Z G d� de� Z G d� d e� Z G d
� de� Z G d� d
e� Z
G d� de� Z G d� de� Z G d� de� Z
G d� de
� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d� de� 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 d0� d1e� Z G d2� d3e� Z G d4� d5e
� Z G d6� d7e� Z G d8� d9e� Z G d:� d;e� Z! G d<� d=e� Z" G d>� d?e� Z# G d@� dAe� Z$ G dB� dCe� Z% G dD� dEe� Z& G dF� dGe� Z'dIdH�Z(y)Jz�
oauthlib.oauth2.rfc6749.errors
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error used both by OAuth 2 clients and providers to represent the spec
defined error responses for all four core grant types.
� N)�add_params_to_uri� urlencodec �v � � e Zd ZdZdZdZ d
� fd� Zd� Zed� � Z ed� � Z
ed� � Zed � � Z� xZ
S )�OAuth2ErrorN� � c �$ �� |�|| _ dj | j | j � }|r|dt |� z z
}t �| � |� || _ || _ |r|| _ |r{|j | _ |j | _
|j | _ |j | _ |j | _
|j | _ |s|j | _ yyd| _ d| _
d| _ d| _ d| _
d| _ y)a0
:param 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.
:param 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.
:param state: A CSRF protection value received from the client.
:param status_code:
:param request: OAuthlib request.
:type request: oauthlib.common.Request
Nz({}) {}� )�description�format�error�repr�super�__init__�uri�state�status_code�redirect_uri� client_id�scopes�
response_type�
response_mode�
grant_type)�selfr r r r �request�message� __class__s ��@/usr/lib/python3/dist-packages/oauthlib/oauth2/rfc6749/errors.pyr zOAuth2Error.__init__ s� �� �0 �"�*�D���"�"�4�:�:�t�/?�/?�@����s�T�'�]�*�*�G�
����!������
��*�D��� '� 4� 4�D��$�.�.�D�N�!�.�.�D�K�!(�!6�!6�D��!(�!6�!6�D��%�0�0�D�O��$�]�]��
� � !%�D��!�D�N��D�K�!%�D��!%�D��"�D�O� c �N � | j dk( }t || j |� S )N�fragment)r r � twotuples)r r r! s r �in_urizOAuth2Error.in_uriI s% � ��%�%��3�� ��d�n�n�h�?�?r c � � d| j fg}| j r|j d| j f� | j r|j d| j f� | j r|j d| j f� |S )Nr
�error_description� error_urir )r
r �appendr r )r r
s r r"