[compat] finalize json_encoder parity for #3#10
Conversation
There was a problem hiding this comment.
Code Review
This pull request increments the version to 1.2.1 and introduces regression tests for json_encoder parity, ensuring that custom payload and header values are correctly encoded and that kid validation is not bypassed. It also updates the compatibility checklist. A review comment identifies that previous unreleased entries in the changelog were accidentally removed and should be restored to maintain a complete release history.
| ### Fixed | ||
|
|
||
| - Release workflow now publishes to PyPI via **Trusted Publishing (OIDC)** | ||
| instead of the `PYPI_API_TOKEN` fallback that shipped `v1.2.0`. Added | ||
| `id-token: write` / `attestations: write` permissions to the publish | ||
| job and removed the explicit `password:` argument. The `environment: | ||
| pypi` gate is preserved. PEP 740 attestations are produced for every | ||
| artifact, which were disabled under the token path. | ||
| - Bumped `actions/download-artifact` from `v5` (Node 20) to `v8` | ||
| (Node 24) to clear the runner deprecation annotation. All other | ||
| actions already run on Node 24. | ||
| - Added regression coverage for `json_encoder` parity so custom payload | ||
| values still encode correctly after datetime claim normalization, custom | ||
| header values use the same encoder path as upstream PyJWT, and `kid` | ||
| validation is not bypassed by a custom encoder. | ||
| - Marked `json_encoder` compatibility as complete in | ||
| `COMPATIBILITY_CHECKLIST.md`. |
There was a problem hiding this comment.
The previous entries in the [Unreleased] section (regarding Trusted Publishing and the actions/download-artifact bump) have been removed. These should be preserved so they are included in the next release notes. It appears the ### Changed section was accidentally replaced by ### Fixed instead of being appended to.
Summary
json_encoderparity in both JWT payload and JWS header pathskidvalidation1.2.1Why
Issue #3 tracked
json_encoderparity as still partial. The implementation path already matched upstream in practice, but the edge-case coverage was not strong enough to treat that behavior as fixed and publicly complete.Impact
kidvalues still fail before any custom encoder can hide the type mismatchValidation
uv run pytest -q tests/test_upstream_api_jwt.py tests/test_upstream_api_jws.pyuv run python scripts/pytest_gate.pyRelated: #3