PHP WebShell

Текущая директория: /usr/lib/python3/dist-packages/oauthlib/oauth2/rfc6749/endpoints/__pycache__

Просмотр файла: pre_configured.cpython-310.pyc

o

���a�.�@s�dZddlmZmZmZmZmZddlmZddl	m
Z
ddlmZddl
mZddlmZdd	lmZGd
d�de
eeee�ZGdd
�d
e
eeee�ZGdd�de
eee�ZGdd�deeee�ZGdd�deeee�ZdS)z�
oauthlib.oauth2.rfc6749.endpoints.pre_configured
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This module is an implementation of various endpoints needed
for providing OAuth 2.0 RFC6749 servers.
�)�AuthorizationCodeGrant�ClientCredentialsGrant�
ImplicitGrant�RefreshTokenGrant�%ResourceOwnerPasswordCredentialsGrant)�BearerToken�)�AuthorizationEndpoint)�IntrospectEndpoint)�ResourceEndpoint)�RevocationEndpoint)�
TokenEndpointc@�eZdZdZ		ddd�ZdS)�Serverz<An all-in-one endpoint featuring all four major grant types.NcOs�t|�|_t|�|_t|�|_t|�|_t|�|_	t
||||�|_tj
|d|j|j|jd�|jd�tj
|d|j|j|j|j	d�|jd�tj
|dd|jid�t�
||�t�
||�d	S)
a�Construct a new all-grants-in-one server.

        :param request_validator: An implementation of
                                  oauthlib.oauth2.RequestValidator.
        :param token_expires_in: An int or a function to generate a token
                                 expiration offset (in seconds) given a
                                 oauthlib.common.Request object.
        :param token_generator: A function to generate a token from a request.
        :param refresh_token_generator: A function to generate a token from a
                                        request for the refresh token.
        :param kwargs: Extra parameters to pass to authorization-,
                       token-, resource-, and revocation-endpoint constructors.
        �code)r�token�none��default_response_type�response_types�default_token_type�authorization_code)r�password�client_credentials�
refresh_token��default_grant_type�grant_typesr�Bearer��
default_token�token_typesN)r�
auth_grantr�implicit_grantr�password_grantr�credentials_grantr�
refresh_grantr�bearerr	�__init__r
rrr
)�self�request_validator�token_expires_in�token_generator�refresh_token_generator�args�kwargs�r0�R/usr/lib/python3/dist-packages/oauthlib/oauth2/rfc6749/endpoints/pre_configured.pyr(s<

�

������zServer.__init__�NNN��__name__�
__module__�__qualname__�__doc__r(r0r0r0r1r�
�rc@r)�WebApplicationServerzLAn all-in-one endpoint featuring Authorization code grant and Bearer tokens.NcKs�t|�|_t|�|_t||||�|_tj|dd|ji|jd�tj|d|j|jd�|jd�t	j|dd|jid�t
�||�t�||�dS)	a�Construct a new web application server.

        :param request_validator: An implementation of
                                  oauthlib.oauth2.RequestValidator.
        :param token_expires_in: An int or a function to generate a token
                                 expiration offset (in seconds) given a
                                 oauthlib.common.Request object.
        :param token_generator: A function to generate a token from a request.
        :param refresh_token_generator: A function to generate a token from a
                                        request for the refresh token.
        :param kwargs: Extra parameters to pass to authorization-,
                       token-, resource-, and revocation-endpoint constructors.
        rrr)rrrrrN)rr"rr&rr'r	r(r
rrr
�r)r*r,r+r-r/r0r0r1r(Ns(

�����zWebApplicationServer.__init__r2r3r0r0r0r1r9Ir8r9c@r)�MobileApplicationServerzGAn all-in-one endpoint featuring Implicit code grant and Bearer tokens.NcK�rt|�|_t||||�|_tj|dd|ji|jd�tj|dd|jid�tj||dgd�tj||dgd�dS)a�Construct a new implicit grant server.

        :param request_validator: An implementation of
                                  oauthlib.oauth2.RequestValidator.
        :param token_expires_in: An int or a function to generate a token
                                 expiration offset (in seconds) given a
                                 oauthlib.common.Request object.
        :param token_generator: A function to generate a token from a request.
        :param refresh_token_generator: A function to generate a token from a
                                        request for the refresh token.
        :param kwargs: Extra parameters to pass to authorization-,
                       token-, resource-, and revocation-endpoint constructors.
        rrrr�access_token��supported_token_typesN)	rr#rr'r	r(rrr
r:r0r0r1r(u�$
�����
�z MobileApplicationServer.__init__r2r3r0r0r0r1r;pr8r;c@r)�LegacyApplicationServerz]An all-in-one endpoint featuring Resource Owner Password Credentials grant and Bearer tokens.NcKstt|�|_t|�|_t||||�|_tj|d|j|jd�|jd�tj|dd|jid�t	�||�t
�||�dS)aConstruct a resource owner password credentials grant server.

        :param request_validator: An implementation of
                                  oauthlib.oauth2.RequestValidator.
        :param token_expires_in: An int or a function to generate a token
                                 expiration offset (in seconds) given a
                                 oauthlib.common.Request object.
        :param token_generator: A function to generate a token from a request.
        :param refresh_token_generator: A function to generate a token from a
                                        request for the refresh token.
        :param kwargs: Extra parameters to pass to authorization-,
                       token-, resource-, and revocation-endpoint constructors.
        r)rrrrrN)rr$rr&rr'r
r(rrr
r:r0r0r1r(�s$�
����z LegacyApplicationServer.__init__r2r3r0r0r0r1rA�r8rAc@r)�BackendApplicationServerzLAn all-in-one endpoint featuring Client Credentials grant and Bearer tokens.NcKr<)a�Construct a client credentials grant server.

        :param request_validator: An implementation of
                                  oauthlib.oauth2.RequestValidator.
        :param token_expires_in: An int or a function to generate a token
                                 expiration offset (in seconds) given a
                                 oauthlib.common.Request object.
        :param token_generator: A function to generate a token from a request.
        :param refresh_token_generator: A function to generate a token from a
                                        request for the refresh token.
        :param kwargs: Extra parameters to pass to authorization-,
                       token-, resource-, and revocation-endpoint constructors.
        rrrrr=r>N)	rr%rr'r
r(rrr
r:r0r0r1r(�r@z!BackendApplicationServer.__init__r2r3r0r0r0r1rB�r8rBN)r7rrrrrr�tokensr�
authorizationr	�
introspectr
�resourcer�
revocationrrr
rr9r;rArBr0r0r0r1�<module>s.�5�'�#�%�

Выполнить команду


Для локальной разработки. Не используйте в интернете!