ó
    Ú^íhs
  ã                  óš   • S 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
Jr  \(       a  SSKJr  SS	KJr   " S
 S\5      r " S S\5      rg)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                  óF   • \ rS rSrSr\" \5      r          SS jrSr	g)Ú
Authorizeré   a^  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                ó   • [         e)aD  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        ÚX/home/james-whalen/.local/lib/python3.13/site-packages/jupyter_server/auth/authorizer.pyÚis_authorizedÚAuthorizer.is_authorized0   s
   € ô. "Ð!ó    © N)
r   r   r   r	   r   Ústrr   r   ÚreturnzAwaitable[bool] | bool)
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   Úidentity_providerr   Ú__static_attributes__r   r   r   r   r      sB   † ññ& !Ð!1Ó2Ðð"Ø%ð"Ø-1ð"Ø;>ð"ØJMð"à	÷"r   r   c                  ó6   • \ rS rSrSr          SS jrSrg)ÚAllowAllAuthorizeréJ   ztA no-op implementation of the Authorizer

This authorizer allows all authenticated requests.

.. versionadded:: 2.0
c                ó   • g)zlThis method always returns True.

All authenticated users are allowed to do anything in the Jupyter Server.
Tr   r   s        r   r   Ú AllowAllAuthorizer.is_authorizedR   s   € ð r   r   N)
r   r   r   r	   r   r   r   r   r   Úbool)r   r   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>r2      s>   ðñõ #å  å Ý 0ç ,æÝ)å;ô-"Ð$ô -"ô`˜õ r   