+
    P(i8                     :    ^ RI t ^ RIHt ^ RIHt  ! R R4      tR# )    N)	to_native)jwtc                   p   a  ] tR t^t o RtRtRR lt]R 4       t]R 4       t	RR lt
RR ltRR	 ltR
tV tR# )JWTBearerTokenGeneratora  A JSON Web Token formatted bearer token generator for jwt-bearer grant type.
This token generator can be registered into authorization server::

    authorization_server.register_token_generator(
        "urn:ietf:params:oauth:grant-type:jwt-bearer",
        JWTBearerTokenGenerator(private_rsa_key),
    )

In this way, we can generate the token into JWT format. And we don't have to
save this token into database, since it will be short time valid. Consider to
rewrite ``JWTBearerGrant.save_token``::

    class MyJWTBearerGrant(JWTBearerGrant):
        def save_token(self, token):
            pass

:param secret_key: private RSA key in bytes, JWK or JWK Set.
:param issuer: a string or URI of the issuer
:param alg: ``alg`` to use in JWT
i  Nc                *    Wn         W n        W0n        R # N)
secret_keyissueralg)selfr	   r
   r   s   &&&&b/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/authlib/oauth2/rfc7523/token.py__init__ JWTBearerTokenGenerator.__init__   s    $    c                8    V'       d   V P                  V4      pV# r   )get_allowed_scope)clientscopes   &&r   r   )JWTBearerTokenGenerator.get_allowed_scope$   s    ,,U3Er   c                "    V P                  4       # )zReturn user's ID as ``sub`` value in token payload. For instance::

@staticmethod
def get_sub_value(user):
    return str(user.id)
)get_user_id)users   &r   get_sub_value%JWTBearerTokenGenerator.get_sub_value*   s     !!r   c                   V P                  W%4      p\        \        P                  ! 4       4      pR VRVRVRWc,           RVP                  4       /pV P                  '       d   V P                  VR&   V'       d   V P                  V4      VR&   V# )r   
grant_typeiatexp	client_idisssub)r   inttimeget_client_idr
   r   )r   r   r   
expires_inr   r   	issued_atdatas   &&&&&&  r   get_token_data&JWTBearerTokenGenerator.get_token_data4   s    &&v5		$	U*99)--/
 ;;;++DK,,T2DKr   c                    Vf   V P                   pV P                  WWSV4      p\        P                  ! RV P                  /W`P
                  RR7      pRRR\        V4      RV/pV'       d   WHR&   V# )	aH  Generate a bearer token for OAuth 2.0 authorization token endpoint.

:param client: the client that making the request.
:param grant_type: current requested grant_type.
:param user: current authorized user.
:param expires_in: if provided, use this value as expires_in.
:param scope: current requested scope.
:return: Token dict
r   F)keycheck
token_typeBeareraccess_tokenr%   r   )DEFAULT_EXPIRES_INr(   r   encoder   r	   r   )	r   r   r   r   r   r%   
token_datar/   tokens	   &&&&&&   r   generate JWTBearerTokenGenerator.generateD   sy     00J((ZuU
zzDHHze
 (Il3*

 "'Nr   c                (    V P                  WW4V4      # r   )r4   )r   r   r   r   r   r%   include_refresh_tokens   &&&&&&&r   __call__ JWTBearerTokenGenerator.__call__^   s     }}ZjIIr   )r   r
   r	   )NRS256)NN)NNN)NNNT)__name__
__module____qualname____firstlineno____doc__r0   r   staticmethodr   r   r(   r4   r8   __static_attributes____classdictcell__)__classdict__s   @r   r   r      sU     * 
  
 " " 4
J 
Jr   r   )r#   authlib.common.encodingr   authlib.joser   r    r   r   <module>rG      s     - aJ aJr   