diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2020-12-21 08:13:07 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-21 11:13:07 -0500 |
commit | d5eff6452d66d0cafce9fecd19f5453ce8ea95fc (patch) | |
tree | 91c149a4d9e6dea428f6e49c7848effa05b02a6d | |
parent | 92aeab415ae2b73d2776ad2b1c4e8fa3a5e0d51e (diff) | |
download | pyjwt-d5eff6452d66d0cafce9fecd19f5453ce8ea95fc.tar.gz |
Fix tox "docs" environment to pass (#567)
- Fixed doctest which included incorrect output.
- Use intersphinx to allow linking to Python JSONEncoder class.
- Fix param types after previous str/bytes cleanups.
- Fix param syntax to avoid vertical bar.
The command `tox -e docs` now passes.
-rw-r--r-- | README.rst | 2 | ||||
-rw-r--r-- | docs/api.rst | 6 | ||||
-rw-r--r-- | docs/conf.py | 4 | ||||
-rw-r--r-- | docs/index.rst | 2 |
4 files changed, 9 insertions, 5 deletions
@@ -42,7 +42,7 @@ Usage >>> import jwt >>> encoded = jwt.encode({"some": "payload"}, "secret", algorithm="HS256") >>> print(encoded) - eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzb21lIjoicGF5bG9hZCJ9.4twFt5NiznN84AWoo1d7KO1T_yoc0Z6XOpOVswacPZg + eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzb21lIjoicGF5bG9hZCJ9.Joh1R2dYzkRvDkqv3sygm5YyK8Gi4ShZqbhK2gxcs2U >>> jwt.decode(encoded, "secret", algorithms=["HS256"]) {'some': 'payload'} diff --git a/docs/api.rst b/docs/api.rst index eb95f4c..266082a 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -23,7 +23,7 @@ API Reference Verify the ``jwt`` token signature and return the token claims. - :param str|bytes jwt: the token to be decoded + :param str jwt: the token to be decoded :param str key: the key suitable for the allowed algorithm :param list algorithms: allowed algorithms, e.g. ``["ES256"]`` @@ -43,9 +43,9 @@ API Reference * ``verify_iss=False`` check that ``iss`` (issuer) claim matches ``issuer`` * ``verify_signature=True`` verify the JWT cryptographic signature - :param iterable audience: optional, the value for ``verify_aud`` check + :param Iterable audience: optional, the value for ``verify_aud`` check :param str issuer: optional, the value for ``verify_iss`` check - :param int|float leeway: a time margin in seconds for the expiration check + :param float leeway: a time margin in seconds for the expiration check :rtype: dict :returns: the JWT claims diff --git a/docs/conf.py b/docs/conf.py index 8c1da89..297e903 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -83,6 +83,10 @@ pygments_style = "sphinx" # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False +# Intersphinx extension. +intersphinx_mapping = { + "python": ("https://docs.python.org/3/", None), +} # -- Options for HTML output ---------------------------------------------- diff --git a/docs/index.rst b/docs/index.rst index 10d7816..fba7d2a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -32,7 +32,7 @@ Example Usage >>> import jwt >>> encoded_jwt = jwt.encode({"some": "payload"}, "secret", algorithm="HS256") >>> print(encoded_jwt) - eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzb21lIjoicGF5bG9hZCJ9.4twFt5NiznN84AWoo1d7KO1T_yoc0Z6XOpOVswacPZg + eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzb21lIjoicGF5bG9hZCJ9.Joh1R2dYzkRvDkqv3sygm5YyK8Gi4ShZqbhK2gxcs2U >>> jwt.decode(encoded_jwt, "secret", algorithms=["HS256"]) {'some': 'payload'} |