
    k7i                         S SK r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SS	KJ	r	  SS
KJ
r
  SSKJr  SSKJr  SSKJr   " S S5      rg)    N   )InvalidNonceError)InvalidRequestError)InvalidSignatureError)MissingRequiredParameterError)UnsupportedSignatureMethodError)SIGNATURE_HMAC_SHA1)SIGNATURE_PLAINTEXT)SIGNATURE_RSA_SHA1)verify_hmac_sha1)verify_plaintext)verify_rsa_sha1c                   V    \ rS rSr\\\\\\	0r
\/rSr\S 5       rS rS rS rS rSrg	)

BaseServer   i,  c                      X R                   U'   g)a  Extend signature method verification.

:param name: A string to represent signature method.
:param verify: A function to verify signature.

The ``verify`` method accept ``OAuth1Request`` as parameter::

    def verify_custom_method(request):
        # verify this request, return True or False
        return True


    Server.register_signature_method("custom-name", verify_custom_method)
N)SIGNATURE_METHODS)clsnameverifys      \/home/james-whalen/.local/lib/python3.13/site-packages/authlib/oauth1/rfc5849/base_server.pyregister_signature_method$BaseServer.register_signature_method   s      '-d#    c                 D   UR                   R                  S5      nUR                   R                  S5      nUR                  [        :X  a  U(       d  U(       d  gU(       d  [	        S5      e [        U5      nUS:  a  [        S5      eU R                  (       a1  [        R                  " 5       U-
  U R                  :  a  [        S5      eU(       d  [	        S5      eU R                  X15      (       a
  [        5       eg! [        [        4 a  n[        S5      UeSnAff = f)zjValidate ``oauth_timestamp`` and ``oauth_nonce`` in HTTP request.

:param request: OAuth1Request instance
oauth_timestampoauth_nonceNr   zInvalid "oauth_timestamp" value)oauth_paramsgetsignature_methodr
   r   intr   EXPIRY_TIMEtime
ValueError	TypeErrorexists_noncer   )selfrequest	timestampnonceexcs        r   validate_timestamp_and_nonce'BaseServer.validate_timestamp_and_nonce+   s    
 ((,,->?	$$((7##':: U/0ABB		RII1})*KLLDIIK)$;d>N>N$N)*KLL />>U,,#%% - I& 	R%&GHcQ	Rs   -AC> >DDDc                 0   UR                   nU(       d  [        S5      eX R                  ;  a
  [        5       eUR                  (       d  [        S5      eU R
                  R                  U5      nU(       d
  [        5       eU" U5      (       d
  [        5       eg)zXValidate ``oauth_signature`` from HTTP request.

:param request: OAuth1Request instance
oauth_signature_methodoauth_signatureN)r    r   SUPPORTED_SIGNATURE_METHODSr   	signaturer   r   r   )r'   r(   methodr   s       r   validate_oauth_signature#BaseServer.validate_oauth_signatureM   s    
 ))/0HII999133  /0ABB''++F3133g')) r   c                     [        5       e)ztGet client instance with the given ``client_id``.

:param client_id: A string of client_id
:return: Client instance
NotImplementedError)r'   	client_ids     r   get_client_by_idBaseServer.get_client_by_idc   s     "##r   c                     [        5       e)zThe nonce value MUST be unique across all requests with the same
timestamp, client credentials, and token combinations.

:param nonce: A string value of ``oauth_nonce``
:param request: OAuth1Request instance
:return: Boolean
r7   )r'   r*   r(   s      r   r&   BaseServer.exists_noncek   s     "##r    N)__name__
__module____qualname____firstlineno__r	   r   r   r   r
   r   r   r1   r"   classmethodr   r,   r4   r:   r&   __static_attributes__r>   r   r   r   r      sR    -O-
 $7"7K- -" &D*,$$r   r   )r#   errorsr   r   r   r   r   r2   r	   r
   r   r   r   r   r   r>   r   r   <module>rF      s5     % ' ) 1 3 * * ) ' ' &c$ c$r   