
    qh.              	           S r SSKJrJrJrJrJr  SSKJr  SSK	J
r
  SSKJr  SSKJr  SSKJr  SS	KJr   " S
 S\
\\\\5      r " S S\
\\\\5      r " S S\
\\\5      r " S S\\\\5      r " S S\\\\5      rg)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                   &    \ rS rSrSr  SS jrSrg)Server   z<An all-in-one endpoint featuring all four major grant types.Nc           	         [        U5      U l        [        U5      U l        [	        U5      U l        [        U5      U l        [        U5      U l	        [        XX$5      U l        [        R                  " U SU R                  U R                  U R                  S.U R                  S9  [        R                  " U SU R                  U R
                  U R                  U R                  S.U R                  S9  [        R                  " U SSU R                  0S9  [         R                  " X5        ["        R                  " X5        g	)
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   r   r   r   )selfrequest_validatortoken_expires_intoken_generatorrefresh_token_generatorargskwargss          b/var/www/html/env/lib/python3.13/site-packages/oauthlib/oauth2/rfc6749/endpoints/pre_configured.pyr+   Server.__init__   s     11BC+,=>C!78I!J./@A!"3-H 	&&t637??484G4G37??7)
 ;?++	G 	t8L9=/3/B/B9=9O9O484F4F	,! 37++	? 	!!$h/7.E	G##D<##D<    )r%   r*   r(   r&   r'   r)   NNN__name__
__module____qualname____firstlineno____doc__r+   __static_attributes__ r5   r3   r   r      s     G;??C-=r5   r   c                   &    \ rS rSrSr  SS jrSrg)WebApplicationServerI   zLAn all-in-one endpoint featuring Authorization code grant and Bearer tokens.Nc                    [        U5      U l        [        U5      U l        [	        XX45      U l        [        R                  " U SSU R                  0U R
                  S9  [        R                  " U SU R                  U R                  S.U R
                  S9  [        R                  " U SSU R
                  0S9  [        R                  " X5        [        R                  " X5        g)	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.   r0   r2   s         r3   r+   WebApplicationServer.__init__N   s     11BC./@A!"3-H&&t67=t6O:>++	G 	t8L9=484F4F,! 37++	? 	!!$h/7.E	G##D<##D<r5   )r%   r*   r)   r6   r7   r>   r5   r3   r@   r@   I   s     W:>@D=r5   r@   c                   &    \ rS rSrSr  SS jrSrg)MobileApplicationServerp   zGAn all-in-one endpoint featuring Implicit code grant and Bearer tokens.Nc                 <   [        U5      U l        [        XX45      U l        [        R
                  " U SSU R                  0U R                  S9  [        R
                  " U SSU R                  0S9  [        R
                  " XS/S9  [        R
                  " XS/S9  g)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   rC   s         r3   r+    MobileApplicationServer.__init__u   s     ,,=>!"3-H&&t7+2D4G4G7I:>++	G 	!!$h/7.E	G##D;I:J	L##D;I:J	Lr5   )r*   r&   r6   r7   r>   r5   r3   rF   rF   p   s     R:>@DLr5   rF   c                   &    \ rS rSrSr  SS jrSrg)LegacyApplicationServer   z]An all-in-one endpoint featuring Resource Owner Password Credentials grant and Bearer tokens.Nc                 r   [        U5      U l        [        U5      U l        [	        XX45      U l        [        R                  " U SU R                  U R                  S.U R
                  S9  [        R                  " U SSU R
                  0S9  [        R                  " X5        [        R                  " X5        g)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   rC   s         r3   r+    LegacyApplicationServer.__init__   s     D./@A!"3-Ht
/3/B/B484F4F,! 37++	? 	!!$h/7.E	G##D<##D<r5   )r*   r'   r)   r6   r7   r>   r5   r3   rN   rN      s     h:>@D=r5   rN   c                   &    \ rS rSrSr  SS jrSrg)BackendApplicationServer   zLAn all-in-one endpoint featuring Client Credentials grant and Bearer tokens.Nc                 <   [        U5      U l        [        XX45      U l        [        R
                  " U SSU R                  0U R                  S9  [        R
                  " U SSU R                  0S9  [        R
                  " XS/S9  [        R
                  " XS/S9  g)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"   rI   rJ   N)	r   r(   r   r*   r   r+   r   r   r   rC   s         r3   r+   !BackendApplicationServer.__init__   s     "88I!J!"3-Ht8L#79O9O,Q26++	? 	!!$h/7.E	G##D;I:J	L##D;I:J	Lr5   )r*   r(   r6   r7   r>   r5   r3   rS   rS      s     W:>@DLr5   rS   N)r<   r    r   r   r   r   r   tokensr   authorizationr
   
introspectr   resourcer   
revocationr   r   r   r   r@   rF   rN   rS   r>   r5   r3   <module>r\      s     ! 0 * & *  2="$612=j$=02Dm+-?$=N L35G.0B LF"=m-?.0B"=J L}.@/1C Lr5   