Debian Codegraph @

CHANGELOG.rst

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