summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* [pre-commit.ci] pre-commit autoupdate (#788)pre-commit-ci[bot]2022-08-021-1/+1
| | | | | | updates: - [github.com/PyCQA/flake8: 4.0.1 → 5.0.2](https://github.com/PyCQA/flake8/compare/4.0.1...5.0.2) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Add cacheing functionality for JWK set (#781)Haoyu(Jerry) Wu2022-08-014-33/+263
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Initial implementation of ttl jwk set cache (cherry picked from commit 479a7c124d63113a2190bd48972cc19172215096) * Add unit test for jwk set cache * Fix failed unit test * Disable cache signing key by default * Add a negative unit test for get_jwk_set * Add functionality to force refresh the jwk set cache when no matching signing key can be found from the cache * Add unit test for refresh cache * Add unit test to unset cache when the network call throws error * fix naming typo * Update unit test naming * Update comment * Add check for lifespan * Update comments for get_signing_key * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix ci error * Add type declaration to fix CI error * Add more unit tests to improve coverage * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Try to increase test coverage to 100% Co-authored-by: Jerry Wu <hawu@roku.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Add type hints to jwt/help.py and add missing types dependency (#784)Kevin Kirsche2022-08-012-5/+8
| | | | | | | * refactor: add type hints to jwt/help.py * refactor: include cryptography types when installing development environment * fix: unused type: ignore on Python 3.8
* Improve PyJWKSet error accuracy (#786)Julian Maurin2022-08-012-9/+18
| | | | | | | | | * refacto(TestPyJWKSet): crypto_required decorator at the class level * refacto(TestPyJWKSet): add test to validate the constructor behaviour * fix(PyJWKSet): improve error accuracy Co-authored-by: JulianMaurin <julian.maurin@backmarket.com>
* Update audience typing (#782)Julian Maurin2022-07-313-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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-193-3/+4
| | | | | | | | | | | | | * 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
* Fix typo: priot -> prior (#780)Jon Dufresne2022-07-101-1/+1
|
* Emit a deprecation warning for unsupported kwargs (#776)Stephen Rosen2022-07-056-8/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `**kwargs` usages cannot be removed without breaking backwards compatibility. Unsupported kwargs cannot even be rejected without breaking compatibility. However, this does not mean that the library cannot identify and warn when unsupported arguments are used. The warning behavior simply has to be separated from any removal of `**kwargs`. All legitimate `**kwargs` usages have been replaced with explicit arguments. Any other arguments will be captured under `**kwargs` and trigger the deprecation warnings. In the cases of `decode() -> decode_complete()` passthrough, the passthrough has been removed to avoid duplicate deprecation warnings on a single usage. This makes a very subtle behavioral change to `**kwargs` *only* for the case of a subclass of PyJWT or PyJWS. Extra arguments used by a specialized subclass won't pass through transparently anymore. In such a case the subclass author has multiple resolutions available, including reimplementation of the `decode()` method to passthrough the additional argument. Although technically backwards-incompatible for a niche subclassing usage, this behavior is very nearly identical and shouldn't pose an issue for the vast majority of pyjwt users. The deprecation warning does not cover all deprecated usages. In particular, several passthrough arguments for claim validation should probably be made available via `options` and later removed. The arguments in need of attention now have inline comments in the signature definitions, but are otherwise left unmodified, leaving current usages correct and valid.
* [pre-commit.ci] pre-commit autoupdate (#778)pre-commit-ci[bot]2022-07-051-1/+1
| | | | | | updates: - [github.com/psf/black: 22.3.0 → 22.6.0](https://github.com/psf/black/compare/22.3.0...22.6.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Remove support for python3.6 (#777)Stephen Rosen2022-07-045-8/+7
|
* Expose get_algorithm_by_name as new method (#773)Stephen Rosen2022-07-033-22/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Expose get_algorithm_by_name as new method Looking up an algorithm by name is used internally for signature generation. This encapsulates that functionality in a dedicated method and adds it to the public API. No new tests are needed to exercise the functionality. Rationale: 1. Inside of PyJWS, this improves the code. The KeyError handler is better scoped and the signing code reads more directly. 2. This is part of the path to supporting OIDC at_hash validation as a use-case (see: #295, #296, #314). This is arguably sufficient to consider that use-case supported and close it. However, it is an improvement and step in the right direction in either case. A minor change was needed to satisfy mypy, as a union-typed variable does not narrow its type based on assignments. The easiest resolution is to use a new name, in this case, simply `algorithm -> algorithm_`. * Use get_algorithm_by_name in _verify_signature Rather than catching the KeyError from a dict lookup, catch the NotImplementedError raised by get_algorithm_by_name. This changes the exception seen in the cause under exception chaining but otherwise has no public-facing impact.
* docs: fix simple typo, iinstance -> isinstance (#774)Tim Gates2022-07-031-1/+1
| | | | | There is a small typo in jwt/algorithms.py. Should read `isinstance` rather than `iinstance`.
* [pre-commit.ci] pre-commit autoupdate (#770)pre-commit-ci[bot]2022-06-141-1/+1
| | | | | | updates: - [github.com/pre-commit/pre-commit-hooks: v4.2.0 → v4.3.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.2.0...v4.3.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Bump actions/setup-python from 3 to 4 (#769)dependabot[bot]2022-06-091-4/+4
| | | | | | | | | | | | | | | | Bumps [actions/setup-python](https://github.com/actions/setup-python) from 3 to 4. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Fixes for pyright on strict mode (#747)Brandon Chinn2022-05-313-6/+8
| | | | | * Fixes for pyright on strict mode * Update CHANGELOG.rst
* Do not fail when an unusable key occurs (#762)Matthias Gilch2022-05-315-3/+31
| | | | | | | | | | | | | | | | | | | * Do not fail when a unusable key occurs There may be more than keys in the store which may be (still usable). Therefore we do not want to fail on any key that is not usable by pyjwt, but rather skip when appending to the KeySet * Add test cases with unusable 'alg' keys * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add 'skip keys' to changelog * Update CHANGELOG.rst Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* chore: pin sphinx in docs requiresJosé Padilla2022-05-311-1/+1
|
* chore: pin sphinxJosé Padilla2022-05-311-1/+1
|
* Adjust expected exceptions in option merging tests for PyPy3 (#763)Michał Górny2022-05-263-4/+8
| | | | | | | | | | | | | | | | | | * Adjust expected exceptions in option merging tests for PyPy3 PyPy3 raises ValueError rather than TypeError when trying to combine a dict and a str in dict unpacking. Update the test expectations appropriately. Fixes #580 * Enable GHA testing on Python 3.11 and all PyPy3 versions Enable testing on all Python 3 versions supported by GitHub Actions at the moment. While at it, fix the tox invocation for Python 3.10. * drop pypy3.7 from tox Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
* Remove redundant wheel dep from pyproject.toml (#765)Michał Górny2022-05-261-1/+1
| | | | | | | The `wheel` dependency is added automatically by setuptools build backend (since day one) and therefore should not be specified explicitly. Listing it in documentation was a historical mistake and has been corrected since. See: https://github.com/pypa/setuptools/commit/f7d30a9529378cf69054b5176249e5457aaf640a
* Add to_jwk static method to ECAlgorithm (#732)Leon Smith2022-05-234-0/+138
| | | | | | | | | | | | | | | | | * Add to_jwk static method to ECAlgorithm * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add in tests for ECAlgorithm.to_jwk * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add to_jwk pull request to changelog Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Revert "adding support for compressed payloads (#753)" (#761)Asif Saif Uddin2022-05-232-55/+1
| | | This reverts commit 675fa10db578886ee6cfd1df688236f69560ced4.
* adding support for compressed payloads (#753)Daniel Miles2022-05-192-1/+55
| | | | | | | | | | | | | | | | | | | * adding support for compressed payloads * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * adding test to cover all lines in patch * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * addressing flake8 unused variable and cyclomatic complexity complaints * expanding test for better coverage Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Bump actions/setup-python from 2 to 3 (#756)dependabot[bot]2022-05-161-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | * Bump actions/setup-python from 2 to 3 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 3. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 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>
* Bump codecov/codecov-action from 1 to 3 (#757)dependabot[bot]2022-05-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * Bump codecov/codecov-action from 1 to 3 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 1 to 3. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v1...v3) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Bump actions/checkout from 2 to 3 (#758)dependabot[bot]2022-05-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | * Bump actions/checkout from 2 to 3 Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* chore: fix lint errorsJosé Padilla2022-05-152-9/+12
|
* chore: update actions via dependabotJosé Padilla2022-05-151-0/+6
|
* chore: add stale workflowJosé Padilla2022-05-151-0/+25
|
* chore: update changelog2.4.0José Padilla2022-05-121-1/+1
|
* chore: update changelogJosé Padilla2022-05-121-1/+33
|
* fix: failing advisory testJosé Padilla2022-05-121-0/+3
|
* Merge pull request from GHSA-ffqj-6fqr-9h24José Padilla2022-05-126-23/+191
| | | Co-authored-by: José Padilla <jpadilla@users.noreply.github.com>
* Update CHANGELOG.rst (#751)Jaroslaw Zabiello2022-04-191-0/+5
| | | Add an example of how to convert the old v1.x syntax into v2.x one. That old syntax was popular but it was not clear how to change it after pyjwt upgrade.
* Replace various string interpolations with f-strings (#744)Aarni Koskela2022-04-127-21/+18
|
* [pre-commit.ci] pre-commit autoupdate (#748)pre-commit-ci[bot]2022-04-121-1/+1
| | | | | | updates: - [github.com/pre-commit/pre-commit-hooks: v4.1.0 → v4.2.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.1.0...v4.2.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Don't mutate options dictionary in .decode_complete() (#743)Aarni Koskela2022-04-052-4/+10
| | | Fixes #679
* Add a deprecation warning when jwt.decode() is called with the legacy ↵Aarni Koskela2022-04-052-0/+28
| | | | | | | verify= argument (#742) Since the arbitrary/unused `**kwargs` can't quite be dropped (as #657 would do) without a major version bump (as reverted in #701), it's still a good idea to warn users if they are attempting to use contradictory arguments for the security-sensitive `verify=` argument.
* [pre-commit.ci] pre-commit autoupdate (#740)pre-commit-ci[bot]2022-04-051-2/+2
| | | | | | | updates: - [github.com/psf/black: 22.1.0 → 22.3.0](https://github.com/psf/black/compare/22.1.0...22.3.0) - [github.com/mgedmin/check-manifest: 0.47 → 0.48](https://github.com/mgedmin/check-manifest/compare/0.47...0.48) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Add detached payload support for JWS encoding and decoding (#723)Florent Viard2022-03-262-9/+91
| | | | | | | | | | | | | | | | | | | | | | Specifications allow to have JWS with unencoded detached payloads. This changeset adds detached payload support for encoding and decoding functions. For encoding, detached payload can be enabled by setting the "is_payload_detached" arg or having the "b64=False" inside the headers. For decoding, the detached payload content (bytes) has to be provided with the "detached_payload" arg and "b64=False" has to be found inside the decoded headers. Functionnally, when this feature is used, the signature will be computed over the raw data bytes of the payload, without being base64 encoded and obviously, the payload will not be provided inside the generated JWS. So, the generated JWS will look like: base64url(header)..base64url(signature) Relevant specifications: RFC 7515: "JSON Web Signature (JWS)". (Annexe F) RFC 7797: "JSON Web Signature (JWS) Unencoded Payload Option".
* 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-023-3/+3
| | | Fix: #458
* [pre-commit.ci] pre-commit autoupdate (#728)pre-commit-ci[bot]2022-02-011-2/+2
| | | | | | | updates: - [github.com/psf/black: 21.12b0 → 22.1.0](https://github.com/psf/black/compare/21.12b0...22.1.0) - [github.com/asottile/blacken-docs: v1.12.0 → v1.12.1](https://github.com/asottile/blacken-docs/compare/v1.12.0...v1.12.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Update usage.rst (#727)guneybilen2022-01-281-1/+1
|
* api_jwk: Add PyJWKSet.__getitem__ (#725)William Woodruff2022-01-253-0/+31
| | | | | | | * api_jwk: Add PyJWKSet.__getitem__ Closes #724. * CHANGELOG: record changes
* [pre-commit.ci] pre-commit autoupdate (#720)pre-commit-ci[bot]2021-12-281-1/+1
| | | | | | updates: - [github.com/pre-commit/pre-commit-hooks: v4.0.1 → v4.1.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.0.1...v4.1.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Explicit check the key for ECAlgorithm (#713)Evgeniy Tatarkin2021-12-122-0/+18
| | | | | | | | | * Explicit check the key for ECAlgorithm * [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>
* [pre-commit.ci] pre-commit autoupdate (#716)pre-commit-ci[bot]2021-12-111-1/+1
| | | | | | updates: - [github.com/psf/black: 21.11b1 → 21.12b0](https://github.com/psf/black/compare/21.11b1...21.12b0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* 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>