diff options
| author | José Padilla <jpadilla@webapplicate.com> | 2015-04-26 15:02:11 -0400 |
|---|---|---|
| committer | José Padilla <jpadilla@webapplicate.com> | 2015-04-26 15:02:11 -0400 |
| commit | 590f903ac78faaed348d4d5c5179964b345e41cb (patch) | |
| tree | f9826b677e9dcd6042ba021ebfe64e079dc706a2 /jwt/api_jwt.py | |
| parent | 06deb9f3f385020170600370d6e456e11b63f704 (diff) | |
| download | pyjwt-590f903ac78faaed348d4d5c5179964b345e41cb.tar.gz | |
`verify_expiration` was removed too soonbring-verify_expiration-back
- Merge with `verify_exp` option
- Add deprecation warning
Diffstat (limited to 'jwt/api_jwt.py')
| -rw-r--r-- | jwt/api_jwt.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/jwt/api_jwt.py b/jwt/api_jwt.py index 4a8a3ae..c1bc058 100644 --- a/jwt/api_jwt.py +++ b/jwt/api_jwt.py @@ -1,4 +1,5 @@ import json +import warnings from calendar import timegm from collections import Mapping @@ -74,6 +75,12 @@ class PyJWT(PyJWS): def _validate_claims(self, payload, audience=None, issuer=None, leeway=0, options=None, **kwargs): + + if 'verify_expiration' in kwargs: + options['verify_exp'] = kwargs.get('verify_expiration', True) + warnings.warn('The verify_expiration parameter is deprecated. ' + 'Please use options instead.', DeprecationWarning) + if isinstance(leeway, timedelta): leeway = timedelta_total_seconds(leeway) |
