
    *              	          S r SSKJrJ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)zoauthlib.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                   (    \ 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      n[        U5      n[        U5      n	[        U5      n
[	        U5      n[        XUU5      n[        R                  " U SUUUS.US9  [        R                  " U SUU	U
US.US9  [        R                  " U SSU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   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bearers                Clib/third_party/oauthlib/oauth2/rfc6749/endpoints/pre_configured.pyr(   Server.__init__   s    ( ((9:J"#45N:;LMN./@A%&78M*=M02F ""$#

 "# /",&"3*	
 "	# H8V2DF88     NNN__name__
__module____qualname____firstlineno____doc__r(   __static_attributes__r9   r8   r6   r   r      s    D !%#'+	49r8   r   c                   (    \ rS rSrSr   SS jrSrg)WebApplicationServerO   zLAn all-in-one endpoint featuring Authorization code grant and Bearer tokens.Nc                 8   [        U5      n[        U5      n[        XUU5      n[        R                  " U SSU0US9  [
        R                  " U SUUS.US9  [        R                  " U SSU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/   r0   r4   r5   s	            r6   r(   WebApplicationServer.__init__S   s    & ((9:J%&78M*=M02F""$
+!	#
 /",*
 "# H8V2DF88r8   r9   r:   r;   r9   r8   r6   rC   rC   O   s    T  $ $'+	'9r8   rC   c                   (    \ rS rSrSr   SS jrSrg)MobileApplicationServer}   zGAn all-in-one endpoint featuring Implicit code grant and Bearer tokens.Nc                     [        U5      n[        XUU5      n[        R                  " U SSU0US9  [        R                  " U SSU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*   r,   r+   r-   r/   r1   r5   s           r6   r(    MobileApplicationServer.__init__   s    & ##45N*=M02F""%0!	#
 H8V2DF7GI7GIr8   r9   r:   r;   r9   r8   r6   rH   rH   }   s    O  $ $'+	 Ir8   rH   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                    [        U5      n[        U5      n[        XUU5      n[        R                  " U SUUS.US9  [
        R                  " U SSU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,   r+   r-   r/   r2   r4   r5   s	            r6   r(    LegacyApplicationServer.__init__   s    & ;;LMN%&78M*=M02F%&*
 "# H8V2DF88r8   r9   r:   r;   r9   r8   r6   rP   rP      s    e  $ $'+	"9r8   rP   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      n[        XUU5      n[        R                  " U SSU0US9  [        R                  " U SSU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%   rK   rL   N)r   r   r   r(   r   r   r   )r)   r*   r,   r+   r-   r/   r3   r5   s           r6   r(   !BackendApplicationServer.__init__   s    & //@A*=M02F/)+<=!	#
 H8V2DF7GI7GIr8   r9   r:   r;   r9   r8   r6   rU   rU      s    T  $ $'+	 Ir8   rU   N)r@   
__future__r   r   r#   r   r   r   r	   r
   tokensr   authorizationr   
introspectr   resourcer   
revocationr   r   r   r   rC   rH   rP   rU   r9   r8   r6   <module>r_      s   
 9B B ! 0 * & *  89"$6189v+902D(*:<N+9\$I35G.0B$IN&9m-?.0B&9R$I}.@/1C$Ir8   