§
    (ê[f	  ã                   ól   — d dl Z ddlmZmZmZ ddlmZmZmZ ddlm	Z	m
Z
mZmZmZ  G d„ d¦  «        ZdS )é    Né   )ÚSIGNATURE_HMAC_SHA1ÚSIGNATURE_PLAINTEXTÚSIGNATURE_RSA_SHA1)Úverify_hmac_sha1Úverify_plaintextÚverify_rsa_sha1)ÚInvalidRequestErrorÚMissingRequiredParameterErrorÚUnsupportedSignatureMethodErrorÚInvalidNonceErrorÚInvalidSignatureErrorc                   óV   — e Zd ZeeeeeeiZ	egZ
dZed„ ¦   «         Zd„ Zd„ Zd„ Zd„ ZdS )Ú
BaseServeri,  c                 ó   — || j         |<   dS )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      úV/var/www/piapp/venv/lib/python3.11/site-packages/authlib/oauth1/rfc5849/base_server.pyÚregister_signature_methodz$BaseServer.register_signature_method   s   € ð '-ˆÔ˜dÑ#Ð#Ð#ó    c                 ó$  — |j                              d¦  «        }|j                              d¦  «        }|j        t          k    r|s|sdS |st	          d¦  «        ‚	 t          |¦  «        }|dk     rt          d¦  «        ‚| j        r.t          j        ¦   «         |z
  | j        k    rt          d¦  «        ‚n$# t          t          f$ r t          d¦  «        ‚w xY w|st	          d¦  «        ‚|                      ||¦  «        rt          ¦   «         ‚dS )zzValidate ``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Únonces       r   Úvalidate_timestamp_and_noncez'BaseServer.validate_timestamp_and_nonce/   sD  € ð
 Ô(×,Ò,Ð->Ñ?Ô?ˆ	ØÔ$×(Ò(¨Ñ7Ô7ˆàÔ#Õ':Ò:Ð:ð ð  Uð Ø�àð 	CÝ/Ð0AÑBÔBÐBð		Iå˜I™œˆIØ˜1Š}ˆ}Ý)Ð*KÑLÔLÐLàÔð M¥D¤I¡K¤K°)Ñ$;¸dÔ>NÒ$NÐ$NÝ)Ð*KÑLÔLÐLøøÝ�IÐ&ð 	Ið 	Ið 	IÝ%Ð&GÑHÔHÐHð	Iøøøð ð 	?Ý/°Ñ>Ô>Ð>à×Ò˜U GÑ,Ô,ð 	&Ý#Ñ%Ô%Ð%ð	&ð 	&s   ÁAB7 Â7!Cc                 ó  — |j         }|st          d¦  «        ‚|| j        vrt          ¦   «         ‚|j        st          d¦  «        ‚| j                             |¦  «        }|st          ¦   «         ‚ ||¦  «        st          ¦   «         ‚dS )zhValidate ``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_signaturez#BaseServer.validate_oauth_signatureQ   s©   € ð
 Ô)ˆØð 	JÝ/Ð0HÑIÔIÐIà˜Ô9Ð9Ð9Ý1Ñ3Ô3Ð3àÔ ð 	CÝ/Ð0AÑBÔBÐBàÔ'×+Ò+¨FÑ3Ô3ˆØð 	4Ý1Ñ3Ô3Ð3àˆv�g‰Œð 	*Ý'Ñ)Ô)Ð)ð	*ð 	*r   c                 ó   — t          ¦   «         ‚)zŒGet 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_idzBaseServer.get_client_by_idg   s   € õ "Ñ#Ô#Ð#r   c                 ó   — t          ¦   «         ‚)a	  The 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
        r2   )r%   r(   r&   s      r   r$   zBaseServer.exists_nonceo   s   € õ "Ñ#Ô#Ð#r   N)Ú__name__Ú
__module__Ú__qualname__r   r   r   r	   r   r   r   r-   r    Úclassmethodr   r)   r0   r5   r$   © r   r   r   r      s“   € € € € € àÐ-Ø˜OØÐ-ðÐð
 $7Ð"7ÐØ€Kàð-ð -ñ „[ð-ð  &ð  &ð  &ðD*ð *ð *ð,$ð $ð $ð$ð $ð $ð $ð $r   r   )r!   r.   r   r   r   r   r   r	   Úerrorsr
   r   r   r   r   r   r;   r   r   ú<module>r=      sô   ðØ €€€ðð ð ð ð ð ð ð ð ð ð
ð ð ð ð ð ð ð ð ð ð
ð ð ð ð ð ð ð ð ð ð ð ð ð ðb$ð b$ð b$ð b$ð b$ñ b$ô b$ð b$ð b$ð b$r   