
    i[f	                     ^    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	  G d de          Z
d	S )
   )UnsupportedTokenTypeError)RevocationEndpoint    )ContinueIteration)InvalidTokenError)JWTBearerTokenValidatorc                   0     e Zd ZdZd fd	Zd Zd Z xZS )JWTRevocationEndpointa  JWTRevocationEndpoint inherits from `RFC7009`_
    :class:`~authlib.oauth2.rfc7009.RevocationEndpoint`.

    The JWT access tokens cannot be revoked.
    If the submitted token is a JWT access token, then revocation returns
    a `invalid_token_error`.

    :param issuer: The issuer identifier.

    :param \*\*kwargs: Other parameters are inherited from
        :class:`~authlib.oauth2.rfc7009.RevocationEndpoint`.

    Plain text access tokens and other kind of tokens such as refresh_tokens
    will be ignored by this endpoint and passed to the next revocation endpoint::

        class MyJWTAccessTokenRevocationEndpoint(JWTRevocationEndpoint):
            def get_jwks(self):
                ...

        authorization_server.register_endpoint(
            MyJWTAccessTokenRevocationEndpoint(
                issuer="https://authorization-server.example.org",
            )
        )
        authorization_server.register_endpoint(MyRefreshTokenRevocationEndpoint)

    .. _RFC7009: https://tools.ietf.org/html/rfc7009
    Nc                 L     t                      j        |d|i| || _        d S )Nserver)super__init__issuer)selfr   r   argskwargs	__class__s        U/var/www/piapp/venv/lib/python3.11/site-packages/authlib/oauth2/rfc9068/revocation.pyr   zJWTRevocationEndpoint.__init__&   s/    $8v8888    c                 ^   |                      ||           |j                            d          dvrt                      t	          | j        d          }| j        |_        	 |                    |j        d                    n# t          $ r t                      w xY wt                      ) token_type_hint)access_tokenNN)r   resource_servertoken)
check_paramsformgetr   r   r   get_jwksauthenticate_tokenr   r   )r   requestclient	validators       r   r    z(JWTRevocationEndpoint.authenticate_token*   s    '6*** <-..6LLL#%%%+4;PTUUU	!]		&((g)>???? ! 	& 	& 	&#%%%	& ()))s   $ B Bc                     t                      )zReturn the JWKs that will be used to check the JWT access token signature.
        Developers MUST re-implement this method::

            def get_jwks(self):
                return load_jwks("jwks.json")
        )NotImplementedError)r   s    r   r   zJWTRevocationEndpoint.get_jwks?   s     "###r   )N)__name__
__module____qualname____doc__r   r    r   __classcell__)r   s   @r   r
   r
      se         :     * * **$ $ $ $ $ $ $r   r
   N)rfc6749r   rfc7009r   authlib.common.errorsr   authlib.oauth2.rfc6750.errorsr   &authlib.oauth2.rfc9068.token_validatorr   r
    r   r   <module>r1      s    / / / / / / ( ( ( ( ( ( 3 3 3 3 3 3 ; ; ; ; ; ; J J J J J J>$ >$ >$ >$ >$. >$ >$ >$ >$ >$r   