diff options
Diffstat (limited to 'jwt')
| -rw-r--r-- | jwt/api_jws.py | 6 | ||||
| -rw-r--r-- | jwt/api_jwt.py | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/jwt/api_jws.py b/jwt/api_jws.py index 8910751..097b46a 100644 --- a/jwt/api_jws.py +++ b/jwt/api_jws.py @@ -117,6 +117,12 @@ class PyJWS(object): def decode(self, jws, key='', verify=True, algorithms=None, options=None, **kwargs): + + if not algorithms: + warnings.warn('The algorithms parameter is required when decoding. ' + + 'Please specify only the expected algorithms.', + DeprecationWarning) + payload, signing_input, header, signature = self._load(jws) if verify: diff --git a/jwt/api_jwt.py b/jwt/api_jwt.py index eef2b0f..f41f6a7 100644 --- a/jwt/api_jwt.py +++ b/jwt/api_jwt.py @@ -58,6 +58,12 @@ class PyJWT(PyJWS): def decode(self, jwt, key='', verify=True, algorithms=None, options=None, **kwargs): + + if not algorithms: + warnings.warn('The algorithms parameter is required when decoding. ' + + 'Please specify only the expected algorithms.', + DeprecationWarning) + payload, signing_input, header, signature = self._load(jwt) decoded = super(PyJWT, self).decode(jwt, key, verify, algorithms, |
