jwt-kit
jwt-kit copied to clipboard
Version 4 to Version 5 Migration Deprecations
This PR adds migration deprecations for many common APIs between version 4 and version 5 that should help most users (particularly those using ECDSA keys and standard JWTs) migrate from version 4 to version 5 by following warnings. Crucially, it allows libraries that rely on the same requirements (for instance, https://github.com/apple/app-store-server-library-swift and https://github.com/m-barthelemy/AcmeSwift) to allow for a range of versions such as "4.14.0" ..< "6.0.0".
If we agree with the proposed updates here, a few more things should be done:
- Cut a new minor v4 version, specifically
4.14.0, so users can opt out of the warnings should they wish to. - Add an entry to main's README explaining the process to update from v4 to v5.
- Update v5 with an
AsyncJWTPayloadtypealias back toJWTPayloadthat is itself deprecated, to fully support libraries that wish to be compatible with v4 and v5. - Make a similar but smaller PR to
jwtfor vapor to move folks away from signers and ontokeys(otherwise they are still forced into an all or nothing update since they will still be stuck withJWTSigners).
Note that I didn't make compatibility APIs for every type — if someone feels they are necessary due to a library requiring them, I figured we could add more support in a future PR.
Added a couple of brief comments. There's also a failing test we need to investigate
Still need to fix the tests, but let me get PRs for the other pieces in place before we merge so they can go in all at once