diff options
author | Wouter Bolsterlee <wouter@intelworks.com> | 2015-01-05 17:10:44 +0100 |
---|---|---|
committer | Wouter Bolsterlee <wouter@intelworks.com> | 2015-01-05 17:10:44 +0100 |
commit | 880e133f9427c2592a255c49f3408d7521c94fff (patch) | |
tree | c5c55272a22217f1af3dfea432e0aff6257ffcb0 | |
parent | 7bff6c969a91959692fd5466c2f928593b5bb97d (diff) | |
download | pyjwt-880e133f9427c2592a255c49f3408d7521c94fff.tar.gz |
Mention timedelta as leeway in the README
-rw-r--r-- | README.md | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -151,6 +151,13 @@ time.sleep(32) jwt.decode(jwt_payload, 'secret', leeway=10) ``` +Instead of specifying the leeway as a number of seconds, a `datetime.timedelta` instance can be used. The last line in the example above is equivalent to: + +```python +jwt.decode(jwt_payload, 'secret', leeway=datetime.timedelta(seconds=10)) +``` + + ### Not Before Time Claim > The nbf (not before) claim identifies the time before which the JWT MUST NOT be accepted for processing. The processing of the nbf claim requires that the current date/time MUST be after or equal to the not-before date/time listed in the nbf claim. Implementers MAY provide for some small leeway, usually no more than a few minutes, to account for clock skew. Its value MUST be a number containing a NumericDate value. Use of this claim is OPTIONAL. |