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

Commit

Permalink
Throw exception on algorithm signature parameter and dervice algorith…
Browse files Browse the repository at this point in the history
…m mismatch
  • Loading branch information
fulder committed Aug 26, 2020
1 parent f97f6c0 commit c5163f8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions httpsig/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ def __init__(self, headers, secret, required_headers=None, method=None,
self.path = path
self.host = host

if 'algorithm' in self.auth_dict and self.auth_dict['algorithm'] != self.algorithm:
raise HttpSigException(
"Algorithm mismath, signature parameter algorithm was: {}, but algorithm dervice from key is: {}".format(
self.auth_dict['algorithm'], self.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:
Expand Down

0 comments on commit c5163f8

Please sign in to comment.