init and sign

This commit is contained in:
Daan Hoogland 2020-12-14 15:49:17 +01:00 committed by Daan Hoogland
parent 6819c237c0
commit f0e99fff8a
2 changed files with 5 additions and 3 deletions

View File

@ -147,8 +147,10 @@ class CSConnection(object):
).replace("+", "%20")]
) for r in params]
)
signature = base64.encodestring(hmac.new(
self.securityKey, hash_str, hashlib.sha1).digest()).strip()
signature = base64.encodestring(
hmac.new(self.securityKey.encode('utf-8'),
hash_str.encode('utf-8'),
hashlib.sha1).digest()).strip()
return signature
def __sendPostReqToCS(self, url, payload):

View File

@ -40,7 +40,7 @@ class MarvinLog:
def __new__(cls, logger_name):
if not cls._instance:
cls._instance = super(MarvinLog, cls).__new__(cls, logger_name)
cls._instance = super(MarvinLog, cls).__new__(cls)
return cls._instance
def __init__(self, logger_name):