관리-도구
편집 파일: errors.cpython-39.opt-1.pyc
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 sb e Zd ZdZdZdZd� fdd� Zdd� Zedd � �Z ed d� �Z edd � �Zedd� �Z� Z S )�OAuth2ErrorN� � c s� |dur|| _ d�| j| j �}|r2|dt|� 7 }t� �|� || _|| _|rT|| _|r�|j | _ |j | _ |j| _|j| _|j | _ |j| _|s�|j| _n$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_codeZredirect_uriZ client_idZscopesZ response_type� response_modeZ grant_type)�selfr r r r Zrequest�message�� __class__� �B/usr/lib/python3.9/site-packages/oauthlib/oauth2/rfc6749/errors.pyr s2 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� | jr8|�d| jf� | jrN|�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! \ s zOAuth2Error.jsonc C s\ | j dkrXdd�| j�g}| jr2|�d�| j�� | jrJ|�d�| j�� dd�|�iS i S )N� ZBearerz error="{}"zerror_description="{}"zerror_uri="{}"zWWW-Authenticatez, )r r r r r r �join)r Z authvaluesr r r �headers` s �zOAuth2Error.headers)NNNNN)�__name__� __module__�__qualname__r r r r r �propertyr r r! r&