Skip to content

Conversation

@jonahbron
Copy link

Add optional support for ES256 JWT signing/verifying to PyJWT using @dmazzella's cryptography port.

Test output:

Testing HS256
     Encode/decode test: OK
     Invalid signature test: OK
     Expired token test: OK
Testing ES256
     Encode/decode ES256 test: OK
     Invalid signature test: OK

Add optional support for ES256 JWT signing/verifying to PyJWT using
@dmazzella's cryptography port.

Signed-off-by: Jonah Bron <[email protected]>
@dpgeorge
Copy link
Member

Thanks for the contribution!

This isn't a full review, but some initial questions/feedback:

  • Is this ES256 support compatible with the CPython PyJWT library?
  • MicroPython tries to be minimal where possible, so I suggest inlining _sig_jws_to_der and _sig_der_to_jws at their place of use (they are only used once). That will save a bit of code size.
  • Also maybe the error message about required dependencies can be a little shorter/terser, to save size.
  • Can you please put the new test into a separate test for ES256, so that the tests can be run independently, and the original one still pass without cryptography installed.
  • Would be great to also add the tests to CI, see tools/ci.sh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants