ruby-jwt icon indicating copy to clipboard operation
ruby-jwt copied to clipboard

Improved public interfaces for JWK classes by splitting them by capabilities

Open anakinj opened this issue 4 years ago • 1 comments
trafficstars

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.

anakinj avatar Dec 28 '20 08:12 anakinj

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! 🎉

See more details about this review.

sourcelevel-bot[bot] avatar Dec 28 '20 08:12 sourcelevel-bot[bot]

Sorry @MatteoPierro this was a great exercise but as such it will never see the light of "production" :)

anakinj avatar Nov 12 '22 19:11 anakinj