| 1 |
Changelog |
| 2 |
========= |
| 3 |
|
| 4 |
All notable changes to this project will be documented in this file. |
| 5 |
This project adheres to `Semantic Versioning <https://semver.org/>`__. |
| 6 |
|
| 7 |
`Unreleased <https://github.com/jpadilla/pyjwt/compare/2.14.0...HEAD>`__ |
| 8 |
------------------------------------------------------------------------- |
| 9 |
|
| 10 |
`v2.14.0 <https://github.com/jpadilla/pyjwt/compare/2.13.0...2.14.0>`__ |
| 11 |
----------------------------------------------------------------------- |
| 12 |
|
| 13 |
Security |
| 14 |
~~~~~~~~ |
| 15 |
|
| 16 |
- Harden HMAC key validation against public-key material supplied as JWK, |
| 17 |
JWKS, array, encoded, BOM-prefixed, DER, or PEM input. See |
| 18 |
`GHSA-r6x4-923q-g947 <https://github.com/jpadilla/pyjwt/security/advisories/GHSA-r6x4-923q-g947>`__, |
| 19 |
`GHSA-ffc3-869f-jxw9 <https://github.com/jpadilla/pyjwt/security/advisories/GHSA-ffc3-869f-jxw9>`__, |
| 20 |
`GHSA-p4g4-x82p-q773 <https://github.com/jpadilla/pyjwt/security/advisories/GHSA-p4g4-x82p-q773>`__, |
| 21 |
and `GHSA-w2cx-738m-mc7w <https://github.com/jpadilla/pyjwt/security/advisories/GHSA-w2cx-738m-mc7w>`__. |
| 22 |
- Reject automatic redirects when ``PyJWKClient`` fetches a JWKS, preventing |
| 23 |
redirected destinations from being treated as trusted key sources. See |
| 24 |
`GHSA-9v7f-9g4p-ffgj <https://github.com/jpadilla/pyjwt/security/advisories/GHSA-9v7f-9g4p-ffgj>`__. |
| 25 |
- Limit repeated JWKS refreshes caused by unknown key IDs while preserving |
| 26 |
normal key-rotation behavior. See |
| 27 |
`GHSA-2gx3-rcp4-g85q <https://github.com/jpadilla/pyjwt/security/advisories/GHSA-2gx3-rcp4-g85q>`__. |
| 28 |
- Handle deeply nested and malformed JWS/JWK input without uncaught recursion |
| 29 |
errors or whole-set parsing failures. See |
| 30 |
`GHSA-8wjv-2p76-3863 <https://github.com/jpadilla/pyjwt/security/advisories/GHSA-8wjv-2p76-3863>`__ |
| 31 |
and `GHSA-w6j9-cwv2-h6wq <https://github.com/jpadilla/pyjwt/security/advisories/GHSA-w6j9-cwv2-h6wq>`__. |
| 32 |
- Enforce detached-payload and compact JWS encoding rules during decoding. |
| 33 |
See `GHSA-hxm8-2xgr-2p9m <https://github.com/jpadilla/pyjwt/security/advisories/GHSA-hxm8-2xgr-2p9m>`__ |
| 34 |
and `GHSA-mvj7-wp6q-v59j <https://github.com/jpadilla/pyjwt/security/advisories/GHSA-mvj7-wp6q-v59j>`__. |
| 35 |
|
| 36 |
Fixed |
| 37 |
~~~~~ |
| 38 |
|
| 39 |
- Apply HMAC key validation consistently when keys are loaded through |
| 40 |
``PyJWK`` and ``PyJWKClient``. See |
| 41 |
`GHSA-pxh4-856f-4h89 <https://github.com/jpadilla/pyjwt/security/advisories/GHSA-pxh4-856f-4h89>`__. |
| 42 |
- Reject empty HMAC keys when represented as JWKs. |
| 43 |
See `GHSA-pxh4-856f-4h89 <https://github.com/jpadilla/pyjwt/security/advisories/GHSA-pxh4-856f-4h89>`__. |
| 44 |
|
| 45 |
`v2.13.0 <https://github.com/jpadilla/pyjwt/compare/2.12.1...2.13.0>`__ |
| 46 |
----------------------------------------------------------------------- |
| 47 |
|
| 48 |
Security |
| 49 |
~~~~~~~~ |
| 50 |
|
| 51 |
- Reject JWK JSON documents passed as raw HMAC secrets in |
| 52 |
``HMACAlgorithm.prepare_key`` to close an algorithm-confusion gap that |
| 53 |
the existing PEM/SSH guard did not cover. Reported by @aradona91 in |
| 54 |
`GHSA-xgmm-8j9v-c9wx <https://github.com/jpadilla/pyjwt/security/advisories/GHSA-xgmm-8j9v-c9wx>`__. |
| 55 |
- Bind the JWT header ``alg`` to ``PyJWK.algorithm_name`` during |
| 56 |
verification so the caller's ``algorithms=[...]`` allow-list cannot be |
| 57 |
bypassed when decoding with a ``PyJWK`` / ``PyJWKClient`` key. Reported |
| 58 |
by @sushi-gif in `GHSA-jq35-7prp-9v3f <https://github.com/jpadilla/pyjwt/security/advisories/GHSA-jq35-7prp-9v3f>`__. |
| 59 |
- Reject non-``http(s)`` URI schemes in ``PyJWKClient`` so attacker- |
| 60 |
influenced URIs cannot read local files or reach unintended schemes via |
| 61 |
urllib's default ``file://`` / ``ftp://`` / ``data:`` handlers. Reported |
| 62 |
by @KEIJOT in `GHSA-993g-76c3-p5m4 <https://github.com/jpadilla/pyjwt/security/advisories/GHSA-993g-76c3-p5m4>`__. |
| 63 |
- Preserve the cached JWK Set on fetch errors in ``PyJWKClient.fetch_data``. |
| 64 |
The previous ``finally``-block ``put(None)`` pattern cleared the cache |
| 65 |
on any transient outage, turning one bad JWKS request into application- |
| 66 |
wide auth failure. Reported by @eddieran in `GHSA-fhv5-28vv-h8m8 <https://github.com/jpadilla/pyjwt/security/advisories/GHSA-fhv5-28vv-h8m8>`__. |
| 67 |
- Skip the unconditional base64 decode of the compact-form payload segment |
| 68 |
when ``b64=false`` is set in the protected header, and require that |
| 69 |
segment to be empty (RFC 7515 Appendix F detached form). Closes an |
| 70 |
unauthenticated DoS amplifier. Reported by @thesmartshadow in |
| 71 |
`GHSA-w7vc-732c-9m39 <https://github.com/jpadilla/pyjwt/security/advisories/GHSA-w7vc-732c-9m39>`__. |
| 72 |
|
| 73 |
Fixed |
| 74 |
~~~~~ |
| 75 |
|
| 76 |
- Reject empty HMAC keys outright in ``HMACAlgorithm.prepare_key`` with |
| 77 |
``InvalidKeyError`` instead of accepting them with only a warning. |
| 78 |
Thanks to @SnailSploit and @spartan8806 for independently flagging the |
| 79 |
footgun. |
| 80 |
- Forward per-call ``options`` (including ``enforce_minimum_key_length``) |
| 81 |
from ``PyJWT.decode`` through to ``PyJWS._verify_signature`` so the |
| 82 |
option actually takes effect when set at the call site rather than only |
| 83 |
on the ``PyJWT`` instance. Thanks to @WLUB for the report. |
| 84 |
- RFC 7797 §3 compliance for ``b64=false``: the encoder now auto-adds |
| 85 |
``"b64"`` to the ``crit`` header parameter, and the decoder rejects |
| 86 |
tokens that set ``b64=false`` without listing it in ``crit``. Thanks to |
| 87 |
@MachineLearning-Nerd for the report. |
| 88 |
|
| 89 |
Changed |
| 90 |
~~~~~~~ |
| 91 |
|
| 92 |
- Migrate the ``dev``, ``docs``, and ``tests`` package extras to dependency groups by @kurtmckee in `#1152 <https://github.com/jpadilla/pyjwt/pull/1152>`__ |
| 93 |
|
| 94 |
`v2.12.1 <https://github.com/jpadilla/pyjwt/compare/2.12.0...2.12.1>`__ |
| 95 |
------------------------------------------------------------------------ |
| 96 |
|
| 97 |
Fixed |
| 98 |
~~~~~ |
| 99 |
|
| 100 |
- Add missing ``typing_extensions`` dependency for Python < 3.11 in `#1150 <https://github.com/jpadilla/pyjwt/issues/1150>`__ |
| 101 |
|
| 102 |
`v2.12.0 <https://github.com/jpadilla/pyjwt/compare/2.11.0...2.12.0>`__ |
| 103 |
----------------------------------------------------------------------- |
| 104 |
|
| 105 |
Fixed |
| 106 |
~~~~~ |
| 107 |
|
| 108 |
- Annotate PyJWKSet.keys for pyright by @tamird in `#1134 <https://github.com/jpadilla/pyjwt/pull/1134>`__ |
| 109 |
- Close ``HTTPError`` response to prevent ``ResourceWarning`` on Python 3.14 by @veeceey in `#1133 <https://github.com/jpadilla/pyjwt/pull/1133>`__ |
| 110 |
- Do not keep ``algorithms`` dict in PyJWK instances by @akx in `#1143 <https://github.com/jpadilla/pyjwt/pull/1143>`__ |
| 111 |
- Validate the crit (Critical) Header Parameter defined in RFC 7515 §4.1.11. by @dmbs335 in `GHSA-752w-5fwx-jx9f <https://github.com/jpadilla/pyjwt/security/advisories/GHSA-752w-5fwx-jx9f>`__ |
| 112 |
- Use PyJWK algorithm when encoding without explicit algorithm in `#1148 <https://github.com/jpadilla/pyjwt/pull/1148>`__ |
| 113 |
|
| 114 |
Added |
| 115 |
~~~~~ |
| 116 |
|
| 117 |
- Docs: Add ``PyJWKClient`` API reference and document the two-tier caching system (JWK Set cache and signing key LRU cache). |
| 118 |
|
| 119 |
`v2.11.0 <https://github.com/jpadilla/pyjwt/compare/2.10.1...2.11.0>`__ |
| 120 |
----------------------------------------------------------------------- |
| 121 |
|
| 122 |
Fixed |
| 123 |
~~~~~ |
| 124 |
|
| 125 |
- Enforce ECDSA curve validation per RFC 7518 Section 3.4. |
| 126 |
- Fix build system warnings by @kurtmckee in `#1105 <https://github.com/jpadilla/pyjwt/pull/1105>`__ |
| 127 |
- Validate key against allowed types for Algorithm family in `#964 <https://github.com/jpadilla/pyjwt/pull/964>`__ |
| 128 |
- Add iterator for JWKSet in `#1041 <https://github.com/jpadilla/pyjwt/pull/1041>`__ |
| 129 |
- Validate `iss` claim is a string during encoding and decoding by @pachewise in `#1040 <https://github.com/jpadilla/pyjwt/pull/1040>`__ |
| 130 |
- Improve typing/logic for `options` in decode, decode_complete by @pachewise in `#1045 <https://github.com/jpadilla/pyjwt/pull/1045>`__ |
| 131 |
- Declare float supported type for lifespan and timeout by @nikitagashkov in `#1068 <https://github.com/jpadilla/pyjwt/pull/1068>`__ |
| 132 |
- Fix ``SyntaxWarning``\s/``DeprecationWarning``\s caused by invalid escape sequences by @kurtmckee in `#1103 <https://github.com/jpadilla/pyjwt/pull/1103>`__ |
| 133 |
- Development: Build a shared wheel once to speed up test suite setup times by @kurtmckee in `#1114 <https://github.com/jpadilla/pyjwt/pull/1114>`__ |
| 134 |
- Development: Test type annotations across all supported Python versions, |
| 135 |
increase the strictness of the type checking, and remove the mypy pre-commit hook |
| 136 |
by @kurtmckee in `#1112 <https://github.com/jpadilla/pyjwt/pull/1112>`__ |
| 137 |
|
| 138 |
Added |
| 139 |
~~~~~ |
| 140 |
|
| 141 |
- Support Python 3.14, and test against PyPy 3.10 and 3.11 by @kurtmckee in `#1104 <https://github.com/jpadilla/pyjwt/pull/1104>`__ |
| 142 |
- Development: Migrate to ``build`` to test package building in CI by @kurtmckee in `#1108 <https://github.com/jpadilla/pyjwt/pull/1108>`__ |
| 143 |
- Development: Improve coverage config and eliminate unused test suite code by @kurtmckee in `#1115 <https://github.com/jpadilla/pyjwt/pull/1115>`__ |
| 144 |
- Docs: Standardize CHANGELOG links to PRs by @kurtmckee in `#1110 <https://github.com/jpadilla/pyjwt/pull/1110>`__ |
| 145 |
- Docs: Fix Read the Docs builds by @kurtmckee in `#1111 <https://github.com/jpadilla/pyjwt/pull/1111>`__ |
| 146 |
- Docs: Add example of using leeway with nbf by @djw8605 in `#1034 <https://github.com/jpadilla/pyjwt/pull/1034>`__ |
| 147 |
- Docs: Refactored docs with ``autodoc``; added ``PyJWS`` and ``jwt.algorithms`` docs by @pachewise in `#1045 <https://github.com/jpadilla/pyjwt/pull/1045>`__ |
| 148 |
- Docs: Documentation improvements for "sub" and "jti" claims by @cleder in `#1088 <https://github.com/jpadilla/pyjwt/pull/1088>`__ |
| 149 |
- Development: Add pyupgrade as a pre-commit hook by @kurtmckee in `#1109 <https://github.com/jpadilla/pyjwt/pull/1109>`__ |
| 150 |
- Add minimum key length validation for HMAC and RSA keys (CWE-326). |
| 151 |
Warns by default via ``InsecureKeyLengthWarning`` when keys are below |
| 152 |
minimum recommended lengths per RFC 7518 Section 3.2 (HMAC) and |
| 153 |
NIST SP 800-131A (RSA). Pass ``enforce_minimum_key_length=True`` in |
| 154 |
options to ``PyJWT`` or ``PyJWS`` to raise ``InvalidKeyError`` instead. |
| 155 |
- Refactor ``PyJWT`` to own an internal ``PyJWS`` instance instead of |
| 156 |
calling global ``api_jws`` functions. |
| 157 |
|
| 158 |
`v2.10.1 <https://github.com/jpadilla/pyjwt/compare/2.10.0...2.10.1>`__ |
| 159 |
----------------------------------------------------------------------- |
| 160 |
|
| 161 |
|
| 162 |
Fixed |
| 163 |
~~~~~ |
| 164 |
|
| 165 |
- Prevent partial matching of `iss` claim by @fabianbadoi in `GHSA-75c5-xw7c-p5pm <https://github.com/jpadilla/pyjwt/security/advisories/GHSA-75c5-xw7c-p5pm>`__ |
| 166 |
|
| 167 |
|
| 168 |
`v2.10.0 <https://github.com/jpadilla/pyjwt/compare/2.9.0...2.10.0>`__ |
| 169 |
----------------------------------------------------------------------- |
| 170 |
|
| 171 |
|
| 172 |
Changed |
| 173 |
~~~~~~~ |
| 174 |
|
| 175 |
- Remove algorithm requirement from JWT API, instead relying on JWS API for enforcement, by @luhn in `#975 <https://github.com/jpadilla/pyjwt/pull/975>`__ |
| 176 |
- Use ``Sequence`` for parameter types rather than ``List`` where applicable by @imnotjames in `#970 <https://github.com/jpadilla/pyjwt/pull/970>`__ |
| 177 |
- Add JWK support to JWT encode by @luhn in `#979 <https://github.com/jpadilla/pyjwt/pull/979>`__ |
| 178 |
- Encoding and decoding payloads using the `none` algorithm by @jpadilla in `#c2629f6 <https://github.com/jpadilla/pyjwt/commit/c2629f66c593459e02616048443231ccbe18be16>`__ |
| 179 |
|
| 180 |
Before: |
| 181 |
|
| 182 |
.. code-block:: pycon |
| 183 |
|
| 184 |
>>> import jwt |
| 185 |
>>> jwt.encode({"payload": "abc"}, key=None, algorithm=None) |
| 186 |
|
| 187 |
After: |
| 188 |
|
| 189 |
.. code-block:: pycon |
| 190 |
|
| 191 |
>>> import jwt |
| 192 |
>>> jwt.encode({"payload": "abc"}, key=None, algorithm="none") |
| 193 |
|
| 194 |
- Added validation for 'sub' (subject) and 'jti' (JWT ID) claims in tokens by @Divan009 in `#1005 <https://github.com/jpadilla/pyjwt/pull/1005>`__ |
| 195 |
- Refactor project configuration files from ``setup.cfg`` to ``pyproject.toml`` by @cleder in `#995 <https://github.com/jpadilla/pyjwt/pull/995>`__ |
| 196 |
- Ruff linter and formatter changes by @gagandeepp in `#1001 <https://github.com/jpadilla/pyjwt/pull/1001>`__ |
| 197 |
- Drop support for Python 3.8 (EOL) by @kkirsche in `#1007 <https://github.com/jpadilla/pyjwt/pull/1007>`__ |
| 198 |
|
| 199 |
|
| 200 |
Fixed |
| 201 |
~~~~~ |
| 202 |
|
| 203 |
- Encode EC keys with a fixed bit length by @etianen in `#990 <https://github.com/jpadilla/pyjwt/pull/990>`__ |
| 204 |
- Add an RTD config file to resolve Read the Docs build failures by @kurtmckee in `#977 <https://github.com/jpadilla/pyjwt/pull/977>`__ |
| 205 |
- Docs: Update ``iat`` exception docs by @pachewise in `#974 <https://github.com/jpadilla/pyjwt/pull/974>`__ |
| 206 |
- Docs: Fix ``decode_complete`` scope and algorithms by @RbnRncn in `#982 <https://github.com/jpadilla/pyjwt/pull/982>`__ |
| 207 |
- Fix doctest for ``docs/usage.rst`` by @pachewise in `#986 <https://github.com/jpadilla/pyjwt/pull/986>`__ |
| 208 |
- Fix ``test_utils.py`` not to xfail by @pachewise in `#987 <https://github.com/jpadilla/pyjwt/pull/987>`__ |
| 209 |
- Docs: Correct `jwt.decode` audience param doc expression by @peter279k in `#994 <https://github.com/jpadilla/pyjwt/pull/994>`__ |
| 210 |
|
| 211 |
Added |
| 212 |
~~~~~ |
| 213 |
|
| 214 |
|
| 215 |
- Add support for python 3.13 by @hugovk in `#972 <https://github.com/jpadilla/pyjwt/pull/972>`__ |
| 216 |
- Create SECURITY.md by @auvipy and @jpadilla in `#973 <https://github.com/jpadilla/pyjwt/pull/973>`__ |
| 217 |
- Docs: Add PS256 encoding and decoding usage by @peter279k in `#992 <https://github.com/jpadilla/pyjwt/pull/992>`__ |
| 218 |
- Docs: Add API docs for PyJWK by @luhn in `#980 <https://github.com/jpadilla/pyjwt/pull/980>`__ |
| 219 |
- Docs: Add EdDSA algorithm encoding/decoding usage by @peter279k in `#993 <https://github.com/jpadilla/pyjwt/pull/993>`__ |
| 220 |
- Include checkers and linters for ``pyproject.toml`` in ``pre-commit`` by @cleder in `#1002 <https://github.com/jpadilla/pyjwt/pull/1002>`__ |
| 221 |
- Docs: Add ES256 decoding usage by @Gautam-Hegde in `#1003 <https://github.com/jpadilla/pyjwt/pull/1003>`__ |
| 222 |
|
| 223 |
`v2.9.0 <https://github.com/jpadilla/pyjwt/compare/2.8.0...2.9.0>`__ |
| 224 |
----------------------------------------------------------------------- |
| 225 |
|
| 226 |
Changed |
| 227 |
~~~~~~~ |
| 228 |
|
| 229 |
- Drop support for Python 3.7 (EOL) by @hugovk in `#910 <https://github.com/jpadilla/pyjwt/pull/910>`__ |
| 230 |
- Allow JWT issuer claim validation to accept a list of strings too by @mattpollak in `#913 <https://github.com/jpadilla/pyjwt/pull/913>`__ |
| 231 |
|
| 232 |
Fixed |
| 233 |
~~~~~ |
| 234 |
|
| 235 |
- Fix unnecessary string concatenation by @sirosen in `#904 <https://github.com/jpadilla/pyjwt/pull/904>`__ |
| 236 |
- Fix docs for ``jwt.decode_complete`` to include ``strict_aud`` option by @woodruffw in `#923 <https://github.com/jpadilla/pyjwt/pull/923>`__ |
| 237 |
- Fix docs step by @jpadilla in `#950 <https://github.com/jpadilla/pyjwt/pull/950>`__ |
| 238 |
- Fix: Remove an unused variable from example code block by @kenkoooo in `#958 <https://github.com/jpadilla/pyjwt/pull/958>`__ |
| 239 |
|
| 240 |
Added |
| 241 |
~~~~~ |
| 242 |
|
| 243 |
- Add support for Python 3.12 by @hugovk in `#910 <https://github.com/jpadilla/pyjwt/pull/910>`__ |
| 244 |
- Improve performance of ``is_ssh_key`` + add unit test by @bdraco in `#940 <https://github.com/jpadilla/pyjwt/pull/940>`__ |
| 245 |
- Allow ``jwt.decode()`` to accept a PyJWK object by @luhn in `#886 <https://github.com/jpadilla/pyjwt/pull/886>`__ |
| 246 |
- Make ``algorithm_name`` attribute available on PyJWK by @luhn in `#886 <https://github.com/jpadilla/pyjwt/pull/886>`__ |
| 247 |
- Raise ``InvalidKeyError`` on invalid PEM keys to be compatible with cryptography 42.x.x by @CollinEMac in `#952 <https://github.com/jpadilla/pyjwt/pull/952>`__ |
| 248 |
- Raise an exception when required cryptography dependency is missing by @tobloef in `<https://github.com/jpadilla/pyjwt/pull/963>`__ |
| 249 |
|
| 250 |
`v2.8.0 <https://github.com/jpadilla/pyjwt/compare/2.7.0...2.8.0>`__ |
| 251 |
----------------------------------------------------------------------- |
| 252 |
|
| 253 |
Changed |
| 254 |
~~~~~~~ |
| 255 |
|
| 256 |
- Update python version test matrix by @auvipy in `#895 <https://github.com/jpadilla/pyjwt/pull/895>`__ |
| 257 |
|
| 258 |
Fixed |
| 259 |
~~~~~ |
| 260 |
|
| 261 |
Added |
| 262 |
~~~~~ |
| 263 |
|
| 264 |
- Add ``strict_aud`` as an option to ``jwt.decode`` by @woodruffw in `#902 <https://github.com/jpadilla/pyjwt/pull/902>`__ |
| 265 |
- Export PyJWKClientConnectionError class by @daviddavis in `#887 <https://github.com/jpadilla/pyjwt/pull/887>`__ |
| 266 |
- Allows passing of ssl.SSLContext to PyJWKClient by @juur in `#891 <https://github.com/jpadilla/pyjwt/pull/891>`__ |
| 267 |
|
| 268 |
`v2.7.0 <https://github.com/jpadilla/pyjwt/compare/2.6.0...2.7.0>`__ |
| 269 |
----------------------------------------------------------------------- |
| 270 |
|
| 271 |
Changed |
| 272 |
~~~~~~~ |
| 273 |
|
| 274 |
- Changed the error message when the token audience doesn't match the expected audience by @irdkwmnsb `#809 <https://github.com/jpadilla/pyjwt/pull/809>`__ |
| 275 |
- Improve error messages when cryptography isn't installed by @Viicos in `#846 <https://github.com/jpadilla/pyjwt/pull/846>`__ |
| 276 |
- Make `Algorithm` an abstract base class by @Viicos in `#845 <https://github.com/jpadilla/pyjwt/pull/845>`__ |
| 277 |
- ignore invalid keys in a jwks by @timw6n in `#863 <https://github.com/jpadilla/pyjwt/pull/863>`__ |
| 278 |
|
| 279 |
Fixed |
| 280 |
~~~~~ |
| 281 |
|
| 282 |
- Add classifier for Python 3.11 by @eseifert in `#818 <https://github.com/jpadilla/pyjwt/pull/818>`__ |
| 283 |
- Fix ``_validate_iat`` validation by @Viicos in `#847 <https://github.com/jpadilla/pyjwt/pull/847>`__ |
| 284 |
- fix: use datetime.datetime.timestamp function to have a milliseconds by @daillouf `#821 <https://github.com/jpadilla/pyjwt/pull/821>`__ |
| 285 |
- docs: correct mistake in the changelog about verify param by @gbillig in `#866 <https://github.com/jpadilla/pyjwt/pull/866>`__ |
| 286 |
|
| 287 |
Added |
| 288 |
~~~~~ |
| 289 |
|
| 290 |
- Add ``compute_hash_digest`` as a method of ``Algorithm`` objects, which uses |
| 291 |
the underlying hash algorithm to compute a digest. If there is no appropriate |
| 292 |
hash algorithm, a ``NotImplementedError`` will be raised in `#775 <https://github.com/jpadilla/pyjwt/pull/775>`__ |
| 293 |
- Add optional ``headers`` argument to ``PyJWKClient``. If provided, the headers |
| 294 |
will be included in requests that the client uses when fetching the JWK set by @thundercat1 in `#823 <https://github.com/jpadilla/pyjwt/pull/823>`__ |
| 295 |
- Add PyJWT._{de,en}code_payload hooks by @akx in `#829 <https://github.com/jpadilla/pyjwt/pull/829>`__ |
| 296 |
- Add `sort_headers` parameter to `api_jwt.encode` by @evroon in `#832 <https://github.com/jpadilla/pyjwt/pull/832>`__ |
| 297 |
- Make mypy configuration stricter and improve typing by @akx in `#830 <https://github.com/jpadilla/pyjwt/pull/830>`__ |
| 298 |
- Add more types by @Viicos in `#843 <https://github.com/jpadilla/pyjwt/pull/843>`__ |
| 299 |
- Add a timeout for PyJWKClient requests by @daviddavis in `#875 <https://github.com/jpadilla/pyjwt/pull/875>`__ |
| 300 |
- Add client connection error exception by @daviddavis in `#876 <https://github.com/jpadilla/pyjwt/pull/876>`__ |
| 301 |
- Add complete types to take all allowed keys into account by @Viicos in `#873 <https://github.com/jpadilla/pyjwt/pull/873>`__ |
| 302 |
- Add `as_dict` option to `Algorithm.to_jwk` by @fluxth in `#881 <https://github.com/jpadilla/pyjwt/pull/881>`__ |
| 303 |
|
| 304 |
|
| 305 |
`v2.6.0 <https://github.com/jpadilla/pyjwt/compare/2.5.0...2.6.0>`__ |
| 306 |
----------------------------------------------------------------------- |
| 307 |
|
| 308 |
Changed |
| 309 |
~~~~~~~ |
| 310 |
|
| 311 |
- bump up cryptography >= 3.4.0 by @jpadilla in `#807 <https://github.com/jpadilla/pyjwt/pull/807>`__ |
| 312 |
- Remove `types-cryptography` from `crypto` extra by @lautat in `#805 <https://github.com/jpadilla/pyjwt/pull/805>`__ |
| 313 |
|
| 314 |
Fixed |
| 315 |
~~~~~ |
| 316 |
|
| 317 |
- Invalidate token on the exact second the token expires `#797 <https://github.com/jpadilla/pyjwt/pull/797>`__ |
| 318 |
- fix: version 2.5.0 heading typo by @c0state in `#803 <https://github.com/jpadilla/pyjwt/pull/803>`__ |
| 319 |
|
| 320 |
Added |
| 321 |
~~~~~ |
| 322 |
- Adding validation for `issued_at` when `iat > (now + leeway)` as `ImmatureSignatureError` by @sriharan16 in `#794 <https://github.com/jpadilla/pyjwt/pull/794>`__ |
| 323 |
|
| 324 |
`v2.5.0 <https://github.com/jpadilla/pyjwt/compare/2.4.0...2.5.0>`__ |
| 325 |
----------------------------------------------------------------------- |
| 326 |
|
| 327 |
Changed |
| 328 |
~~~~~~~ |
| 329 |
|
| 330 |
- Skip keys with incompatible alg when loading JWKSet by @DaGuich in `#762 <https://github.com/jpadilla/pyjwt/pull/762>`__ |
| 331 |
- Remove support for python3.6 by @sirosen in `#777 <https://github.com/jpadilla/pyjwt/pull/777>`__ |
| 332 |
- Emit a deprecation warning for unsupported kwargs by @sirosen in `#776 <https://github.com/jpadilla/pyjwt/pull/776>`__ |
| 333 |
- Remove redundant wheel dep from pyproject.toml by @mgorny in `#765 <https://github.com/jpadilla/pyjwt/pull/765>`__ |
| 334 |
- Do not fail when an unusable key occurs by @DaGuich in `#762 <https://github.com/jpadilla/pyjwt/pull/762>`__ |
| 335 |
- Update audience typing by @JulianMaurin in `#782 <https://github.com/jpadilla/pyjwt/pull/782>`__ |
| 336 |
- Improve PyJWKSet error accuracy by @JulianMaurin in `#786 <https://github.com/jpadilla/pyjwt/pull/786>`__ |
| 337 |
- Mypy as pre-commit check + api_jws typing by @JulianMaurin in `#787 <https://github.com/jpadilla/pyjwt/pull/787>`__ |
| 338 |
|
| 339 |
Fixed |
| 340 |
~~~~~ |
| 341 |
|
| 342 |
- Adjust expected exceptions in option merging tests for PyPy3 by @mgorny in `#763 <https://github.com/jpadilla/pyjwt/pull/763>`__ |
| 343 |
- Fixes for pyright on strict mode by @brandon-leapyear in `#747 <https://github.com/jpadilla/pyjwt/pull/747>`__ |
| 344 |
- docs: fix simple typo, iinstance -> isinstance by @timgates42 in `#774 <https://github.com/jpadilla/pyjwt/pull/774>`__ |
| 345 |
- Fix typo: priot -> prior by @jdufresne in `#780 <https://github.com/jpadilla/pyjwt/pull/780>`__ |
| 346 |
- Fix for headers disorder issue by @kadabusha in `#721 <https://github.com/jpadilla/pyjwt/pull/721>`__ |
| 347 |
|
| 348 |
Added |
| 349 |
~~~~~ |
| 350 |
|
| 351 |
- Add to_jwk static method to ECAlgorithm by @leonsmith in `#732 <https://github.com/jpadilla/pyjwt/pull/732>`__ |
| 352 |
- Expose get_algorithm_by_name as new method by @sirosen in `#773 <https://github.com/jpadilla/pyjwt/pull/773>`__ |
| 353 |
- Add type hints to jwt/help.py and add missing types dependency by @kkirsche in `#784 <https://github.com/jpadilla/pyjwt/pull/784>`__ |
| 354 |
- Add cacheing functionality for JWK set by @wuhaoyujerry in `#781 <https://github.com/jpadilla/pyjwt/pull/781>`__ |
| 355 |
|
| 356 |
`v2.4.0 <https://github.com/jpadilla/pyjwt/compare/2.3.0...2.4.0>`__ |
| 357 |
----------------------------------------------------------------------- |
| 358 |
|
| 359 |
Security |
| 360 |
~~~~~~~~ |
| 361 |
|
| 362 |
- [CVE-2022-29217] Prevent key confusion through non-blocklisted public key formats. https://github.com/jpadilla/pyjwt/security/advisories/GHSA-ffqj-6fqr-9h24 |
| 363 |
|
| 364 |
Changed |
| 365 |
~~~~~~~ |
| 366 |
|
| 367 |
- Explicit check the key for ECAlgorithm by @estin in `#713 <https://github.com/jpadilla/pyjwt/pull/713>`__ |
| 368 |
- Raise DeprecationWarning for jwt.decode(verify=...) by @akx in `#742 <https://github.com/jpadilla/pyjwt/pull/742>`__ |
| 369 |
|
| 370 |
Fixed |
| 371 |
~~~~~ |
| 372 |
|
| 373 |
- Don't use implicit optionals by @rekyungmin in `#705 <https://github.com/jpadilla/pyjwt/pull/705>`__ |
| 374 |
- documentation fix: show correct scope for decode_complete() by @sseering in `#661 <https://github.com/jpadilla/pyjwt/pull/661>`__ |
| 375 |
- fix: Update copyright information by @kkirsche in `#729 <https://github.com/jpadilla/pyjwt/pull/729>`__ |
| 376 |
- Don't mutate options dictionary in .decode_complete() by @akx in `#743 <https://github.com/jpadilla/pyjwt/pull/743>`__ |
| 377 |
|
| 378 |
Added |
| 379 |
~~~~~ |
| 380 |
|
| 381 |
- Add support for Python 3.10 by @hugovk in `#699 <https://github.com/jpadilla/pyjwt/pull/699>`__ |
| 382 |
- api_jwk: Add PyJWKSet.__getitem__ by @woodruffw in `#725 <https://github.com/jpadilla/pyjwt/pull/725>`__ |
| 383 |
- Update usage.rst by @guneybilen in `#727 <https://github.com/jpadilla/pyjwt/pull/727>`__ |
| 384 |
- Docs: mention performance reasons for reusing RSAPrivateKey when encoding by @dmahr1 in `#734 <https://github.com/jpadilla/pyjwt/pull/734>`__ |
| 385 |
- Fixed typo in usage.rst by @israelabraham in `#738 <https://github.com/jpadilla/pyjwt/pull/738>`__ |
| 386 |
- Add detached payload support for JWS encoding and decoding by @fviard in `#723 <https://github.com/jpadilla/pyjwt/pull/723>`__ |
| 387 |
- Replace various string interpolations with f-strings by @akx in `#744 <https://github.com/jpadilla/pyjwt/pull/744>`__ |
| 388 |
- Update CHANGELOG.rst by @hipertracker in `#751 <https://github.com/jpadilla/pyjwt/pull/751>`__ |
| 389 |
|
| 390 |
`v2.3.0 <https://github.com/jpadilla/pyjwt/compare/2.2.0...2.3.0>`__ |
| 391 |
----------------------------------------------------------------------- |
| 392 |
|
| 393 |
Fixed |
| 394 |
~~~~~ |
| 395 |
|
| 396 |
- Revert "Remove arbitrary kwargs." `#701 <https://github.com/jpadilla/pyjwt/pull/701>`__ |
| 397 |
|
| 398 |
Added |
| 399 |
~~~~~ |
| 400 |
|
| 401 |
- Add exception chaining `#702 <https://github.com/jpadilla/pyjwt/pull/702>`__ |
| 402 |
|
| 403 |
`v2.2.0 <https://github.com/jpadilla/pyjwt/compare/2.1.0...2.2.0>`__ |
| 404 |
----------------------------------------------------------------------- |
| 405 |
|
| 406 |
Changed |
| 407 |
~~~~~~~ |
| 408 |
|
| 409 |
- Remove arbitrary kwargs. `#657 <https://github.com/jpadilla/pyjwt/pull/657>`__ |
| 410 |
- Use timezone package as Python 3.5+ is required. `#694 <https://github.com/jpadilla/pyjwt/pull/694>`__ |
| 411 |
|
| 412 |
Fixed |
| 413 |
~~~~~ |
| 414 |
- Assume JWK without the "use" claim is valid for signing as per RFC7517 `#668 <https://github.com/jpadilla/pyjwt/pull/668>`__ |
| 415 |
- Prefer `headers["alg"]` to `algorithm` in `jwt.encode()`. `#673 <https://github.com/jpadilla/pyjwt/pull/673>`__ |
| 416 |
- Fix aud validation to support {'aud': null} case. `#670 <https://github.com/jpadilla/pyjwt/pull/670>`__ |
| 417 |
- Make `typ` optional in JWT to be compliant with RFC7519. `#644 <https://github.com/jpadilla/pyjwt/pull/644>`__ |
| 418 |
- Remove upper bound on cryptography version. `#693 <https://github.com/jpadilla/pyjwt/pull/693>`__ |
| 419 |
|
| 420 |
Added |
| 421 |
~~~~~ |
| 422 |
|
| 423 |
- Add support for Ed448/EdDSA. `#675 <https://github.com/jpadilla/pyjwt/pull/675>`__ |
| 424 |
|
| 425 |
`v2.1.0 <https://github.com/jpadilla/pyjwt/compare/2.0.1...2.1.0>`__ |
| 426 |
-------------------------------------------------------------------- |
| 427 |
|
| 428 |
Changed |
| 429 |
~~~~~~~ |
| 430 |
|
| 431 |
- Allow claims validation without making JWT signature validation mandatory. `#608 <https://github.com/jpadilla/pyjwt/pull/608>`__ |
| 432 |
|
| 433 |
Fixed |
| 434 |
~~~~~ |
| 435 |
|
| 436 |
- Remove padding from JWK test data. `#628 <https://github.com/jpadilla/pyjwt/pull/628>`__ |
| 437 |
- Make `kty` mandatory in JWK to be compliant with RFC7517. `#624 <https://github.com/jpadilla/pyjwt/pull/624>`__ |
| 438 |
- Allow JWK without `alg` to be compliant with RFC7517. `#624 <https://github.com/jpadilla/pyjwt/pull/624>`__ |
| 439 |
- Allow to verify with private key on ECAlgorithm, as well as on Ed25519Algorithm. `#645 <https://github.com/jpadilla/pyjwt/pull/645>`__ |
| 440 |
|
| 441 |
Added |
| 442 |
~~~~~ |
| 443 |
|
| 444 |
- Add caching by default to PyJWKClient `#611 <https://github.com/jpadilla/pyjwt/pull/611>`__ |
| 445 |
- Add missing exceptions.InvalidKeyError to jwt module __init__ imports `#620 <https://github.com/jpadilla/pyjwt/pull/620>`__ |
| 446 |
- Add support for ES256K algorithm `#629 <https://github.com/jpadilla/pyjwt/pull/629>`__ |
| 447 |
- Add `from_jwk()` to Ed25519Algorithm `#621 <https://github.com/jpadilla/pyjwt/pull/621>`__ |
| 448 |
- Add `to_jwk()` to Ed25519Algorithm `#643 <https://github.com/jpadilla/pyjwt/pull/643>`__ |
| 449 |
- Export `PyJWK` and `PyJWKSet` `#652 <https://github.com/jpadilla/pyjwt/pull/652>`__ |
| 450 |
|
| 451 |
`v2.0.1 <https://github.com/jpadilla/pyjwt/compare/2.0.0...2.0.1>`__ |
| 452 |
-------------------------------------------------------------------- |
| 453 |
|
| 454 |
Changed |
| 455 |
~~~~~~~ |
| 456 |
|
| 457 |
- Rename CHANGELOG.md to CHANGELOG.rst and include in docs `#597 <https://github.com/jpadilla/pyjwt/pull/597>`__ |
| 458 |
|
| 459 |
Fixed |
| 460 |
~~~~~ |
| 461 |
|
| 462 |
- Fix `from_jwk()` for all algorithms `#598 <https://github.com/jpadilla/pyjwt/pull/598>`__ |
| 463 |
|
| 464 |
Added |
| 465 |
~~~~~ |
| 466 |
|
| 467 |
`v2.0.0 <https://github.com/jpadilla/pyjwt/compare/1.7.1...2.0.0>`__ |
| 468 |
-------------------------------------------------------------------- |
| 469 |
|
| 470 |
Changed |
| 471 |
~~~~~~~ |
| 472 |
|
| 473 |
Drop support for Python 2 and Python 3.0-3.5 |
| 474 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 475 |
|
| 476 |
Python 3.5 is EOL so we decide to drop its support. Version ``1.7.1`` is |
| 477 |
the last one supporting Python 3.0-3.5. |
| 478 |
|
| 479 |
Require cryptography >= 3 |
| 480 |
^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 481 |
|
| 482 |
Drop support for PyCrypto and ECDSA |
| 483 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 484 |
|
| 485 |
We've kept this around for a long time, mostly for environments that |
| 486 |
didn't allow installing cryptography. |
| 487 |
|
| 488 |
Drop CLI |
| 489 |
^^^^^^^^ |
| 490 |
|
| 491 |
Dropped the included cli entry point. |
| 492 |
|
| 493 |
Improve typings |
| 494 |
^^^^^^^^^^^^^^^ |
| 495 |
|
| 496 |
We no longer need to use mypy Python 2 compatibility mode (comments) |
| 497 |
|
| 498 |
``jwt.encode(...)`` return type |
| 499 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 500 |
|
| 501 |
Tokens are returned as string instead of a byte string |
| 502 |
|
| 503 |
Dropped deprecated errors |
| 504 |
^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 505 |
|
| 506 |
Removed ``ExpiredSignature``, ``InvalidAudience``, and |
| 507 |
``InvalidIssuer``. Use ``ExpiredSignatureError``, |
| 508 |
``InvalidAudienceError``, and ``InvalidIssuerError`` instead. |
| 509 |
|
| 510 |
Dropped deprecated ``verify_expiration`` param in ``jwt.decode(...)`` |
| 511 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 512 |
|
| 513 |
Use |
| 514 |
``jwt.decode(encoded, key, algorithms=["HS256"], options={"verify_exp": False})`` |
| 515 |
instead. |
| 516 |
|
| 517 |
Dropped deprecated ``verify`` param in ``jwt.decode(...)`` |
| 518 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 519 |
|
| 520 |
Use ``jwt.decode(encoded, key, options={"verify_signature": False})`` |
| 521 |
instead. |
| 522 |
|
| 523 |
Require explicit ``algorithms`` in ``jwt.decode(...)`` by default |
| 524 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 525 |
|
| 526 |
Example: ``jwt.decode(encoded, key, algorithms=["HS256"])``. |
| 527 |
|
| 528 |
Dropped deprecated ``require_*`` options in ``jwt.decode(...)`` |
| 529 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 530 |
|
| 531 |
For example, instead of |
| 532 |
``jwt.decode(encoded, key, algorithms=["HS256"], options={"require_exp": True})``, |
| 533 |
use |
| 534 |
``jwt.decode(encoded, key, algorithms=["HS256"], options={"require": ["exp"]})``. |
| 535 |
|
| 536 |
And the old v1.x syntax |
| 537 |
``jwt.decode(token, verify=False)`` |
| 538 |
is now: |
| 539 |
``jwt.decode(jwt=token, key='secret', algorithms=['HS256'], options={"verify_signature": False})`` |
| 540 |
|
| 541 |
Added |
| 542 |
~~~~~ |
| 543 |
|
| 544 |
Introduce better experience for JWKs |
| 545 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 546 |
|
| 547 |
Introduce ``PyJWK``, ``PyJWKSet``, and ``PyJWKClient``. |
| 548 |
|
| 549 |
.. code:: python |
| 550 |
|
| 551 |
import jwt |
| 552 |
from jwt import PyJWKClient |
| 553 |
|
| 554 |
token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Ik5FRTFRVVJCT1RNNE16STVSa0ZETlRZeE9UVTFNRGcyT0Rnd1EwVXpNVGsxUWpZeVJrUkZRdyJ9.eyJpc3MiOiJodHRwczovL2Rldi04N2V2eDlydS5hdXRoMC5jb20vIiwic3ViIjoiYVc0Q2NhNzl4UmVMV1V6MGFFMkg2a0QwTzNjWEJWdENAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vZXhwZW5zZXMtYXBpIiwiaWF0IjoxNTcyMDA2OTU0LCJleHAiOjE1NzIwMDY5NjQsImF6cCI6ImFXNENjYTc5eFJlTFdVejBhRTJINmtEME8zY1hCVnRDIiwiZ3R5IjoiY2xpZW50LWNyZWRlbnRpYWxzIn0.PUxE7xn52aTCohGiWoSdMBZGiYAHwE5FYie0Y1qUT68IHSTXwXVd6hn02HTah6epvHHVKA2FqcFZ4GGv5VTHEvYpeggiiZMgbxFrmTEY0csL6VNkX1eaJGcuehwQCRBKRLL3zKmA5IKGy5GeUnIbpPHLHDxr-GXvgFzsdsyWlVQvPX2xjeaQ217r2PtxDeqjlf66UYl6oY6AqNS8DH3iryCvIfCcybRZkc_hdy-6ZMoKT6Piijvk_aXdm7-QQqKJFHLuEqrVSOuBqqiNfVrG27QzAPuPOxvfXTVLXL2jek5meH6n-VWgrBdoMFH93QEszEDowDAEhQPHVs0xj7SIzA" |
| 555 |
kid = "NEE1QURBOTM4MzI5RkFDNTYxOTU1MDg2ODgwQ0UzMTk1QjYyRkRFQw" |
| 556 |
url = "https://dev-87evx9ru.auth0.com/.well-known/jwks.json" |
| 557 |
|
| 558 |
jwks_client = PyJWKClient(url) |
| 559 |
signing_key = jwks_client.get_signing_key_from_jwt(token) |
| 560 |
|
| 561 |
data = jwt.decode( |
| 562 |
token, |
| 563 |
signing_key.key, |
| 564 |
algorithms=["RS256"], |
| 565 |
audience="https://expenses-api", |
| 566 |
options={"verify_exp": False}, |
| 567 |
) |
| 568 |
print(data) |
| 569 |
|
| 570 |
Support for JWKs containing ECDSA keys |
| 571 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 572 |
|
| 573 |
Add support for Ed25519 / EdDSA |
| 574 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 575 |
|
| 576 |
Pull Requests |
| 577 |
~~~~~~~~~~~~~ |
| 578 |
|
| 579 |
- Add PyPy3 to the test matrix (#550) by @jdufresne |
| 580 |
- Require tweak (#280) by @psafont |
| 581 |
- Decode return type is dict[str, Any] (#393) by @jacopofar |
| 582 |
- Fix linter error in test\_cli (#414) by @jaraco |
| 583 |
- Run mypy with tox (#421) by @jpadilla |
| 584 |
- Document (and prefer) pyjwt[crypto] req format (#426) by @gthb |
| 585 |
- Correct type for json\_encoder argument (#438) by @jdufresne |
| 586 |
- Prefer https:// links where available (#439) by @jdufresne |
| 587 |
- Pass python\_requires argument to setuptools (#440) by @jdufresne |
| 588 |
- Rename [wheel] section to [bdist\_wheel] as the former is legacy |
| 589 |
(#441) by @jdufresne |
| 590 |
- Remove setup.py test command in favor of pytest and tox (#442) by |
| 591 |
@jdufresne |
| 592 |
- Fix mypy errors (#449) by @jpadilla |
| 593 |
- DX Tweaks (#450) by @jpadilla |
| 594 |
- Add support of python 3.8 (#452) by @Djailla |
| 595 |
- Fix 406 (#454) by @justinbaur |
| 596 |
- Add support for Ed25519 / EdDSA, with unit tests (#455) by |
| 597 |
@Someguy123 |
| 598 |
- Remove Python 2.7 compatibility (#457) by @Djailla |
| 599 |
- Fix simple typo: encododed -> encoded (#462) by @timgates42 |
| 600 |
- Enhance tracebacks. (#477) by @JulienPalard |
| 601 |
- Simplify ``python_requires`` (#478) by @michael-k |
| 602 |
- Document top-level .encode and .decode to close #459 (#482) by |
| 603 |
@dimaqq |
| 604 |
- Improve documentation for audience usage (#484) by @CorreyL |
| 605 |
- Correct README on how to run tests locally (#489) by @jdufresne |
| 606 |
- Fix ``tox -e lint`` warnings and errors (#490) by @jdufresne |
| 607 |
- Run pyupgrade across project to use modern Python 3 conventions |
| 608 |
(#491) by @jdufresne |
| 609 |
- Add Python-3-only trove classifier and remove "universal" from wheel |
| 610 |
(#492) by @jdufresne |
| 611 |
- Emit warnings about user code, not pyjwt code (#494) by @mgedmin |
| 612 |
- Move setup information to declarative setup.cfg (#495) by @jdufresne |
| 613 |
- CLI options for verifying audience and issuer (#496) by |
| 614 |
@GeoffRichards |
| 615 |
- Specify the target Python version for mypy (#497) by @jdufresne |
| 616 |
- Remove unnecessary compatibility shims for Python 2 (#498) by |
| 617 |
@jdufresne |
| 618 |
- Setup GH Actions (#499) by @jpadilla |
| 619 |
- Implementation of ECAlgorithm.from\_jwk (#500) by @jpadilla |
| 620 |
- Remove cli entry point (#501) by @jpadilla |
| 621 |
- Expose InvalidKeyError on jwt module (#503) by @russellcardullo |
| 622 |
- Avoid loading token twice in pyjwt.decode (#506) by @CaselIT |
| 623 |
- Default links to stable version of documentation (#508) by @salcedo |
| 624 |
- Update README.md badges (#510) by @jpadilla |
| 625 |
- Introduce better experience for JWKs (#511) by @jpadilla |
| 626 |
- Fix tox conditional extras (#512) by @jpadilla |
| 627 |
- Return tokens as string not bytes (#513) by @jpadilla |
| 628 |
- Drop support for legacy contrib algorithms (#514) by @jpadilla |
| 629 |
- Drop deprecation warnings (#515) by @jpadilla |
| 630 |
- Update Auth0 sponsorship link (#519) by @Sambego |
| 631 |
- Update return type for jwt.encode (#521) by @moomoolive |
| 632 |
- Run tests against Python 3.9 and add trove classifier (#522) by |
| 633 |
@michael-k |
| 634 |
- Removed redundant ``default_backend()`` (#523) by @rohitkg98 |
| 635 |
- Documents how to use private keys with passphrases (#525) by @rayluo |
| 636 |
- Update version to 2.0.0a1 (#528) by @jpadilla |
| 637 |
- Fix usage example (#530) by @nijel |
| 638 |
- add EdDSA to docs (#531) by @CircleOnCircles |
| 639 |
- Remove support for EOL Python 3.5 (#532) by @jdufresne |
| 640 |
- Upgrade to isort 5 and adjust configurations (#533) by @jdufresne |
| 641 |
- Remove unused argument "verify" from PyJWS.decode() (#534) by |
| 642 |
@jdufresne |
| 643 |
- Update typing syntax and usage for Python 3.6+ (#535) by @jdufresne |
| 644 |
- Run pyupgrade to simplify code and use Python 3.6 syntax (#536) by |
| 645 |
@jdufresne |
| 646 |
- Drop unknown pytest config option: strict (#537) by @jdufresne |
| 647 |
- Upgrade black version and usage (#538) by @jdufresne |
| 648 |
- Remove "Command line" sections from docs (#539) by @jdufresne |
| 649 |
- Use existing key\_path() utility function throughout tests (#540) by |
| 650 |
@jdufresne |
| 651 |
- Replace force\_bytes()/force\_unicode() in tests with literals (#541) |
| 652 |
by @jdufresne |
| 653 |
- Remove unnecessary Unicode decoding before json.loads() (#542) by |
| 654 |
@jdufresne |
| 655 |
- Remove unnecessary force\_bytes() calls prior to base64url\_decode() |
| 656 |
(#543) by @jdufresne |
| 657 |
- Remove deprecated arguments from docs (#544) by @jdufresne |
| 658 |
- Update code blocks in docs (#545) by @jdufresne |
| 659 |
- Refactor jwt/jwks\_client.py without requests dependency (#546) by |
| 660 |
@jdufresne |
| 661 |
- Tighten bytes/str boundaries and remove unnecessary coercing (#547) |
| 662 |
by @jdufresne |
| 663 |
- Replace codecs.open() with builtin open() (#548) by @jdufresne |
| 664 |
- Replace int\_from\_bytes() with builtin int.from\_bytes() (#549) by |
| 665 |
@jdufresne |
| 666 |
- Enforce .encode() return type using mypy (#551) by @jdufresne |
| 667 |
- Prefer direct indexing over options.get() (#552) by @jdufresne |
| 668 |
- Cleanup "noqa" comments (#553) by @jdufresne |
| 669 |
- Replace merge\_dict() with builtin dict unpacking generalizations |
| 670 |
(#555) by @jdufresne |
| 671 |
- Do not mutate the input payload in PyJWT.encode() (#557) by |
| 672 |
@jdufresne |
| 673 |
- Use direct indexing in PyJWKClient.get\_signing\_key\_from\_jwt() |
| 674 |
(#558) by @jdufresne |
| 675 |
- Split PyJWT/PyJWS classes to tighten type interfaces (#559) by |
| 676 |
@jdufresne |
| 677 |
- Simplify mocked\_response test utility function (#560) by @jdufresne |
| 678 |
- Autoupdate pre-commit hooks and apply them (#561) by @jdufresne |
| 679 |
- Remove unused argument "payload" from PyJWS.\ *verify*\ signature() |
| 680 |
(#562) by @jdufresne |
| 681 |
- Add utility functions to assist test skipping (#563) by @jdufresne |
| 682 |
- Type hint jwt.utils module (#564) by @jdufresne |
| 683 |
- Prefer ModuleNotFoundError over ImportError (#565) by @jdufresne |
| 684 |
- Fix tox "manifest" environment to pass (#566) by @jdufresne |
| 685 |
- Fix tox "docs" environment to pass (#567) by @jdufresne |
| 686 |
- Simplify black configuration to be closer to upstream defaults (#568) |
| 687 |
by @jdufresne |
| 688 |
- Use generator expressions (#569) by @jdufresne |
| 689 |
- Simplify from\_base64url\_uint() (#570) by @jdufresne |
| 690 |
- Drop lint environment from GitHub actions in favor of pre-commit.ci |
| 691 |
(#571) by @jdufresne |
| 692 |
- [pre-commit.ci] pre-commit autoupdate (#572) |
| 693 |
- Simplify tox configuration (#573) by @jdufresne |
| 694 |
- Combine identical test functions using pytest.mark.parametrize() |
| 695 |
(#574) by @jdufresne |
| 696 |
- Complete type hinting of jwks\_client.py (#578) by @jdufresne |
| 697 |
|
| 698 |
`v1.7.1 <https://github.com/jpadilla/pyjwt/compare/1.7.0...1.7.1>`__ |
| 699 |
-------------------------------------------------------------------- |
| 700 |
|
| 701 |
Fixed |
| 702 |
~~~~~ |
| 703 |
|
| 704 |
- Update test dependencies with pinned ranges |
| 705 |
- Fix pytest deprecation warnings |
| 706 |
|
| 707 |
`v1.7.0 <https://github.com/jpadilla/pyjwt/compare/1.6.4...1.7.0>`__ |
| 708 |
-------------------------------------------------------------------- |
| 709 |
|
| 710 |
Changed |
| 711 |
~~~~~~~ |
| 712 |
|
| 713 |
- Remove CRLF line endings |
| 714 |
`#353 <https://github.com/jpadilla/pyjwt/pull/353>`__ |
| 715 |
|
| 716 |
Fixed |
| 717 |
~~~~~ |
| 718 |
|
| 719 |
- Update usage.rst |
| 720 |
`#360 <https://github.com/jpadilla/pyjwt/pull/360>`__ |
| 721 |
|
| 722 |
Added |
| 723 |
~~~~~ |
| 724 |
|
| 725 |
- Support for Python 3.7 |
| 726 |
`#375 <https://github.com/jpadilla/pyjwt/pull/375>`__ |
| 727 |
`#379 <https://github.com/jpadilla/pyjwt/pull/379>`__ |
| 728 |
`#384 <https://github.com/jpadilla/pyjwt/pull/384>`__ |
| 729 |
|
| 730 |
`v1.6.4 <https://github.com/jpadilla/pyjwt/compare/1.6.3...1.6.4>`__ |
| 731 |
-------------------------------------------------------------------- |
| 732 |
|
| 733 |
Fixed |
| 734 |
~~~~~ |
| 735 |
|
| 736 |
- Reverse an unintentional breaking API change to .decode() |
| 737 |
`#352 <https://github.com/jpadilla/pyjwt/pull/352>`__ |
| 738 |
|
| 739 |
`v1.6.3 <https://github.com/jpadilla/pyjwt/compare/1.6.1...1.6.3>`__ |
| 740 |
-------------------------------------------------------------------- |
| 741 |
|
| 742 |
Changed |
| 743 |
~~~~~~~ |
| 744 |
|
| 745 |
- All exceptions inherit from PyJWTError |
| 746 |
`#340 <https://github.com/jpadilla/pyjwt/pull/340>`__ |
| 747 |
|
| 748 |
Added |
| 749 |
~~~~~ |
| 750 |
|
| 751 |
- Add type hints `#344 <https://github.com/jpadilla/pyjwt/pull/344>`__ |
| 752 |
- Add help module |
| 753 |
`7ca41e <https://github.com/jpadilla/pyjwt/commit/7ca41e53b3d7d9f5cd31bdd8a2b832d192006239>`__ |
| 754 |
|
| 755 |
Docs |
| 756 |
~~~~ |
| 757 |
|
| 758 |
- Added section to usage docs for jwt.get\_unverified\_header() |
| 759 |
`#350 <https://github.com/jpadilla/pyjwt/pull/350>`__ |
| 760 |
- Update legacy instructions for using pycrypto |
| 761 |
`#337 <https://github.com/jpadilla/pyjwt/pull/337>`__ |
| 762 |
|
| 763 |
`v1.6.1 <https://github.com/jpadilla/pyjwt/compare/1.6.0...1.6.1>`__ |
| 764 |
-------------------------------------------------------------------- |
| 765 |
|
| 766 |
Fixed |
| 767 |
~~~~~ |
| 768 |
|
| 769 |
- Audience parameter throws ``InvalidAudienceError`` when application |
| 770 |
does not specify an audience, but the token does. |
| 771 |
`#336 <https://github.com/jpadilla/pyjwt/pull/336>`__ |
| 772 |
|
| 773 |
`v1.6.0 <https://github.com/jpadilla/pyjwt/compare/1.5.3...1.6.0>`__ |
| 774 |
-------------------------------------------------------------------- |
| 775 |
|
| 776 |
Changed |
| 777 |
~~~~~~~ |
| 778 |
|
| 779 |
- Dropped support for python 2.6 and 3.3 |
| 780 |
`#301 <https://github.com/jpadilla/pyjwt/pull/301>`__ |
| 781 |
- An invalid signature now raises an ``InvalidSignatureError`` instead |
| 782 |
of ``DecodeError`` |
| 783 |
`#316 <https://github.com/jpadilla/pyjwt/pull/316>`__ |
| 784 |
|
| 785 |
Fixed |
| 786 |
~~~~~ |
| 787 |
|
| 788 |
- Fix over-eager fallback to stdin |
| 789 |
`#304 <https://github.com/jpadilla/pyjwt/pull/304>`__ |
| 790 |
|
| 791 |
Added |
| 792 |
~~~~~ |
| 793 |
|
| 794 |
- Audience parameter now supports iterables |
| 795 |
`#306 <https://github.com/jpadilla/pyjwt/pull/306>`__ |
| 796 |
|
| 797 |
`v1.5.3 <https://github.com/jpadilla/pyjwt/compare/1.5.2...1.5.3>`__ |
| 798 |
-------------------------------------------------------------------- |
| 799 |
|
| 800 |
Changed |
| 801 |
~~~~~~~ |
| 802 |
|
| 803 |
- Increase required version of the cryptography package to >=1.4.0. |
| 804 |
|
| 805 |
Fixed |
| 806 |
~~~~~ |
| 807 |
|
| 808 |
- Remove uses of deprecated functions from the cryptography package. |
| 809 |
- Warn about missing ``algorithms`` param to ``decode()`` only when |
| 810 |
``verify`` param is ``True`` |
| 811 |
`#281 <https://github.com/jpadilla/pyjwt/pull/281>`__ |
| 812 |
|
| 813 |
`v1.5.2 <https://github.com/jpadilla/pyjwt/compare/1.5.1...1.5.2>`__ |
| 814 |
-------------------------------------------------------------------- |
| 815 |
|
| 816 |
Fixed |
| 817 |
~~~~~ |
| 818 |
|
| 819 |
- Ensure correct arguments order in decode super call |
| 820 |
`7c1e61d <https://github.com/jpadilla/pyjwt/commit/7c1e61dde27bafe16e7d1bb6e35199e778962742>`__ |
| 821 |
|
| 822 |
`v1.5.1 <https://github.com/jpadilla/pyjwt/compare/1.5.0...1.5.1>`__ |
| 823 |
-------------------------------------------------------------------- |
| 824 |
|
| 825 |
Changed |
| 826 |
~~~~~~~ |
| 827 |
|
| 828 |
- Change optparse for argparse. |
| 829 |
`#238 <https://github.com/jpadilla/pyjwt/pull/238>`__ |
| 830 |
|
| 831 |
Fixed |
| 832 |
~~~~~ |
| 833 |
|
| 834 |
- Guard against PKCS1 PEM encoded public keys |
| 835 |
`#277 <https://github.com/jpadilla/pyjwt/pull/277>`__ |
| 836 |
- Add deprecation warning when decoding without specifying |
| 837 |
``algorithms`` `#277 <https://github.com/jpadilla/pyjwt/pull/277>`__ |
| 838 |
- Improve deprecation messages |
| 839 |
`#270 <https://github.com/jpadilla/pyjwt/pull/270>`__ |
| 840 |
- PyJWT.decode: move verify param into options |
| 841 |
`#271 <https://github.com/jpadilla/pyjwt/pull/271>`__ |
| 842 |
|
| 843 |
Added |
| 844 |
~~~~~ |
| 845 |
|
| 846 |
- Support for Python 3.6 |
| 847 |
`#262 <https://github.com/jpadilla/pyjwt/pull/262>`__ |
| 848 |
- Expose jwt.InvalidAlgorithmError |
| 849 |
`#264 <https://github.com/jpadilla/pyjwt/pull/264>`__ |
| 850 |
|
| 851 |
`v1.5.0 <https://github.com/jpadilla/pyjwt/compare/1.4.2...1.5.0>`__ |
| 852 |
-------------------------------------------------------------------- |
| 853 |
|
| 854 |
Changed |
| 855 |
~~~~~~~ |
| 856 |
|
| 857 |
- Add support for ECDSA public keys in RFC 4253 (OpenSSH) format |
| 858 |
`#244 <https://github.com/jpadilla/pyjwt/pull/244>`__ |
| 859 |
- Renamed commandline script ``jwt`` to ``jwt-cli`` to avoid issues |
| 860 |
with the script clobbering the ``jwt`` module in some circumstances. |
| 861 |
`#187 <https://github.com/jpadilla/pyjwt/pull/187>`__ |
| 862 |
- Better error messages when using an algorithm that requires the |
| 863 |
cryptography package, but it isn't available |
| 864 |
`#230 <https://github.com/jpadilla/pyjwt/pull/230>`__ |
| 865 |
- Tokens with future 'iat' values are no longer rejected |
| 866 |
`#190 <https://github.com/jpadilla/pyjwt/pull/190>`__ |
| 867 |
- Non-numeric 'iat' values now raise InvalidIssuedAtError instead of |
| 868 |
DecodeError |
| 869 |
- Remove rejection of future 'iat' claims |
| 870 |
`#252 <https://github.com/jpadilla/pyjwt/pull/252>`__ |
| 871 |
|
| 872 |
Fixed |
| 873 |
~~~~~ |
| 874 |
|
| 875 |
- Add back 'ES512' for backward compatibility (for now) |
| 876 |
`#225 <https://github.com/jpadilla/pyjwt/pull/225>`__ |
| 877 |
- Fix incorrectly named ECDSA algorithm |
| 878 |
`#219 <https://github.com/jpadilla/pyjwt/pull/219>`__ |
| 879 |
- Fix rpm build `#196 <https://github.com/jpadilla/pyjwt/pull/196>`__ |
| 880 |
|
| 881 |
Added |
| 882 |
~~~~~ |
| 883 |
|
| 884 |
- Add JWK support for HMAC and RSA keys |
| 885 |
`#202 <https://github.com/jpadilla/pyjwt/pull/202>`__ |
| 886 |
|
| 887 |
`v1.4.2 <https://github.com/jpadilla/pyjwt/compare/1.4.1...1.4.2>`__ |
| 888 |
-------------------------------------------------------------------- |
| 889 |
|
| 890 |
Fixed |
| 891 |
~~~~~ |
| 892 |
|
| 893 |
- A PEM-formatted key encoded as bytes could cause a ``TypeError`` to |
| 894 |
be raised `#213 <https://github.com/jpadilla/pyjwt/pull/214>`__ |
| 895 |
|
| 896 |
`v1.4.1 <https://github.com/jpadilla/pyjwt/compare/1.4.0...1.4.1>`__ |
| 897 |
-------------------------------------------------------------------- |
| 898 |
|
| 899 |
Fixed |
| 900 |
~~~~~ |
| 901 |
|
| 902 |
- Newer versions of Pytest could not detect warnings properly |
| 903 |
`#182 <https://github.com/jpadilla/pyjwt/pull/182>`__ |
| 904 |
- Non-string 'kid' value now raises ``InvalidTokenError`` |
| 905 |
`#174 <https://github.com/jpadilla/pyjwt/pull/174>`__ |
| 906 |
- ``jwt.decode(None)`` now gracefully fails with ``InvalidTokenError`` |
| 907 |
`#183 <https://github.com/jpadilla/pyjwt/pull/183>`__ |
| 908 |
|
| 909 |
`v1.4 <https://github.com/jpadilla/pyjwt/compare/1.3.0...1.4.0>`__ |
| 910 |
------------------------------------------------------------------ |
| 911 |
|
| 912 |
Fixed |
| 913 |
~~~~~ |
| 914 |
|
| 915 |
- Exclude Python cache files from PyPI releases. |
| 916 |
|
| 917 |
Added |
| 918 |
~~~~~ |
| 919 |
|
| 920 |
- Added new options to require certain claims (require\_nbf, |
| 921 |
require\_iat, require\_exp) and raise ``MissingRequiredClaimError`` |
| 922 |
if they are not present. |
| 923 |
- If ``audience=`` or ``issuer=`` is specified but the claim is not |
| 924 |
present, ``MissingRequiredClaimError`` is now raised instead of |
| 925 |
``InvalidAudienceError`` and ``InvalidIssuerError`` |
| 926 |
|
| 927 |
`v1.3 <https://github.com/jpadilla/pyjwt/compare/1.2.0...1.3.0>`__ |
| 928 |
------------------------------------------------------------------ |
| 929 |
|
| 930 |
Fixed |
| 931 |
~~~~~ |
| 932 |
|
| 933 |
- ECDSA (ES256, ES384, ES512) signatures are now being properly |
| 934 |
serialized `#158 <https://github.com/jpadilla/pyjwt/pull/158>`__ |
| 935 |
- RSA-PSS (PS256, PS384, PS512) signatures now use the proper salt |
| 936 |
length for PSS padding. |
| 937 |
`#163 <https://github.com/jpadilla/pyjwt/pull/163>`__ |
| 938 |
|
| 939 |
Added |
| 940 |
~~~~~ |
| 941 |
|
| 942 |
- Added a new ``jwt.get_unverified_header()`` to parse and return the |
| 943 |
header portion of a token prior to signature verification. |
| 944 |
|
| 945 |
Removed |
| 946 |
~~~~~~~ |
| 947 |
|
| 948 |
- Python 3.2 is no longer a supported platform. This version of Python |
| 949 |
is rarely used. Users affected by this should upgrade to 3.3+. |
| 950 |
|
| 951 |
`v1.2.0 <https://github.com/jpadilla/pyjwt/compare/1.1.0...1.2.0>`__ |
| 952 |
-------------------------------------------------------------------- |
| 953 |
|
| 954 |
Fixed |
| 955 |
~~~~~ |
| 956 |
|
| 957 |
- Added back ``verify_expiration=`` argument to ``jwt.decode()`` that |
| 958 |
was erroneously removed in |
| 959 |
`v1.1.0 <https://github.com/jpadilla/pyjwt/compare/1.0.1...1.1.0>`__. |
| 960 |
|
| 961 |
Changed |
| 962 |
~~~~~~~ |
| 963 |
|
| 964 |
- Refactored JWS-specific logic out of PyJWT and into PyJWS superclass. |
| 965 |
`#141 <https://github.com/jpadilla/pyjwt/pull/141>`__ |
| 966 |
|
| 967 |
Deprecated |
| 968 |
~~~~~~~~~~ |
| 969 |
|
| 970 |
- ``verify_expiration=`` argument to ``jwt.decode()`` is now deprecated |
| 971 |
and will be removed in a future version. Use the ``option=`` argument |
| 972 |
instead. |
| 973 |
|
| 974 |
`v1.1.0 <https://github.com/jpadilla/pyjwt/compare/1.0.1...1.1.0>`__ |
| 975 |
-------------------------------------------------------------------- |
| 976 |
|
| 977 |
Added |
| 978 |
~~~~~ |
| 979 |
|
| 980 |
- Added support for PS256, PS384, and PS512 algorithms. |
| 981 |
`#132 <https://github.com/jpadilla/pyjwt/pull/132>`__ |
| 982 |
- Added flexible and complete verification options during decode. |
| 983 |
`#131 <https://github.com/jpadilla/pyjwt/pull/131>`__ |
| 984 |
- Added this CHANGELOG.md file. |
| 985 |
|
| 986 |
Deprecated |
| 987 |
~~~~~~~~~~ |
| 988 |
|
| 989 |
- Deprecated usage of the .decode(..., verify=False) parameter. |
| 990 |
|
| 991 |
Fixed |
| 992 |
~~~~~ |
| 993 |
|
| 994 |
- Fixed command line encoding. |
| 995 |
`#128 <https://github.com/jpadilla/pyjwt/pull/128>`__ |
| 996 |
|
| 997 |
`v1.0.1 <https://github.com/jpadilla/pyjwt/compare/1.0.0...1.0.1>`__ |
| 998 |
-------------------------------------------------------------------- |
| 999 |
|
| 1000 |
Fixed |
| 1001 |
~~~~~ |
| 1002 |
|
| 1003 |
- Include jwt/contrib' and jwt/contrib/algorithms\` in setup.py so that |
| 1004 |
they will actually be included when installing. |
| 1005 |
`882524d <https://github.com/jpadilla/pyjwt/commit/882524d>`__ |
| 1006 |
- Fix bin/jwt after removing jwt.header(). |
| 1007 |
`bd57b02 <https://github.com/jpadilla/pyjwt/commit/bd57b02>`__ |
| 1008 |
|
| 1009 |
`v1.0.0 <https://github.com/jpadilla/pyjwt/compare/0.4.3...1.0.0>`__ |
| 1010 |
-------------------------------------------------------------------- |
| 1011 |
|
| 1012 |
Changed |
| 1013 |
~~~~~~~ |
| 1014 |
|
| 1015 |
- Moved ``jwt.api.header`` out of the public API. |
| 1016 |
`#85 <https://github.com/jpadilla/pyjwt/pull/85>`__ |
| 1017 |
- Added README details how to extract public / private keys from an |
| 1018 |
x509 certificate. |
| 1019 |
`#100 <https://github.com/jpadilla/pyjwt/pull/100>`__ |
| 1020 |
- Refactor api.py functions into an object (``PyJWT``). |
| 1021 |
`#101 <https://github.com/jpadilla/pyjwt/pull/101>`__ |
| 1022 |
- Added support for PyCrypto and ecdsa when cryptography isn't |
| 1023 |
available. `#101 <https://github.com/jpadilla/pyjwt/pull/103>`__ |
| 1024 |
|
| 1025 |
Fixed |
| 1026 |
~~~~~ |
| 1027 |
|
| 1028 |
- Fixed a security vulnerability where ``alg=None`` header could bypass |
| 1029 |
signature verification. |
| 1030 |
`#109 <https://github.com/jpadilla/pyjwt/pull/109>`__ |
| 1031 |
- Fixed a security vulnerability by adding support for a whitelist of |
| 1032 |
allowed ``alg`` values ``jwt.decode(algorithms=[])``. |
| 1033 |
`#110 <https://github.com/jpadilla/pyjwt/pull/110>`__ |