summaryrefslogtreecommitdiff
path: root/docs
Commit message (Collapse)AuthorAgeFilesLines
* Make mypy configuration stricter and improve typing (#830)Aarni Koskela2022-12-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * PyJWS._verify_signature: raise early KeyError if header is missing alg * Make Mypy configuration stricter * Improve typing in jwt.utils * Improve typing in jwt.help * Improve typing in jwt.exceptions * Improve typing in jwt.api_jwk * Improve typing in jwt.api_jws * Improve typing & clean up imports in jwt.algorithms * Correct JWS.decode rettype to any (payload could be something else) * Update typing in api_jwt * Improve typing in jwks_client * Improve typing in docs/conf.py * Fix (benign) mistyping in test_advisory * Fix misc type complaints in tests
* Custom header configuration in jwk client (#823)Michael Haines2022-11-161-1/+2
| | | | | | | | | | | | | | | | | | * allow configuration of custom headers in JWKClient * revert changes to algorithms * document example usage of custom headers * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * black format tests * Add a release note for optional headers arg Co-authored-by: thundercat1 <michael.haines@recursionpharma.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Add `Algorithm.compute_hash_digest` and use it to implement at_hash ↵Stephen Rosen2022-11-021-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | validation example (#775) * Add compute_hash_digest to Algorithm objects `Algorithm.compute_hash_digest` is defined as a method which inspects the object to see that it has the requisite attributes, `hash_alg`. If `hash_alg` is not set, then the method raises a NotImplementedError. This applies to classes like NoneAlgorithm. If `hash_alg` is set, then it is checked for ``` has_crypto # is cryptography available? and isinstance(hash_alg, type) and issubclass(hash_alg, hashes.HashAlgorithm) ``` to see which API for computing a digest is appropriate -- `hashlib` vs `cryptography.hazmat.primitives.hashes`. These checks could be avoided at runtime if it were necessary to optimize further (e.g. attach compute_hash_digest methods to classes with a class decorator) but this is not clearly a worthwhile optimization. Such perf tuning is intentionally omitted for now. * Add doc example of OIDC login flow The goal of this doc example is to demonstrate usage of `get_algorithm_by_name` and `compute_hash_digest` for the purpose of `at_hash` validation. It is not meant to be a "guaranteed correct" and spec-compliant example. closes #314
* Update audience typing (#782)Julian Maurin2022-07-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | * fix(api_jwt): update audience typing & type checking * doc(api): update decode.audience typing * feat(test_api_jwt): ensure audience as bytes raises error * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * refacto(api_jwt): precise typing Co-authored-by: Julian Maurin <julian.maurin.perso@pm.me> Update jwt/api_jwt.py Co-authored-by: Julian Maurin <julian.maurin.perso@pm.me> fix(jwt/api_jwt.py): backport future annotations * fix: handle audience=0 Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
* Fix for headers disorder issue (#721)kadabusha2022-07-191-1/+1
| | | | | | | | | | | | | * Fix for headers disorder issue Related issue #715 * Added comment with reference to issue Needed to trigger tests once more time. * Fix for hardcoded value in docs after adding sort to jwt/api_jws.py * Removed unneeded comment - issue #721
* Fixed TypeError (#738)Abram (^o^)2022-03-081-1/+1
| | | In the example above [https://github.com/jpadilla/pyjwt/edit/master/docs/usage.rst#encoding--decoding-tokens-with-hs256], when tried, it throws a TypeError that says: `encode() got an unexpected keyword argument 'algorithms'`, so I changed the `algorithms` to `algorithm`
* Docs: mention performance reasons for reusing RSAPrivateKey when encoding (#734)Dan Mahr2022-02-151-0/+3
| | | | | | | | | * Mention reusing RSAPrivateKey for performance reasons * [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>
* fix: Update copyright information (#729)Kevin Kirsche2022-02-021-1/+1
| | | Fix: #458
* Update usage.rst (#727)guneybilen2022-01-281-1/+1
|
* documentation fix: show correct scope for decode_complete() (#661)sseering2021-12-101-0/+2
| | | Co-authored-by: Stefan Seering <sseering@todo.find.proper.mail.domain>
* Use timezone package as Python 3.5+ is required (#694)Kevin Kirsche2021-10-061-5/+6
| | | | | | | | | | | | | | | | | | | * Use timezone package as Python 3.5+ is required This method is deprecated: https://docs.python.org/3/library/datetime.html#datetime.datetime.utcnow Replaced with: https://docs.python.org/3/library/datetime.html#datetime.datetime.utcnow using: https://docs.python.org/3/library/datetime.html#datetime.timezone.utc which seems to indicate this was added in Python 3.2 * [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>
* Add support for Ed448/EdDSA. (#675)Ajitomi, Daisuke2021-10-031-1/+1
| | | | | * Add support for Ed448/EdDSA. * Add test for verification using EdDSA private key.
* Fix docsJosé Padilla2021-08-081-1/+1
|
* DOC: Clarify RSA encoding and decoding depend on the cryptography package (#664)Thomas P2021-08-082-0/+5
| | | | | | | | | * DOC: Clarify RSA encoding and decoding depend on the cryptography package Followup to #208 * DOC: Add a reference to the cryptography section in the installation file Fixes missing reference in the previously edited file
* Prefer headers['alg'] to algorithm parameter in encode(). (#673)Ajitomi, Daisuke2021-08-051-2/+3
| | | | | | | | | | | * Prefer headers['alg'] to algorithm parameter in encode(). * Fix lack of @crypto_required. * Prefer headers['alg'] to algorithm parameter in encode(). * Prefer headers['alg'] to algorithm parameter in encode(). * Make algorithm parameter of encode() Optioanl explicitly.
* Complete `jwt` documentation (#654)Johannes Jarbratt2021-04-291-13/+68
| | | | | | | * Add warning and clarify how default values are set * Copy `jwt.decode` documentation to `jwt.decode_complete` * Customize `jwt.decode_complete` documentation
* Fix incorrect documentation for jwt (#651)Johannes Jarbratt2021-04-281-7/+12
| | | | | | | | | | | | | * 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>
* Clearly warn against computing algorithms from the token’s alg (#647)Anders Kaseorg2021-04-282-3/+24
| | | Signed-off-by: Anders Kaseorg <andersk@mit.edu>
* changed 'paramenter' to 'parameter' (#638)leftovervirus2021-04-161-1/+1
| | | Co-authored-by: leftovervirus <leftovervirus@Steve-PC.localdomain>
* Update doc for ES256K. (#632)Ajitomi, Daisuke2021-03-201-1/+2
|
* Include changelog in docs (#597)José Padilla2021-01-112-0/+2
|
* Release 2.0.0 (#576)José Padilla2020-12-221-0/+23
| | | | | | | * Bump up version to 2.0.0 * Update usage docs * Update CHANGELOG
* Simplify black configuration to be closer to upstream defaults (#568)Jon Dufresne2020-12-211-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Simplify black configuration to be closer to upstream defaults Avoid extra configuration by simply going with Black defaults. This allows removing some configuration options, thus simplifying the overall configuration. It also makes the code style closer to community conventions. As more projects adopt black formatting, more code will look like the black defaults. Further, the default 88 tends to create more readable lines, IMO. The black rationale is located at: https://black.readthedocs.io/en/stable/the_black_code_style.html#line-length * Update tests/test_api_jws.py Co-authored-by: José Padilla <jpadilla@webapplicate.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update tests/test_api_jws.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: José Padilla <jpadilla@webapplicate.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Fix tox "docs" environment to pass (#567)Jon Dufresne2020-12-213-4/+8
| | | | | | | | - 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.
* Autoupdate pre-commit hooks and apply them (#561)Jon Dufresne2020-12-191-1/+6
| | | https://pre-commit.com/#updating-hooks-automatically
* Replace codecs.open() with builtin open() (#548)Jon Dufresne2020-12-171-2/+1
| | | | Since Python 3, these two functions are functionally equivalent, so use the builtin one.
* Update code blocks in docs (#545)Jon Dufresne2020-12-174-87/+71
| | | | | | | | | | | | | | | | | | | | | | | Update Python 2 syntax and drop Python-2-only examples. Fix all Python console prompts to the full ">>> " for correct highlighting. Use "pycon" instead of "python" for interactive Python console session. The "python" lexer is for Python scripts and doesn't interpret the ">>>" prompt. Fix all Python console code blocks to more accurately display what the user will see. For example, when assigning a value to a variable, it isn't also echoed. Fix typo ".. code::" → ".. code-block::". Use "console" instead of "sh" for shell sessions. The "sh" lexer is for shell scripts. For a complete list of lexers, see: https://pygments.org/docs/lexers/ Use blacken-docs to run black on code blocks. This is now included as a pre-commit hook.
* Remove deprecated arguments from docs (#544)Jon Dufresne2020-12-162-18/+4
| | | | They were removed from the code in f690976596bb74221f5a81fc9afffd5609bc4e70.
* Remove "Command line" sections from docs (#539)Jon Dufresne2020-12-161-14/+0
| | | | The CLI entry point was removed in commit 8a14f087c285bbe2f6e85ba4818e6c620b708d5d.
* Upgrade black version and usage (#538)Jon Dufresne2020-12-161-3/+3
| | | | | | Upgrade black to version 20.8b1 and specify that Python 3.6+ syntax should be used. Run it on all files to upgrade syntax.
* add EdDSA to docs (#531)Nutchanon Ninyawee2020-11-131-0/+1
| | | https://github.com/jpadilla/pyjwt/pull/455
* Fix usage example (#530)Michal Čihař2020-11-101-1/+1
| | | The algorithms parameter for decode accepts list not a string.
* Update api.rstJosé Padilla2020-11-041-1/+1
|
* Fix Example Usage in docs2.0.0a1José Padilla2020-11-021-1/+0
|
* Documents how to use private keys with passphrases (#525)Ray Luo2020-10-291-0/+15
| | | This can address https://github.com/jpadilla/pyjwt/issues/286
* Update return type for jwt.encode (#521)moomoolive2020-10-151-1/+1
| | | It seems to me that the return type for the encode method is actually 'bytes' type and not 'str'. While this doesn't make a huge difference working with python code, it gave me some issues yesterday when sending JWT tokens between a Python (flask) REST API and Javascript (Vue) frontend.
* Removed redundant `default_backend()` (#523)Kaushal Rohit2020-10-121-4/+2
| | | - Cryptography now has default_backend by default
* Update Auth0 sponsorship link (#519)Sam Bellen2020-09-241-5/+3
| | | | | | | | | | | | | | | | | | | | * Update Auth0 sponsorship link Hey We recently launched a new page specifically geared towards developers on auth0.com. Can we change the link in the sponsorship message? Thanks again for your continuous open-source work! Sam * Update both link and link-text * Update README.rst * Update index.rst Co-authored-by: José Padilla <jpadilla@webapplicate.com>
* Drop support for legacy contrib algorithms (#514)José Padilla2020-08-242-42/+0
| | | | | * Drop support for legacy contrib algorithms * Update cryptography dep
* Return tokens as string not bytes (#513)José Padilla2020-08-241-2/+3
|
* Setup GH Actions (#499)José Padilla2020-08-191-207/+37
| | | | | | | | | | | | | | | * Setup GH Actions * Remove src path changes * Add dev extras * Update USING_COVERAGE * last update * Upgrade pytest * Remove 2.7 things
* Remove unnecessary compatibility shims for Python 2 (#498)Jon Dufresne2020-06-191-1/+1
| | | | | | | | | | | As the project is Python 3 only, can remove the compatibility shims in compat.py. Type checking has been simplified where it can: - str is iterable - bytes is iterable - use isinstance instead of issubclass The remaining function bytes_from_int() has been moved to utils.py.
* Fix `tox -e lint` warnings and errors (#490)Jon Dufresne2020-06-091-7/+1
| | | Now successfully passes when running `tox -e lint`.
* Run pyupgrade across project to use modern Python 3 conventions (#491)Jon Dufresne2020-06-081-9/+7
| | | | | | | | pyupgrade is a tool to automatically upgrade Python syntax for newer versions of the language. Running pyupgrade removes several Python-2-isms that are no longer necessary now that the project is Python 3 only. https://github.com/asottile/pyupgrade
* Require tweak (#280)Pau Ruiz Safont2020-05-141-0/+10
| | | | | | | | | | | * Use require options as a list, instead of booleans Deprecate the use of the boolean options * Add test for the new require option * Add documentation on how to use the require option Co-authored-by: Pau Ruiz i Safont <psafont@ebi.ac.uk>
* Document top-level .encode and .decode to close #459 (#482)Dima Tisnek2020-04-262-4/+64
| | | Co-authored-by: José Padilla <jpadilla@webapplicate.com>
* Improve documentation for audience usage (#484)Correy Lim2020-04-261-8/+35
| | | | | | | | | | | | | | | | | | | | | | | * Add code example for `aud` being an array The previous code example only showed the `aud` claim as a single case-sensitive string, despite the documentation mentioning that the `aud` claim can be an array of case-sensitive strings Add a code block demonstrating the `aud` claim being an array of case-sensitive strings to make it more clear to the user that it is a permitted use of the `aud` claim * Add example of the `audience` param as an iterable Demonstrate to users reading the documentation that the `audience` parameter is not restricted to the `string` type, but can also accept an iterable, as implemented in PR#306 https://github.com/jpadilla/pyjwt/pull/306 * Fix short title underlines Short title underlines throw warnings in reStructuredText linters
* DX Tweaks (#450)José Padilla2019-10-213-87/+93
| | | | | | | | | | * Setup pre-commit hooks * Run initial `tox -e lint` * Fix package name * Fix .travis.yml
* Document (and prefer) `pyjwt[crypto]` req format (#426)Gunnlaugur Thor Briem2019-06-121-2/+7
|
* Fixes example invocations in README.rst and docs/index.rst. (#368)Debayan De2018-08-141-2/+2
| | | Signed-off-by: Debayan De <debayande@users.noreply.github.com>