Skip to content

Commit 4b78f26

Browse files
committed
Update request.py to solely support SHA384 and update CHANGELOG.md
1 parent 971f5ed commit 4b78f26

2 files changed

Lines changed: 3 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
### 0.3.0 / 2023-27-03 ###
2-
- Change the way the `transloadit` client is initialized. Now it is possible to pass the `sha_384` boolean parameter to the `Transloadit` class to enable the `sha_384` hash algorithm for the signature. The default value is `True` and the `sha_384` algorithm is used. The `sha_384` algorithm is recommended for new integrations and it is required for the new Transloadit accounts. The `sha_1` algorithm is deprecated and it will be removed in the future. For compatibility reasons it is possible to use `sha_1` with the `sha_384` parameter set to `False`.
1+
### 0.2.2 / 2023-27-03 ###
32
- Added `sha_384` as hash algorithm for the signature authentication.
4-
5-
### Unreleased
63
- Drop Python 3.6 from CI. It has been unsupported since December 2021 and github actions runner don't support anymore (https://github.com/actions/setup-python/issues/544)
74

85
### 0.2.1/ 2022-29-08 ###

transloadit/request.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,8 @@ def _to_payload(self, data):
123123
return {"params": json_data, "signature": self._sign_data(json_data)}
124124

125125
def _sign_data(self, message):
126-
if not self.transloadit.sha_384:
127-
return hmac.new(b(self.transloadit.auth_secret), message.encode("utf-8"), hashlib.sha1).hexdigest()
128-
129-
else:
130-
hash_string = hmac.new(b(self.transloadit.auth_secret), message.encode("utf-8"), hashlib.sha384).hexdigest()
131-
return f"sha384:{hash_string}"
126+
hash_string = hmac.new(b(self.transloadit.auth_secret), message.encode("utf-8"), hashlib.sha384).hexdigest()
127+
return f"sha384:{hash_string}"
132128

133129
def _get_full_url(self, url):
134130
if url.startswith(("http://", "https://")):

0 commit comments

Comments
 (0)