You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Signing with an ECDSA key on a mismatched or unsupported curve raised
IncorrectAlgorithm or UnsupportedEcdsaCurve, and an invalid HMAC key
raised through the verify helper. Under the new hierarchy those are
SignatureError < TokenError, so `JWT.encode` could fail with an error
that is not an EncodeError, unlike its other signing failures and the
Token#sign! contract.
The ECDSA sign path now resolves the curve through a signing-side
helper that raises EncodeError, and the HMAC key validation yields its
message so sign and verify each raise their own error class. Verify
paths are unchanged.
Specs: rename the ECDSA sign examples that claimed VerificationError
while asserting EncodeError, cover the curve mismatch on sign, and
split the curve_name spec into an encode and a decode case. The JWK
"ES384 key pointed to as ES512 key" spec was loading the P-384 fixture
for both keys and only passed because encoding failed first; it now
uses the P-521 fixture and exercises verification.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
7
7
**Features:**
8
8
9
-
- Revamp error hierarchy: introduce `JWT::Error`, `JWT::TokenError`, `JWT::MalformedTokenError`, `JWT::SignatureError`, and `JWT::ClaimValidationError` grouping classes. `JWT::DecodeError` is now a deprecated alias for `JWT::Error`; because of this, `rescue JWT::DecodeError` now also catches `JWT::EncodeError`[#722](https://github.com/jwt/ruby-jwt/pull/722) ([@anakinj](https://github.com/anakinj))
9
+
- Revamp error hierarchy: introduce `JWT::Error`, `JWT::TokenError`, `JWT::MalformedTokenError`, `JWT::SignatureError`, and `JWT::ClaimValidationError` grouping classes. `JWT::DecodeError` is now a deprecated alias for `JWT::Error`; because of this, `rescue JWT::DecodeError` now also catches `JWT::EncodeError`. Signing failures now consistently raise `JWT::EncodeError`: an ECDSA signing key with a mismatched or unsupported curve and an invalid HMAC signing key previously surfaced as `JWT::IncorrectAlgorithm`, `JWT::UnsupportedEcdsaCurve` or `JWT::DecodeError` from `JWT.encode`[#722](https://github.com/jwt/ruby-jwt/pull/722) ([@anakinj](https://github.com/anakinj))
0 commit comments