Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.

Commit

Permalink
Merge branch 'hs2019-support'
Browse files Browse the repository at this point in the history
  • Loading branch information
fulder committed Aug 27, 2020
2 parents a704ea8 + 251cce9 commit 7d015c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 2 additions & 0 deletions httpsig/sign.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ def __init__(self, secret, algorithm=None, sign_algorithm=None):

if algorithm != DEFAULT_ALGORITHM:
print("Algorithm: {} is deprecated please update to {}".format(algorithm, DEFAULT_ALGORITHM))
elif algorithm == DEFAULT_ALGORITHM and sign_algorithm is None:
raise HttpSigException("Required sign algorithm for {} algorithm not set".format(DEFAULT_ALGORITHM))

if isinstance(secret, six.string_types):
secret = secret.encode("ascii")
Expand Down
7 changes: 1 addition & 6 deletions httpsig/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,8 @@ def __init__(self, headers, secret, required_headers=None, method=None,
self.host = host
self.derived_algorithm = algorithm

if self.auth_dict['algorithm'] != DEFAULT_ALGORITHM:
print("Algorithm: {} is deprecated please update to {}".format(self.auth_dict['algorithm'], DEFAULT_ALGORITHM))
elif self.auth_dict['algorithm'] == DEFAULT_ALGORITHM and sign_algorithm is None:
raise HttpSigException("Required sign algorithm for {} algorithm not set".format(DEFAULT_ALGORITHM))

super(HeaderVerifier, self).__init__(
secret, algorithm=self.auth_dict['algorithm'], sign_algorithm=sign_algorithm)
secret, algorithm=self.auth_dict['algorithm'], sign_algorithm=sign_algorithm)

def verify(self):
"""
Expand Down

0 comments on commit 7d015c6

Please sign in to comment.