
    kh-              	          d 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 d
dlmZ  G d de
eeee      Z G d de
eeee      Z G d de
eee      Z G d deeee      Z G d deeee      Zy)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)TokenEndpoint    )DeviceCodeGrantc                       e Zd ZdZ	 	 	 ddZy)Serverz_
    An all-in-one endpoint featuring all four major grant types
    and extension grants.
    Nc           
         t        |      | _        t        |      | _        t	        |      | _        t        |      | _        t        |      | _	        t        |fi || _        t        ||||      | _        t        j                  | d| j                  | j                  | j                  d| j                         t!        j                  | d| j                  | j
                  | j                  | j                  | j                  d| j                         t#        j                  | dd| j                  i       t%        j                  | |       t'        j                  | |       y	)
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_tokenz,urn:ietf:params:oauth:grant-type:device_codedefault_grant_typegrant_typesr   Bearerdefault_tokentoken_typesN)r   
auth_grantr   implicit_grantr   password_grantr   credentials_grantr   refresh_grantr   device_code_grantr   bearerr
   __init__r   r   r   r   )selfrequest_validatortoken_expires_intoken_generatorrefresh_token_generatorargskwargss          l/var/www/teggl/fontify/venv/lib/python3.12/site-packages/oauthlib/oauth2/rfc6749/endpoints/pre_configured.pyr-   zServer.__init__!   sA   , 11BC+,=>CDUV!78I!J./@A!01B!Mf!M!0@BY
 	&&"(,,
  ${{		
 	3&*oo //&*&<&<!%!3!3@D@V@V  ${{	
 	!!x6M	
 	##D*;<##D*;<    NNN__name__
__module____qualname____doc__r-    r6   r5   r   r      s      $<=r6   r   c                       e Zd ZdZ	 	 	 ddZy)WebApplicationServerzLAn all-in-one endpoint featuring Authorization code grant and Bearer tokens.Nc                    t        |      | _        t        |      | _        t	        ||||      | _        t        j                  | dd| j                  i| j
                         t        j                  | d| j                  | j                  d| j
                         t        j                  | dd| j
                  i       t        j                  | |       t        j                  | |       y)	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/   r1   r0   r2   r4   s         r5   r-   zWebApplicationServer.__init__e   s    * 11BC./@A!0@BY
 	&&"("DOO4#{{		
 	3&*oo!%!3!3  ${{	
 	!!x6M	
 	##D*;<##D*;<r6   r7   r8   r=   r6   r5   r?   r?   `   s     W
  $-=r6   r?   c                       e Zd ZdZ	 	 	 ddZy)MobileApplicationServerzGAn all-in-one endpoint featuring Implicit code grant and Bearer tokens.Nc                 T   t        |      | _        t        ||||      | _        t	        j
                  | dd| j                  i| j                         t        j
                  | dd| j                  i       t        j
                  | |dg       t        j
                  | |dg       y)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   rA   s         r5   r-   z MobileApplicationServer.__init__   s    * ,,=>!0@BY
 	&&")#T%8%89#{{		
 	!!x6M	
 	###N;K	
 	###N;K	
r6   r7   r8   r=   r6   r5   rC   rC      s     R
  $'
r6   rC   c                       e Zd ZdZ	 	 	 ddZy)LegacyApplicationServerz]An all-in-one endpoint featuring Resource Owner Password Credentials grant and Bearer tokens.Nc                 ~   t        |      | _        t        |      | _        t	        ||||      | _        t        j                  | d| j                  | j                  d| j
                         t        j                  | dd| j
                  i       t        j                  | |       t        j                  | |       y)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   rA   s         r5   r-   z LegacyApplicationServer.__init__   s    * DDUV./@A!0@BY
 	) //!%!3!3  ${{	
 	!!x6M	
 	##D*;<##D*;<r6   r7   r8   r=   r6   r5   rI   rI      s     h
  $'=r6   rI   c                       e Zd ZdZ	 	 	 ddZy)BackendApplicationServerzLAn all-in-one endpoint featuring Client Credentials grant and Bearer tokens.Nc                 T   t        |      | _        t        ||||      | _        t	        j
                  | dd| j                  i| j                         t        j
                  | dd| j                  i       t        j
                  | |dg       t        j
                  | |dg       y)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#   rE   rF   N)	r   r)   r   r,   r   r-   r   r   r   rA   s         r5   r-   z!BackendApplicationServer.__init__   s    * "88I!J!0@BY
 	3-t/E/EF#{{		
 	!!x6M	
 	###N;K	
 	###N;K	
r6   r7   r8   r=   r6   r5   rL   rL      s     W
  $'
r6   rL   N)r<   r!   r   r   r   r   r   tokensr   authorizationr
   
introspectr   resourcer   
revocationr   r   r   #oauthlib.oauth2.rfc8628.grant_typesr   r   r?   rC   rI   rL   r=   r6   r5   <module>rT      s     ! 0 * & *   ?D=-}>NPbD=N2=-}>NPb2=j,
-/?AS,
^,=%'79K,=^,
%'79K,
r6   