3 ,[9 @sRdZddlmZmZddlZddlmZddlmZej e Z Gdd d eZ dS) z oauthlib.oauth1.rfc5849.endpoints.signature_only ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module is an implementation of the signing logic of OAuth 1.0 RFC 5849. )absolute_importunicode_literalsN)errors) BaseEndpointc@seZdZdZdddZdS)SignatureOnlyEndpointz>An endpoint only responsible for verifying an oauth signature.GETNc !Cs6y|j||||}Wn0tjk rD}ztjd|d Sd}~XnXy|j||j|Wn4tjk r}ztjd|d|fSd}~XnX|jj|j |j |j |stj dd|fS|jj |j |}|s|jj|_ |j|}||jd<||jd<t||f} | s.tjdtjd|tjd || |fS) aValidate 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.FNz.[Failure] verification failed: timestamp/nonceZclientZ signaturez&[Failure] request verification failed.zValid client: %szValid signature: %s)FN)Z_create_requestrZ OAuth1ErrorloginfoZ_check_transport_securityZ_check_mandatory_parametersZrequest_validatorZvalidate_timestamp_and_nonceZ client_keyZ timestampZnoncedebugZvalidate_client_keyZ dummy_clientZ_check_signatureZ validator_logall) selfZuriZ http_methodZbodyZheadersZrequesterrZ valid_clientZvalid_signaturevr$/usr/lib/python3.6/signature_only.pyvalidate_requests<               z&SignatureOnlyEndpoint.validate_request)r NN)__name__ __module__ __qualname____doc__rrrrrrsr) rZ __future__rrZloggingrbaserZ getLoggerrr rrrrrs