Skip to content

test: add JWT signature verification tests to catch crypto issues#42

Merged
felippemsc merged 2 commits intomainfrom
test/jwt-signature-verification
Feb 8, 2026
Merged

test: add JWT signature verification tests to catch crypto issues#42
felippemsc merged 2 commits intomainfrom
test/jwt-signature-verification

Conversation

@felippemsc
Copy link
Contributor

Summary

  • Add 3 tests that exercise jsonwebtoken::decode() end-to-end with real EC key pairs
  • These tests would have caught the jsonwebtoken 9→10 CryptoProvider panic (chore(deps): bump jsonwebtoken from 9.3.1 to 10.3.0 #23)
  • Uses a hardcoded P-256 test key pair — no network or external dependencies needed
  • Also includes the rust_crypto feature fix for jsonwebtoken 10

New tests

  • verify_signature_with_valid_jwt — sign + verify round-trip
  • verify_signature_rejects_wrong_key — wrong JWKS key fails verification
  • verify_signature_rejects_missing_kid — missing key ID returns KeyNotFound error

Test plan

  • All 25 tests pass (cargo test)

@felippemsc felippemsc merged commit 865be29 into main Feb 8, 2026
5 checks passed
@felippemsc felippemsc deleted the test/jwt-signature-verification branch February 8, 2026 16:47
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.

1 participant