+
    P(¸i¥!  ã                   ó`   € ^ RI t ^ 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# )	é    N)ÚOptional)ÚUnion©Úgenerate_token)Újwt)ÚBearerTokenGeneratorc                   ó¦   a a€ ] tR t^
t oRtRV 3R lltR tR tV3R lR ltV3R lR lt	V3R	 lR
 lt
V3R lR ltV3R lR ltR tRtVtV ;t# )ÚJWTBearerTokenGeneratora›  A JWT formatted access token generator.

:param issuer: The issuer identifier. Will appear in the JWT ``iss`` claim.

:param \\*\\*kwargs: Other parameters are inherited from
    :class:`~authlib.oauth2.rfc6750.token.BearerTokenGenerator`.

This token generator can be registered into the authorization server::

    class MyJWTBearerTokenGenerator(JWTBearerTokenGenerator):
        def get_jwks(self): ...

        def get_extra_claims(self, client, grant_type, user, scope): ...


    authorization_server.register_token_generator(
        "default",
        MyJWTBearerTokenGenerator(
            issuer="https://authorization-server.example.org"
        ),
    )
c                óT   <€ \         SV `  V P                  W44       Wn        W n        R # )N)ÚsuperÚ__init__Úaccess_token_generatorÚissuerÚalg)Úselfr   r   Úrefresh_token_generatorÚexpires_generatorÚ	__class__s   &&&&&€Úb/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/authlib/oauth2/rfc9068/token.pyr   Ú JWTBearerTokenGenerator.__init__"   s*   ø€ ô 	‰ÑØ×'Ñ'Ð)@ô	
ð ŒØŽó    c                ó   € \        4       h)zªReturn the JWKs that will be used to sign the JWT access token.
Developers MUST re-implement this method::

    def get_jwks(self):
        return load_jwks("jwks.json")
)ÚNotImplementedError)r   s   &r   Úget_jwksÚ JWTBearerTokenGenerator.get_jwks/   s   € ô "Ó#Ð#r   c                ó   € / # )a1  Return extra claims to add in the JWT access token. Developers MAY
re-implement this method to add identity claims like the ones in
:ref:`specs/oidc` ID Token, or any other arbitrary claims::

    def get_extra_claims(self, client, grant_type, user, scope):
        return generate_user_info(user, scope)
