
    k7i                     2    S SK Jr   SS jrSS jr SS jrg)    )TemporaryCredentialc                    ^^ UU4S jnUU4S jnUU4S jnUU4S jnU R                  SU5        U R                  SU5        U R                  SU5        U R                  SU5        g	)
zRegister temporary credential related hooks to authorization server.

:param authorization_server: AuthorizationServer instance
:param cache: Cache instance
:param key_prefix: key prefix for temporary credential
c                 h   > TU S   -   nXS'   U(       a  X S'   TR                  X0SS9  [        U 5      $ )Noauth_token	client_idoauth_callbackQ timeout)setr   )tokenr   redirect_urikeycache
key_prefixs       a/home/james-whalen/.local/lib/python3.13/site-packages/authlib/integrations/flask_oauth1/cache.pycreate_temporary_credentialHregister_temporary_credential_hooks.<locals>.create_temporary_credential   sA    5//&k&2"#		#e	,"5))    c                 f   > U (       d  g TU -   nTR                  U5      nU(       a  [        U5      $ g N)getr   )r   r   valuer   r   s      r   get_temporary_credentialEregister_temporary_credential_hooks.<locals>.get_temporary_credential   s3    ;&		#&u-- r   c                 B   > U (       a  TU -   nTR                  U5        g g r   )delete)r   r   r   r   s     r   delete_temporary_credentialHregister_temporary_credential_hooks.<locals>.delete_temporary_credential   s!    {*CLL r   c                 |   > TU R                  5       -   nX S'   UR                  5       U S'   TR                  X0SS9  U $ )Noauth_verifieruser_idr	   r
   )get_oauth_tokenget_user_idr   )
credential
grant_userverifierr   r   r   s       r   create_authorization_verifierJregister_temporary_credential_hooks.<locals>.create_authorization_verifier$   sH    :5577'/#$ * 6 6 8
9		#5	1r   r   r   r   r(   N)register_hook)authorization_serverr   r   r   r   r   r(   s    ``    r   #register_temporary_credential_hooksr,      so    *.
 &&%'B &&"$< &&%'B &&')Fr   c                    ^ ^^ U UU4S jnU$ )zCreate an ``exists_nonce`` function that can be used in hooks and
resource protector.

:param cache: Cache instance
:param key_prefix: key prefix for temporary credential
:param expires: Expire time for nonce
c                    > T U  SU SU 3nU(       a  U SU 3nTR                  U5      nTR                  USTS9  U$ )N-   r
   )hasr   )	nonce	timestampr   r   r   rvr   expiresr   s	         r   exists_nonce.create_exists_nonce_func.<locals>.exists_nonceB   sT    UG1YKq<E;-(CYYs^		#q'	*	r    )r   r   r5   r6   s   ``` r   create_exists_nonce_funcr9   9   s     r   c                 @    [        XU5      nU R                  SU5        g)zRegister nonce related hooks to authorization server.

:param authorization_server: AuthorizationServer instance
:param cache: Cache instance
:param key_prefix: key prefix for temporary credential
:param expires: Expire time for nonce
r6   N)r9   r*   )r+   r   r   r5   r6   s        r   register_nonce_hooksr;   M   s      ,EwGL&&~|Dr   N)ztemporary_credential:)znonce:r	   )authlib.oauth1r   r,   r9   r;   r8   r   r   <module>r=      s%    . -D2j* ?DEr   