+
    P(i                     t    ^ RI t ^ RIHt ^ RIHt ^RIHt Rt] P                  ! ]	4      t
 ! R R4      tR tR# )	    N)jwt)	JoseError)InvalidClientErrorz6urn:ietf:params:oauth:client-assertion-type:jwt-bearerc                   `   a  ] tR t^t o Rt]tRtRR ltR t	R t
R tR tR tR	 tR
 tRtV tR# )JWTBearerClientAssertionzUImplementation of Using JWTs for Client Authentication, which is
defined by RFC7523.
client_assertion_jwtc                *    Wn         W n        W0n        R # )N)	token_url_validate_jtileeway)selfr
   validate_jtir   s   &&&&c/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/authlib/oauth2/rfc7523/client.py__init__!JWTBearerClientAssertion.__init__   s    ")     c                B   VP                   pVP                  R 4      pVP                  R4      pV\        8X  dF   V'       d>   V P                  W4      pV P	                  WV4       V P                  VP                  4      # \        P                  RV P                  4       R# )client_assertion_typeclient_assertionzAuthenticate via %r failedN)
formgetASSERTION_TYPEcreate_resolve_key_funcprocess_assertion_claimsauthenticate_clientclientlogdebugCLIENT_AUTH_METHOD)r   query_clientrequestdataassertion_type	assertionresolve_keys   &&&    r   __call__!JWTBearerClientAssertion.__call__   s{    ||"9:HH/0	^+	66|MK)))A++GNN;;		.0G0GHr   c           	         RRRR\         /RRR/RRRRV P                  /RRR//pV P                  '       d   RRRV P                  /VR	&   V# )
z}Create a claims_options for verify JWT payload claims. Developers
MAY overwrite this method to create a more strict options.
iss	essentialTvalidatesubaudvalueexpjti)_validate_issr
   r   r   )r   optionss   & r   create_claims_options.JWTBearerClientAssertion.create_claims_options'   sj     Kz=AK&Kw?K&	
 )4T=N=NOGENr   c                    \         P                  ! WV P                  4       R7      pVP                  V P                  R7       V#   \
         d3   p\        P                  RT4       \        TP                  R7      ThRp?ii ; i)a)  Extract JWT payload claims from request "assertion", per
`Section 3.1`_.

:param assertion: assertion string value in the request
:param resolve_key: function to resolve the sign key
:return: JWTClaims
:raise: InvalidClientError

.. _`Section 3.1`: https://tools.ietf.org/html/rfc7523#section-3.1
)claims_options)r   zAssertion Error: %rdescriptionN)
r   decoder3   r+   r   r   r   r   r   r8   )r   r$   r%   claimses   &&&  r   r   1JWTBearerClientAssertion.process_assertion_claims7   ss    	GZZt7Q7Q7SF OO4;;O/   	GII+Q/$?QF	Gs   AA B-A>>Bc                |    VP                  V P                  R 4      '       d   V# \        RV P                   2R7      h)tokenz,The client cannot authenticate with method: r7   )check_endpoint_auth_methodr   r   )r   r   s   &&r   r   ,JWTBearerClientAssertion.authenticate_clientL   s>    ,,T-D-DgNNM FtG^G^F_`
 	
r   c                   a aa VVV 3R  lpV# )c                 ~   < VR ,          pS! V4      pV'       g   \        RR7      hVSn        SP                  W04      # )r,   z)The client does not exist on this server.r7   )r   r   resolve_client_public_key)headerspayload	client_idr   r    r!   r   s   &&  r   r%   EJWTBearerClientAssertion.create_resolve_key_func.<locals>.resolve_keyT   sE      I!),F( K  $GN11&BBr    )r   r    r!   r%   s   fff r   r   0JWTBearerClientAssertion.create_resolve_key_funcS   s    	C r   c                    \        4       h)a&  Validate if the given ``jti`` value is used before. Developers
MUST implement this method::

    def validate_jti(self, claims, jti):
        key = "jti:{}-{}".format(claims["sub"], jti)
        if redis.get(key):
            return False
        redis.set(key, 1, ex=3600)
        return True
NotImplementedError)r   r:   r0   s   &&&r   r   %JWTBearerClientAssertion.validate_jtic   s     "##r   c                    \        4       h)a&  Resolve the client public key for verifying the JWT signature.
A client may have many public keys, in this case, we can retrieve it
via ``kid`` value in headers. Developers MUST implement this method::

    def resolve_client_public_key(self, client, headers):
        return client.public_key
rK   )r   r   rD   s   &&&r   rC   2JWTBearerClientAssertion.resolve_client_public_keyp   s     "##r   )r   r   r
   N)T<   )__name__
__module____qualname____firstlineno____doc__r   CLIENT_ASSERTION_TYPEr   r   r&   r3   r   r   r   r   rC   __static_attributes____classdictcell__)__classdict__s   @r   r   r      sF     
 +/I *
 $$ $r   r   c                     V R ,          V8H  # )r,   rH   )r:   r)   s   &&r   r1   r1   {   s    %=Cr   )loggingauthlib.joser   authlib.jose.errorsr   rfc6749r   r   	getLoggerrQ   r   r   r1   rH   r   r   <module>r`      s8      ) (I!l$ l$^ r   