© ©r   ÚclientÚ
grant_typeÚuserÚscopes   &&&&&r   Úget_extra_claimsÚ(JWTBearerTokenGenerator.get_extra_claims8   s	   € ð ˆ	r   c                óF   <€ V ^8„  d   QhRS[ S[S[S[,          3,          /# ©é   Úreturn)r   ÚstrÚlist)ÚformatÚ__classdict__s   "€r   Ú__annotate__Ú$JWTBearerTokenGenerator.__annotate__B   s!   ø€ ÷ &ñ &±E¹#¹tÁC½y¸.Õ4Iñ &r   c                ó"   € VP                  4       # )a*  Return the audience for the token. By default this simply returns
the client ID. Developers MAY re-implement this method to add extra
audiences::

    def get_audiences(self, client, user, scope):
        return [
            client.get_client_id(),
            resource_server.get_id(),
        ]
)Úget_client_id)r   r   r!   r"   s   &&&&r   Úget_audiencesÚ%JWTBearerTokenGenerator.get_audiencesB   s   € ð ×#Ñ#Ó%Ð%r   c                ó0   <€ V ^8„  d   QhRS[ S[,          /# r&   )r   r)   )r+   r,   s   "€r   r-   r.   O   s   ø€ ÷ ñ ™x©}ñ r   c                ó   € R# )ay  Authentication Context Class Reference.
Returns a user-defined case sensitive string indicating the class of
authentication the used performed. Token audience may refuse to give access to
some resources if some ACR criteria are not met.
:ref:`specs/oidc` defines one special value: ``0`` means that the user
authentication did not respect `ISO29115`_ level 1, and will be refused monetary
operations. Developers MAY re-implement this method::

    def get_acr(self, user):
        if user.insecure_session():
            return "0"
        return "urn:mace:incommon:iap:silver"

.. _ISO29115: https://www.iso.org/standard/45138.html
Nr   ©r   r!   s   &&r   Úget_acrÚJWTBearerTokenGenerator.get_acrO   s   € ñ  r   c                ó0   <€ V ^8„  d   QhRS[ S[,          /# r&   )r   Úint)r+   r,   s   "€r   r-   r.   a   s   ø€ ÷ 	ñ 	¡X©c¥]ñ 	r   c                ó   € R# )aM  User authentication time.
Time when the End-User authentication occurred. Its value is a JSON number
representing the number of seconds from 1970-01-01T0:0:0Z as measured in UTC
until the date/time. Developers MAY re-implement this method::

    def get_auth_time(self, user):
        return datetime.timestamp(user.get_auth_time())
Nr   r5   s   &&r   Úget_auth_timeÚ%JWTBearerTokenGenerator.get_auth_timea   ó   € ñ r   c                ó@   <€ V ^8„  d   QhRS[ S[S[,          ,          /# r&   )r   r*   r)   )r+   r,   s   "€r   r-   r.   l   s   ø€ ÷ 	ñ 	™x©©S­	Õ2ñ 	r   c                ó   € R# )aK  Authentication Methods References.
Defined by :ref:`specs/oidc` as an option list of user-defined case-sensitive
strings indication which authentication methods have been used to authenticate
the user. Developers MAY re-implement this method::

    def get_amr(self, user):
        return ["2FA"] if user.has_2fa_enabled() else []
Nr   r5   s   &&r   Úget_amrÚJWTBearerTokenGenerator.get_amrl   r=   r   c                ó    <€ V ^8„  d   QhRS[ /# r&   )r)   )r+   r,   s   "€r   r-   r.   w   s   ø€ ÷ "ñ "¹#ñ "r   c                ó   € \        ^4      # )z¿JWT ID.
Create an unique identifier for the token. Developers MAY re-implement
this method::

    def get_jti(self, client, grant_type, user scope):
        return generate_random_string(16)
r   r   s   &&&&&r   Úget_jtiÚJWTBearerTokenGenerator.get_jtiw   s   € ô ˜bÓ!Ð!r   c                óâ  € \        \        P                  ! 4       4      pWPP                  W4      ,           pR V P                  RVRVP	                  4       RVRV P                  WW44      RV/pV'       d   VP                  4       VR&   MVP	                  4       VR&    T P                  YT4      TR&   T P                  T4      ;p'       d   Y‡R	&   T P                  T4      ;p	'       d   Y—R
&   T P                  T4      ;p
'       d   Y§R&   TP                  T P                  YY44      4       RT P                  RR/p\        P                  ! TTT P!                  4       RR7      pTP#                  4       # )ÚissÚexpÚ	client_idÚiatÚjtir"   ÚsubFÚaudÚ	auth_timeÚacrÚamrr   Útypzat+jwt)ÚkeyÚcheck)r9   ÚtimeÚ_get_expires_inr   r0   rD   Úget_user_idr1   r;   r6   r@   Úupdater#   r   r   Úencoder   Údecode)r   r   r    r!   r"   ÚnowÚ
expires_inÚ
token_datarN   rO   rP   ÚheaderÚaccess_tokens   &&&&&        r   r   Ú.JWTBearerTokenGenerator.access_token_generator   sm  € Ü”$—)’)“+ÓˆØ×/Ñ/°ÓCÕCˆ
ð 4—;‘;Ø:Ø˜×-Ñ-Ó/Ø3Ø4—<‘< °DÓ@ØUð
ˆ
÷ Ø $× 0Ñ 0Ó 2ˆJuÒð !'× 4Ñ 4Ó 6ˆJuÑð ð !%× 2Ñ 2°6ÀÓ GˆJuÑð ×*Ñ*¨4Ó0Ð0ˆ9Ö0Ø&/{Ñ#ð
 —,‘,˜tÓ$Ð$ˆ3Ö$Ø #uÑð
 —,‘,˜tÓ$Ð$ˆ3Ö$Ø #uÑð 	×Ñ˜$×/Ñ/°ÀDÓPÔQð ˜Ÿ™ 5¨(Ð3ˆä—z’zØØØ—‘“Øô	
ˆð ×"Ñ"Ó$Ð$r   )r   r   )ÚRS256NN)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r#   r1   r6   r;   r@   rD   r   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r   r,   s   @@r   r
   r
   
   sW   ù‡ € ñ÷.ò$ò÷&ð &÷ð ÷$	ð 	÷	ð 	÷"ð "÷Y%ò Y%r   r
   )rT   Útypingr   r   Úauthlib.common.securityr   Úauthlib.joser   Úauthlib.oauth2.rfc6750.tokenr   r
   r   r   r   Ú<module>rm      s&   ðÛ Ý Ý å 2Ý Ý =ôP%Ð2ö P%r   