File manager - Edit - /usr/lib/python3/dist-packages/oauthlib/oauth2/rfc6749/__pycache__/errors.cpython-310.pyc
Back
o ���a�2 � @ sJ d Z ddlZddlmZmZ G dd� de�ZG dd� de�ZG dd � d e�ZG d d� de�Z G dd � d e�Z G dd� de�ZG dd� de�ZG dd� de�Z G dd� de �ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG d d!� d!e�ZG d"d#� d#e�ZG d$d%� d%e�ZG d&d'� d'e�ZG d(d)� d)e�ZG d*d+� d+e�ZG d,d-� d-e�ZG d.d/� d/e�ZG d0d1� d1e�ZG d2d3� d3e�ZG d4d5� d5e �ZG d6d7� d7e�ZG d8d9� d9e�Z G d:d;� d;e�Z!G d<d=� d=e�Z"G d>d?� d?e�Z#G d@dA� dAe�Z$G dBdC� dCe�Z%G dDdE� dEe�Z&G dFdG� dGe�Z'dJdHdI�Z(dS )Kz� 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 sf e Zd ZdZdZdZ d� fdd� Zdd� Zedd � �Z ed d� �Z edd � �Zedd� �Z� Z S )�OAuth2ErrorN� � c s� |dur|| _ d�| j| j �}|r|dt|� 7 }t� �|� || _|| _|r*|| _|rN|j | _ |j | _ |j| _|j| _|j | _ |j| _|sL|j| _dS dS d| _ d| _ d| _d| _d| _ d| _dS )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__� �@/usr/lib/python3/dist-packages/oauthlib/oauth2/rfc6749/errors.pyr s4 � zOAuth2Error.__init__c C s | j dk}t|| j|�S )N�fragment)r r � twotuples)r r r r r r �in_uriI s zOAuth2Error.in_uric C sR d| j fg}| jr|�d| jf� | jr|�d| jf� | jr'|�d| jf� |S )Nr �error_description� error_urir )r r �appendr r )r r r r r r M s zOAuth2Error.twotuplesc C s t | j�S �N)r r �r r r r � urlencodedX s zOAuth2Error.urlencodedc C s t �t| j��S r$ )�json�dumps�dictr r% r r r r'