Skip to content

release_v0.2.0: Merge pull request #2 from robjsliwa/features

Choose a tag to compare

@robjsliwa robjsliwa released this 18 Oct 19:30
· 2 commits to main since this release
1a11ebd

This pull request adds several improvements to the JWT library, focusing on enhanced signature handling, particularly for ECDSA, RSA, and HMAC algorithms. Additionally, it includes refactoring of test cases for better modularity and organization, as well as various quality-of-life (QOL) updates.

Key Changes:

  1. Signature Handling Enhancements:
    • Implemented support for both DER and raw signature formats for ECDSA to improve compatibility (e.g., with jwt.io).
    • Optimized RSA and PSS signature handling, ensuring that all key formats (PKCS1, PKCS8) are supported and improving the internal consistency of the signing process.
    • Refined HMAC encoding/decoding processes to be more efficient and reliable.
  2. ECDSA Raw Format Support:
    • Modified EcSigningSchema to split ECDSA signatures into r and s components for raw format, allowing for better compatibility with external libraries.
    • Updated encoding to provide the option for raw ECDSA signatures while retaining existing DER format support.
  3. Refactor of Tests:
    • Separated JWT encoding and decoding tests into dedicated files for better test organization.
    • Introduced new test cases to cover edge scenarios, such as unsupported algorithms and key formats.
    • Expanded coverage for various PEM formats, including both public and private keys, to ensure correct handling across RSA, ECDSA, and HMAC algorithms.
  4. Validation Improvements:
    • Added new ValidationOptions for enforcing required claims within JWTs, allowing for better customization of JWT validation logic.
    • Extended error handling for unsupported algorithms and invalid claim scenarios.
  5. General Code Improvements:
    • Various minor QOL improvements across the library, including simplifying the SigningKey structure and ensuring cleaner separation between key types and their encoding/decoding.
    • Reduced redundant code in rsa_signing.rs and ecdsa_signing.rs, improving maintainability.