U
    Tc2                  	   @   s   d Z ddlmZmZmZ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mZmZ ddlmZmZmZ ddlmZ d	d
lmZ G dd deeeeeeZdS )z
oauthlib.openid.connect.core.endpoints.pre_configured
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This module is an implementation of various endpoints needed
for providing OpenID Connect servers.
    )AuthorizationEndpointIntrospectEndpointResourceEndpointRevocationEndpointTokenEndpoint)AuthorizationCodeGrantClientCredentialsGrantImplicitGrantRefreshTokenGrant%ResourceOwnerPasswordCredentialsGrant)BearerToken   )r   HybridGrantr	   ) AuthorizationCodeGrantDispatcher!AuthorizationTokenGrantDispatcherImplicitTokenGrantDispatcher)JWTToken   )UserInfoEndpointc                   @   s   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   sF  t || _t|| _t|| _t|| _t|| _	t
|| _t|| _t|| _t||||| _t||||| _t| j| jd| _t| j| jd| _tj| d| j| j| j| j| j| j| j| jd| jd t|| j| jd| _tj| d| j| j| j| j	d| jd tj| d| j| jd	d
 t| | 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.
        )Zdefault_grantZ
oidc_grantcode)r   tokenZid_tokenzid_token tokenz
code tokenzcode id_tokenzcode id_token tokennone)Zdefault_response_typeZresponse_typesdefault_token_typeauthorization_code)r   passwordZclient_credentialsZrefresh_token)Zdefault_grant_typegrant_typesr   Bearer)r   ZJWT)Zdefault_tokenZtoken_typesN)!OAuth2AuthorizationCodeGrantZ
auth_grantOAuth2ImplicitGrantZimplicit_grantr   Zpassword_grantr   Zcredentials_grantr
   Zrefresh_grantr   Zopenid_connect_authr	   Zopenid_connect_implicitr   Zopenid_connect_hybridr   Zbearerr   Zjwtr   Zauth_grant_choicer   Zimplicit_grant_choicer   __init__r   Ztoken_grant_choicer   r   r   r   r   )selfZrequest_validatorZtoken_expires_inZtoken_generatorZrefresh_token_generatorargskwargs r$   Y/tmp/pip-unpacked-wheel-dp7l75bz/oauthlib/openid/connect/core/endpoints/pre_configured.pyr    !   s^    






  
zServer.__init__)NNN)__name__
__module____qualname____doc__r    r$   r$   r$   r%   r      s
       r   N)r)   Z!oauthlib.oauth2.rfc6749.endpointsr   r   r   r   r   Z#oauthlib.oauth2.rfc6749.grant_typesr   r   r   r	   r   r
   r   Zoauthlib.oauth2.rfc6749.tokensr   r   r   Zgrant_types.dispatchersr   r   r   tokensr   userinfor   r   r$   r$   r$   r%   <module>   s     