o
    y¨Êh“.  ã                   @   sî   d Z ddlmZmZ ddlmZmZmZmZm	Z	 ddl
mZ ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZ G dd„ deeeeeƒZG dd„ deeeeeƒZG dd„ deeeeƒZG dd„ deeeeƒZG dd„ deeeeƒZdS )zÊ
oauthlib.oauth2.rfc6749.endpoints.pre_configured
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This module is an implementation of various endpoints needed
for providing OAuth 2.0 RFC6749 servers.
é    )Úabsolute_importÚunicode_literalsé   )ÚAuthorizationCodeGrantÚClientCredentialsGrantÚImplicitGrantÚRefreshTokenGrantÚ%ResourceOwnerPasswordCredentialsGrant)ÚBearerTokené   )ÚAuthorizationEndpoint)ÚIntrospectEndpoint)ÚResourceEndpoint)ÚRevocationEndpoint)ÚTokenEndpointc                   @   ó   e Zd ZdZ		ddd„ZdS )ÚServerz<An all-in-one endpoint featuring all four major grant types.Nc                 O   sœ   t |ƒ}t|ƒ}t|ƒ}	t|ƒ}
t|ƒ}t||||ƒ}tj| d|||dœ|d� tj| d||	|
|dœ|d� t	j| dd|id� 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   r   r	   r   r   r
   r   Ú__init__r   r   r   r   )ÚselfÚrequest_validatorÚtoken_expires_inÚtoken_generatorÚrefresh_token_generatorÚargsÚkwargsÚ
auth_grantÚimplicit_grantÚpassword_grantÚcredentials_grantÚrefresh_grantÚbearer© r3   úb/var/www/html/env/lib/python3.10/site-packages/oauthlib/oauth2/rfc6749/endpoints/pre_configured.pyr%      s<   ÿÿýúüùÿzServer.__init__©NNN©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r%   r3   r3   r3   r4   r      ó
    ÿr   c                   @   r   )ÚWebApplicationServerzLAn all-in-one endpoint featuring Authorization code grant and Bearer tokens.Nc           	      K   s|   t |ƒ}t|ƒ}t||||ƒ}tj| dd|i|d� tj| d||dœ|d� tj| dd|id� t | |¡ t | |¡ dS )	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.
        r   r   r   )r   r   r   r!   r"   N)	r   r   r
   r   r%   r   r   r   r   )	r&   r'   r)   r(   r*   r,   r-   r1   r2   r3   r3   r4   r%   R   s(   ÿþþûÿzWebApplicationServer.__init__r5   r6   r3   r3   r3   r4   r<   M   r;   r<   c                   @   r   )ÚMobileApplicationServerzGAn all-in-one endpoint featuring Implicit code grant and Bearer tokens.Nc                 K   óh   t |ƒ}t||||ƒ}tj| dd|i|d� tj| dd|id� tj| |dgd� tj| |dgd� dS )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.
        r   r   r!   r"   Úaccess_token©Úsupported_token_typesN)r   r
   r   r%   r   r   r   )r&   r'   r)   r(   r*   r,   r.   r2   r3   r3   r4   r%   y   ó$   ÿÿýÿÿ
ÿz MobileApplicationServer.__init__r5   r6   r3   r3   r3   r4   r=   t   r;   r=   c                   @   r   )ÚLegacyApplicationServerz]An all-in-one endpoint featuring Resource Owner Password Credentials grant and Bearer tokens.Nc           	      K   sf   t |ƒ}t|ƒ}t||||ƒ}tj| d||dœ|d� tj| dd|id� t | |¡ t | |¡ dS )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   )r   r   r   r!   r"   N)r	   r   r
   r   r%   r   r   r   )	r&   r'   r)   r(   r*   r,   r/   r1   r2   r3   r3   r4   r%   œ   s$   ÿÿþûÿz LegacyApplicationServer.__init__r5   r6   r3   r3   r3   r4   rC   —   r;   rC   c                   @   r   )ÚBackendApplicationServerzLAn all-in-one endpoint featuring Client Credentials grant and Bearer tokens.Nc                 K   r>   )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.
        r   r   r!   r"   r?   r@   N)r   r
   r   r%   r   r   r   )r&   r'   r)   r(   r*   r,   r0   r2   r3   r3   r4   r%   Á   rB   z!BackendApplicationServer.__init__r5   r6   r3   r3   r3   r4   rD   ¼   r;   rD   N)r:   Ú
__future__r   r   r    r   r   r   r   r	   Útokensr
   Úauthorizationr   Ú
introspectr   Úresourcer   Ú
revocationr   r   r   r   r<   r=   rC   rD   r3   r3   r3   r4   Ú<module>   s0   ÿ5ÿ'ÿ#ÿ%ÿ