§
    9P„j¸  ã                   óT   — d Z ddlZ G d„ dej        ¬¦  «        Z G d„ d¦  «        ZdS )z9Experimental framework for authentication in TensorBoard.é    Nc                   ó   — e Zd ZdZd„ ZdS )ÚAuthProviderz:Authentication provider for a specific kind of credential.c                 ó   — dS )ae  Produce an opaque auth token from a WSGI request environment.

        Args:
          environ: A WSGI environment `dict`; see PEP 3333.

        Returns:
          A Python object representing an auth token. The representation
          and semantics depend on the particular `AuthProvider`
          implementation.

        Raises:
          Exception: Any error, usually `tensorboard.errors.PublicError`
            subclasses (like `PermissionDenied`) but also possibly a
            custom error type that should propagate to a WSGI middleware
            for effecting a redirect-driven auth flow.
        N© )ÚselfÚenvirons     úU/root/disk_3tb/conda_envs/Huy-visual/lib/python3.11/site-packages/tensorboard/auth.pyÚauthenticatezAuthProvider.authenticate   s	   € ð" 	ˆó    N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r   r   r	   r   r      s)   € € € € € ØDÐDðð ð ð ð r   r   )Ú	metaclassc                   ó4   — e Zd ZdZd„ Zed„ ¦   «         Zd„ ZdS )ÚAuthContexta  Authentication context within the scope of a single request.

    Auth providers are keyed within an `AuthContext` by arbitrary
    unique keys. It may often make sense for the key used for an
    auth provider to simply be that provider's type object.
    c                 ó0   — || _         || _        i | _        dS )zÖCreate an auth context.

        Args:
          providers: A mapping from provider keys (opaque values) to
            `AuthProvider` implementations.
          environ: A WSGI environment (see PEP 3333).
        N)Ú_environÚ
_providersÚ_cache)r   Ú	providersr   s      r	   Ú__init__zAuthContext.__init__3   s   € ð  ˆŒØ#ˆŒØˆŒˆˆr   c                 ó   —  | i i ¦  «        S )z¶Create an auth context with no registered providers.

        Returns:
          A new `AuthContext` value for which any call to `get` will
          fail with a `KeyError`.
        r   )Úclss    r	   ÚemptyzAuthContext.empty?   s   € ð ˆs�2�r‰{Œ{Ðr   c                 óÆ   — | j         |         }t          ¦   «         }| j                             ||¦  «        }||ur|S |                     | j        ¦  «        }|| j        |<   |S )a  Get an auth token from the auth provider with the given key.

        If successful, the result will be cached on this auth context.
        If unsuccessful, nothing will be cached, so a future call will
        invoke the underlying `AuthProvider.authenticate` method again.

        This method is not thread-safe. If multiple threads share an
        auth context for a single request, then they must synchronize
        externally when calling this method.

        Returns:
          The result of `provider.authenticate(...)` for the auth
          provider specified by `provider_key`.

        Raises:
          KeyError: If the given `provider_key` does not correspond to
            any registered `AuthProvider`.
          Exception: As raised by the underlying `AuthProvider`.
        )r   Úobjectr   Úgetr
   r   )r   Úprovider_keyÚproviderÚsentinelÚvalues        r	   r   zAuthContext.getK   sd   € ð( ”? <Ô0ˆÝ‘8”8ˆØ”—’ ¨hÑ7Ô7ˆØ˜Ð Ð ØˆLØ×%Ò% d¤mÑ4Ô4ˆØ$)ˆŒ�LÑ!Øˆr   N)r   r   r   r   r   Úclassmethodr   r   r   r   r	   r   r   +   sW   € € € € € ðð ð
ð 
ð 
ð ð	ð 	ñ „[ð	ðð ð ð ð r   r   )r   ÚabcÚABCMetar   r   r   r   r	   ú<module>r&      sz   ðð @Ð ?à 
€
€
€
ðð ð ð ð ˜Sœ[ð ñ ô ð ð.;ð ;ð ;ð ;ð ;ñ ;ô ;ð ;ð ;ð ;r   