ruby-jwt
ruby-jwt copied to clipboard
Improved public interfaces for JWK classes by splitting them by capabilities
While working on the OKP support (#388) I realised that the public API for the JWK classes was too narrow. This probably because the initial implementation was based on the needs of the RSA algorithm.
Good example on the bad fit is the HMAC algorithm, there is just one secret.
So we sat down with @MatteoPierro and reorganised the JWK classes.
This PR removes the keypair and public? methods for the not-yet-released EC and HMAC algorithms and deprecates them for the RSA keys. This to favour the use-case specific methods for the capabilities and keys (capabilities, verify_key, signing_key, encryption_key and decryption_key).
Would be super if @phlegx and @richardlarocque could spare a few minutes to take a look.
SourceLevel has finished reviewing this Pull Request and has found:
- 2 possible new issues (including those that may have been commented here).
- 1 fixed issue! 🎉
Sorry @MatteoPierro this was a great exercise but as such it will never see the light of "production" :)