summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWouter Bolsterlee <wouter@intelworks.com>2015-01-05 17:10:44 +0100
committerWouter Bolsterlee <wouter@intelworks.com>2015-01-05 17:10:44 +0100
commit880e133f9427c2592a255c49f3408d7521c94fff (patch)
treec5c55272a22217f1af3dfea432e0aff6257ffcb0
parent7bff6c969a91959692fd5466c2f928593b5bb97d (diff)
downloadpyjwt-880e133f9427c2592a255c49f3408d7521c94fff.tar.gz
Mention timedelta as leeway in the README
-rw-r--r--README.md7
1 files changed, 7 insertions, 0 deletions
diff --git a/README.md b/README.md
index f64b645..3a2882c 100644
--- a/README.md
+++ b/README.md
@@ -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.