Ë
    :vžjs
  ã                  ó�   — 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 dd	lmZ  G d
„ de«      Z G d„ de«      Zy)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)Ú	Awaitable)ÚJupyterHandlerc                  ó<   — e Zd ZdZ ee«      Z	 	 	 	 	 	 	 	 	 	 dd„Zy)Ú
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
    c                ó   — 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©ÚselfÚhandlerÚuserÚactionÚresources        úo/workspace/moltex-experiments/.pixi/envs/default/lib/python3.12/site-packages/jupyter_server/auth/authorizer.pyÚis_authorizedzAuthorizer.is_authorized0   s
   € ô. "Ð!ó    N)
r   r   r   r	   r   Ústrr   r   ÚreturnzAwaitable[bool] | bool)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Úidentity_providerr   © r   r   r   r      sB   „ ññ& !Ð!1Ó2Ðð"Ø%ð"Ø-1ð"Ø;>ð"ØJMð"à	ô"r   r   c                  ó,   — e Zd ZdZ	 	 	 	 	 	 	 	 	 	 dd„Zy)ÚAllowAllAuthorizerz€A no-op implementation of the Authorizer

    This authorizer allows all authenticated requests.

    .. versionadded:: 2.0
    c                 ó   — y)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_authorizedR   s   € ð r   N)
r   r   r   r	   r   r   r   r   r   Úbool)r   r   r   r   r   r    r   r   r"   r"   J   s4   „ ñðØ%ðØ-1ðØ;>ðØJMðà	ôr   r"   N)r   Ú
__future__r   Útypingr   Ú	traitletsr   Útraitlets.configr   Úidentityr   r	   Úcollections.abcr
   Újupyter_server.base.handlersr   r   r"   r    r   r   Ú<module>r,      s>   ðñõ #å  å Ý 0ç ,áÝ)å;ô-"Ð$ô -"ô`˜õ r   