§
    ÆÏKe7
  ã                  ó’   — d 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
mZ erddlmZ  G d	„ d
e¦  «        Z G d„ de¦  «        ZdS )z“An Authorizer for use in the Jupyter server.

The default authorizer (AllowAllAuthorizer)
allows all authenticated requests

.. versionadded:: 2.0
é    )Úannotations)ÚTYPE_CHECKING)ÚInstance)ÚLoggingConfigurableé   )ÚIdentityProviderÚUser)ÚJupyterHandlerc                  ó0   — e Zd ZdZ ee¦  «        Zdd„ZdS )Ú
Authorizera’  Base class for authorizing access to resources
    in the Jupyter Server.

    All authorizers used in Jupyter Server
    should inherit from this base class and, at the very minimum,
    implement an ``is_authorized`` method with the
    same signature as in this base class.

    The ``is_authorized`` method is called by the ``@authorized`` decorator
    in JupyterHandler. If it returns True, the incoming request
    to the server is accepted; if it returns False, the server
    returns a 403 (Forbidden) error code.

    The authorization check will only be applied to requests
    that have already been authenticated.

    .. versionadded:: 2.0
    Úhandlerr
   Úuserr	   ÚactionÚstrÚresourceÚreturnÚboolc                ó   — t          ¦   «         ‚)a¼  A method to determine if ``user`` is authorized to perform ``action``
        (read, write, or execute) on the ``resource`` type.

        Parameters
        ----------
        user : jupyter_server.auth.User
            An object representing the authenticated user,
            as returned by :meth:`jupyter_server.auth.IdentityProvider.get_user`.

        action : str
            the category of action for the current request: read, write, or execute.

        resource : str
            the type of resource (i.e. contents, kernels, files, etc.) the user is requesting.

        Returns
        -------
        bool
            True if user authorized to make request; False, otherwise
        )ÚNotImplementedError©Úselfr   r   r   r   s        ú>lib/python3.11/site-packages/jupyter_server/auth/authorizer.pyÚis_authorizedzAuthorizer.is_authorized-   s   € õ. "Ñ#Ô#Ð#ó    N©
r   r
   r   r	   r   r   r   r   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Úidentity_providerr   © r   r   r   r      sE   € € € € € ðð ð& !˜Ð!1Ñ2Ô2Ðð$ð $ð $ð $ð $ð $r   r   c                  ó   — e Zd ZdZdd„ZdS )ÚAllowAllAuthorizerz€A no-op implementation of the Authorizer

    This authorizer allows all authenticated requests.

    .. versionadded:: 2.0
    r   r
   r   r	   r   r   r   r   r   c                ó   — dS )z|This method always returns True.

        All authenticated users are allowed to do anything in the Jupyter Server.
        Tr!   r   s        r   r   z AllowAllAuthorizer.is_authorizedO   s	   € ð ˆtr   Nr   )r   r   r   r   r   r!   r   r   r#   r#   G   s2   € € € € € ðð ðð ð ð ð ð r   r#   N)r   Ú
__future__r   Útypingr   Ú	traitletsr   Útraitlets.configr   Úidentityr   r	   Újupyter_server.base.handlersr
   r   r#   r!   r   r   ú<module>r+      së   ððð ð #Ð "Ð "Ð "Ð "Ð "à  Ð  Ð  Ð  Ð  Ð  à Ð Ð Ð Ð Ð Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0à ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,àð <Ø;Ð;Ð;Ð;Ð;Ð;ð-$ð -$ð -$ð -$ð -$Ð$ñ -$ô -$ð -$ð`ð ð ð ð ˜ñ ô ð ð ð r   