
    qh                     r    S r SSKrSSKJr  SSKJr  SSKJrJr  \R                  " \
5      r " S S\5      rg)	z
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~

This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 RFC6749.
    N)Request)utils   )BaseEndpointcatch_errors_and_unavailabilityc                       \ rS rSrSrS r\S 5       r\S 5       r\S 5       r	\S 5       r
\  SS	 j5       r\  SS
 j5       rSrg)AuthorizationEndpoint   a  Authorization endpoint - used by the client to obtain authorization
from the resource owner via user-agent redirection.

The authorization endpoint is used to interact with the resource
owner and obtain an authorization grant.  The authorization server
MUST first verify the identity of the resource owner.  The way in
which the authorization server authenticates the resource owner (e.g.
username and password login, session cookies) is beyond the scope of
this specification.

The endpoint URI MAY include an "application/x-www-form-urlencoded"
formatted (per `Appendix B`_) query component,
which MUST be retained when adding additional query parameters.  The
endpoint URI MUST NOT include a fragment component::

    https://example.com/path?query=component             # OK
    https://example.com/path?query=component#fragment    # Not OK

Since requests to the authorization endpoint result in user
authentication and the transmission of clear-text credentials (in the
HTTP response), the authorization server MUST require the use of TLS
as described in Section 1.6 when sending requests to the
authorization endpoint::

    # We will deny any request which URI schema is not with https

The authorization server MUST support the use of the HTTP "GET"
method [RFC2616] for the authorization endpoint, and MAY support the
use of the "POST" method as well::

    # HTTP method is currently not enforced

Parameters sent without a value MUST be treated as if they were
omitted from the request.  The authorization server MUST ignore
unrecognized request parameters.  Request and response parameters
MUST NOT be included more than once::

    # Enforced through the design of oauthlib.common.Request

.. _`Appendix B`: https://tools.ietf.org/html/rfc6749#appendix-B
c                 T    [         R                  " U 5        X0l        Xl        X l        g N)r   __init___response_types_default_response_type_default_token_type)selfdefault_response_typedefault_token_typeresponse_typess       a/var/www/html/env/lib/python3.13/site-packages/oauthlib/oauth2/rfc6749/endpoints/authorization.pyr   AuthorizationEndpoint.__init__>   s"    d#-&;##5     c                     U R                   $ r   )r   r   s    r   r   $AuthorizationEndpoint.response_typesE   s    ###r   c                     U R                   $ r   )r   r   s    r   r   +AuthorizationEndpoint.default_response_typeI   s    ***r   c                 L    U R                   R                  U R                  5      $ r   )r   getr   r   s    r   default_response_type_handler3AuthorizationEndpoint.default_response_type_handlerM   s    ""&&t'A'ABBr   c                     U R                   $ r   )r   r   s    r   r   (AuthorizationEndpoint.default_token_typeQ   s    '''r   Nc                 d   [        XX4S9nXWl        SUl        U=(       d    0 R                  5        H  u  p[	        XxU	5        M     U R
                  R                  UR                  U R                  5      n
[        R                  SUR                  U
5        U
R                  XpR                  5      $ ):Extract response_type and route to the designated handler.http_methodbodyheadersNz+Dispatching response_type %s request to %r.)r   scopesuseritemssetattrr   r   response_typer   logdebugcreate_authorization_responser   )r   urir&   r'   r(   r)   credentialsrequestkvresponse_type_handlers              r   r0   3AuthorizationEndpoint.create_authorization_responseU   s     tF &B--/DAG" 0 $ 3 3 7 7!!4#E#E!G		?'')>	@$BB,,. 	.r   c                     [        XX4S9n[        R                  " UR                  5      Ul        U R
                  R                  UR                  U R                  5      nUR                  U5      $ )r$   r%   )
r   r   scope_to_listscoper)   r   r   r-   r   validate_authorization_request)r   r1   r&   r'   r(   r3   r6   s          r   r;   4AuthorizationEndpoint.validate_authorization_requestg   sf     tF ,,W]]; $ 3 3 7 7!!4#E#E!G$CCGLLr   )r   r   r   )GETNNNN)r=   NN)__name__
__module____qualname____firstlineno____doc__r   propertyr   r   r   r   r   r0   r;   __static_attributes__ r   r   r	   r	      s    (T6 $ $ + + C C ( ( %IMMQ. %." %JN/3
M %
Mr   r	   )rB   loggingoauthlib.commonr   oauthlib.oauth2.rfc6749r   baser   r   	getLoggerr>   r.   r	   rE   r   r   <module>rK      s8     # ) ?!`ML `Mr   