
    &g                     f    d Z ddlZddlmZ ddlmZ  ej        e          Z G d de          Z	dS )	z
oauthlib.oauth1.rfc5849.endpoints.signature_only
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This module is an implementation of the signing logic of OAuth 1.0 RFC 5849.
    N   )errors   )BaseEndpointc                       e Zd ZdZ	 	 ddZdS )SignatureOnlyEndpointz>An endpoint only responsible for verifying an oauth signature.GETNc                    	 |                      ||||          }n:# t          j        $ r(}t                              d|z             Y d}~dS d}~ww xY w	 |                     |           |                     |           n=# t          j        $ r+}t                              d|z             d|fcY d}~S d}~ww xY w| j                            |j	        |j
        |j        |          st                              d           d|fS | j                            |j	        |          }|s| j        j        |_	        |                     |          }||j        d<   ||j        d<   t#          ||f          }	|	sPt                              d           t                              d	|           t                              d
|           |	|fS )a  Validate a signed OAuth request.

        :param uri: The full URI of the token request.
        :param http_method: A valid HTTP verb, i.e. GET, POST, PUT, HEAD, etc.
        :param body: The request body as a string.
        :param headers: The request headers as a dict.
        :returns: A tuple of 2 elements.
                  1. True if valid, False otherwise.
                  2. An oauthlib.common.Request object.
        z.Exception caught while validating request, %s.N)FNFz.[Failure] verification failed: timestamp/nonceclient	signaturez&[Failure] request verification failed.zValid client: %szValid signature: %s)_create_requestr   OAuth1Errorloginfo_check_transport_security_check_mandatory_parametersrequest_validatorvalidate_timestamp_and_nonce
client_key	timestampnoncedebugvalidate_client_keydummy_client_check_signaturevalidator_logall)
selfurihttp_methodbodyheadersrequesterrvalid_clientvalid_signaturevs
             b/var/www/api/venv/lib/python3.11/site-packages/oauthlib/oauth1/rfc5849/endpoints/signature_only.pyvalidate_requestz&SignatureOnlyEndpoint.validate_request   s   	**3T7KKGG! 	 	 	HH@3FH H H;;;;;	
	"**7333,,W5555! 	" 	" 	"HH@3FH H H'>!!!!!!	"
 %BB"G$5w}gO O 	"IIFGGG'>! -AA) ) 	E!%!7!DG//88 +7h'-<k* /00 	=HH=>>>HH'666HH*O<<<'zs2    AAA*B B; B60B;6B;)r	   NN)__name__
__module____qualname____doc__r)        r(   r   r      s4        HH05,0= = = = = =r/   r   )
r-   logging r   baser   	getLoggerr*   r   r   r.   r/   r(   <module>r4      s                 g!!A A A A AL A A A A Ar/   