+
    P(iK                     X    ^ RI Ht ^RIHt ^RIHt ^RIHt ^RIHt  ! R R]4      tR# )	    )default_json_headers)InvalidGrantError)InvalidRequestError)TokenEndpoint)UnsupportedTokenTypeErrorc                   F   a  ] tR t^	t o RtRtR tR tR tR t	R t
RtV tR	# )
RevocationEndpointzzImplementation of revocation endpoint which is described in
`RFC7009`_.

.. _RFC7009: https://tools.ietf.org/html/rfc7009

revocationc                    V P                  W4       V P                  VP                  R,          VP                  P                  R4      4      pV'       d"   VP	                  V4      '       g   \        4       hV# )aE  The client constructs the request by including the following
parameters using the "application/x-www-form-urlencoded" format in
the HTTP request entity-body:

token
    REQUIRED.  The token that the client wants to get revoked.

token_type_hint
    OPTIONAL.  A hint about the type of the token submitted for
    revocation.
tokentoken_type_hint)check_paramsquery_tokenformgetcheck_clientr   selfrequestclientr   s   &&& g/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/authlib/oauth2/rfc7009/revocation.pyauthenticate_token%RevocationEndpoint.authenticate_token   sc     	'*  LL!7<<#3#34E#F
 ++F33#%%    c                    R VP                   9  d   \        4       hVP                   P                  R4      pV'       d   W0P                  9  d   \	        4       hR# R# )r   r   N)r   r   r   SUPPORTED_TOKEN_TYPESr   )r   r   r   hints   &&& r   r   RevocationEndpoint.check_params'   sJ    ',,&%''|| 12D : ::+-- ;4r   c                    V P                  V4      pV P                  W4      pV'       d0   V P                  W14       V P                  P	                  RVVR7       ^/ \
        3# )a  Validate revocation request and create the response for revocation.
For example, a client may request the revocation of a refresh token
with the following request::

    POST /revoke HTTP/1.1
    Host: server.example.com
    Content-Type: application/x-www-form-urlencoded
    Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW

    token=45ghiukldjahdnhzdauz&token_type_hint=refresh_token

:returns: (status_code, body, headers)
after_revoke_token)r   r   )authenticate_endpoint_clientr   revoke_tokenserversend_signalr   r   s   &&  r   create_endpoint_response+RevocationEndpoint.create_endpoint_response/   si     227; ''8 e-KK##$ $ 
 B,,,r   c                    \        4       h)a  Get the token from database/storage by the given token string.
Developers should implement this method::

    def query_token(self, token_string, token_type_hint):
        if token_type_hint == 'access_token':
            return Token.query_by_access_token(token_string)
        if token_type_hint == 'refresh_token':
            return Token.query_by_refresh_token(token_string)
        return Token.query_by_access_token(token_string) or                     Token.query_by_refresh_token(token_string)
NotImplementedError)r   token_stringr   s   &&&r   r   RevocationEndpoint.query_tokenN   s     "##r   c                    \        4       h)ab  Mark token as revoked. Since token MUST be unique, it would be
dangerous to delete it. Consider this situation:

1. Jane obtained a token XYZ
2. Jane revoked (deleted) token XYZ
3. Bob generated a new token XYZ
4. Jane can use XYZ to access Bob's resource

It would be secure to mark a token as revoked::

    def revoke_token(self, token, request):
        hint = request.form.get("token_type_hint")
        if hint == "access_token":
            token.access_token_revoked = True
        else:
            token.access_token_revoked = True
            token.refresh_token_revoked = True
        token.save()
r(   )r   r   r   s   &&&r   r"   RevocationEndpoint.revoke_token\   s    ( "##r    N)__name__
__module____qualname____firstlineno____doc__ENDPOINT_NAMEr   r   r%   r   r"   __static_attributes____classdictcell__)__classdict__s   @r   r	   r	   	   s/      !M(.->$$ $r   r	   N)authlib.constsr   rfc6749r   r   r   r   r	   r.   r   r   <module>r:      s"    / ' ) # /g$ g$r   