Skip to content

Commit 0da4223

Browse files
Fix incorrect documentation for jwt (jpadilla#651)
* Fix incorrect default values * Added verify_nbf * Fix incorrect `require` option * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 545931d commit 0da4223

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

docs/api.rst

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,18 @@ API Reference
4343

4444
:param dict options: extended decoding and validation options
4545

46-
* ``require_exp=False`` check that ``exp`` (expiration) claim is present
47-
* ``require_iat=False`` check that ``iat`` (issued at) claim is present
48-
* ``require_nbf=False`` check that ``nbf`` (not before) claim is present
49-
* ``verify_aud=False`` check that ``aud`` (audience) claim matches ``audience``
50-
* ``verify_iat=False`` check that ``iat`` (issued at) claim value is an integer
51-
* ``verify_exp=False`` check that ``exp`` (expiration) claim value is OK
52-
* ``verify_iss=False`` check that ``iss`` (issuer) claim matches ``issuer``
46+
* ``require=[]`` list of claims that must be present. E.g. ``require=["exp", "iat", "nbf"]``.
47+
Only verifies that the claims exists. Does NOT verify that the claims are valid.
48+
* ``verify_aud=True`` but will be ignored if ``verify_signature`` is ``False``.
49+
Check that ``aud`` (audience) claim matches ``audience``
50+
* ``verify_iat=True`` but will be ignored if ``verify_signature`` is ``False``.
51+
Check that ``iat`` (issued at) claim value is an integer
52+
* ``verify_exp=True`` but will be ignored if ``verify_signature`` is ``False``.
53+
Check that ``exp`` (expiration) claim value is OK
54+
* ``verify_iss=True`` but will be ignored if ``verify_signature`` is ``False``.
55+
Check that ``iss`` (issuer) claim matches ``issuer``
56+
* ``verify_nbf=True`` but will be ignored if ``verify_signature`` is ``False``.
57+
Check that ``nbf`` (not before) is in the past
5358
* ``verify_signature=True`` verify the JWT cryptographic signature
5459

5560
:param Iterable audience: optional, the value for ``verify_aud`` check

0 commit comments

Comments
 (0)