File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 22import hmac
33import hashlib
44
5- from datetime import datetime , UTC , timedelta
5+ from datetime import datetime , timezone , timedelta
66
77from hubspot .exceptions import InvalidSignatureVersionError , InvalidSignatureTimestampError
88
@@ -16,8 +16,8 @@ def _is_timestamp_valid(timestamp: str) -> bool:
1616 return False
1717 try :
1818 timestamp_float = float (timestamp )
19- request_time = datetime .fromtimestamp (timestamp_float // 1000 , tz = UTC )
20- current_time = datetime .now (UTC )
19+ request_time = datetime .fromtimestamp (timestamp_float // 1000 , tz = timezone . utc )
20+ current_time = datetime .now (timezone . utc )
2121 return current_time - request_time < timedelta (seconds = Signature .MAX_ALLOWED_TIMESTAMP )
2222 except (ValueError , OverflowError ):
2323 return False
You can’t perform that action at this time.
0 commit comments