mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Merge pull request #815 from ayanamist/develop
Use logger instead of direct logging call.
This commit is contained in:
@@ -17,6 +17,8 @@ from oauthlib.common import Request, urlencode, generate_nonce
|
||||
from oauthlib.common import generate_timestamp
|
||||
from . import parameters, signature, utils
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
SIGNATURE_HMAC = u"HMAC-SHA1"
|
||||
SIGNATURE_RSA = u"RSA-SHA1"
|
||||
SIGNATURE_PLAINTEXT = u"PLAINTEXT"
|
||||
@@ -66,17 +68,17 @@ class Client(object):
|
||||
uri_query=urlparse.urlparse(uri).query,
|
||||
body=body,
|
||||
headers=headers)
|
||||
logging.debug("Collected params: {0}".format(collected_params))
|
||||
logger.debug("Collected params: {0}".format(collected_params))
|
||||
|
||||
normalized_params = signature.normalize_parameters(collected_params)
|
||||
normalized_uri = signature.normalize_base_string_uri(request.uri)
|
||||
logging.debug("Normalized params: {0}".format(normalized_params))
|
||||
logging.debug("Normalized URI: {0}".format(normalized_uri))
|
||||
logger.debug("Normalized params: {0}".format(normalized_params))
|
||||
logger.debug("Normalized URI: {0}".format(normalized_uri))
|
||||
|
||||
base_string = signature.construct_base_string(request.http_method,
|
||||
normalized_uri, normalized_params)
|
||||
|
||||
logging.debug("Base signing string: {0}".format(base_string))
|
||||
logger.debug("Base signing string: {0}".format(base_string))
|
||||
|
||||
if self.signature_method == SIGNATURE_HMAC:
|
||||
sig = signature.sign_hmac_sha1(base_string, self.client_secret,
|
||||
@@ -87,7 +89,7 @@ class Client(object):
|
||||
sig = signature.sign_plaintext(self.client_secret,
|
||||
self.resource_owner_secret)
|
||||
|
||||
logging.debug("Signature: {0}".format(sig))
|
||||
logger.debug("Signature: {0}".format(sig))
|
||||
return sig
|
||||
|
||||
def get_oauth_params(self):
|
||||
|
||||
Reference in New Issue
Block a user