Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit e3b7a34

Browse files
committed
delete unused code
1 parent 19c1bdf commit e3b7a34

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

aftership/hmac/hmac.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def __init__(self, api_secret):
1212

1313
def hmac_signature(self, sign_string: str) -> str:
1414
if self.api_secret is None:
15-
self.api_secret = os.getenv('AFTERSHIP_API_SECRET')
15+
self.api_secret = os.getenv('AS_API_SECRET')
1616
signature_str = hmac.new(bytes(self.api_secret.encode()), msg=bytes(
1717
sign_string.encode()), digestmod=hashlib.sha256).digest()
1818
return base64.b64encode(signature_str).decode()

aftership/request.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ def request_with_aes_hmac256_signature(method, url, path, content_type, **kwargs
6060
headers = kwargs.pop('headers', dict())
6161
if headers.get(AS_API_KEY, None) is None:
6262
headers[AS_API_KEY] = get_as_api_key()
63+
if headers.get(AS_API_KEY, None) is None:
64+
return
6365

6466
body = kwargs.get('json', None)
6567
date, sign_string = gen_sign_string(method, path, body, headers, content_type)

aftership/signstring/signstring.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def _get_canonicalized_resource(self, raw_url: str) -> str:
5656

5757
def gen_sign_string(self, method: str, uri: str, body: str, as_header: dict, content_type: str) -> tuple:
5858
# if self.api_secret is None:
59-
# self.api_secret = os.getenv('AFTERSHIP_API_SECRET')
59+
# self.api_secret = os.getenv('AS_API_SECRET')
6060

6161
canonicalized_as_headers = self._get_canonicalized_as_headers(as_header)
6262
canonicalized_resource = self._get_canonicalized_resource(uri)

0 commit comments

Comments
 (0)