validator.js icon indicating copy to clipboard operation
validator.js copied to clipboard

fix(isJWT): add compatibility for JWE (RFC7516)

Open damikael opened this issue 3 years ago • 2 comments

JWT (RFC7519) can be:

  • JWS (header.payload.signature) - RFC7515
  • JWE (header.encryption_key.initialization_vector.ciphertext.authentication_tag) - RFC7516

This PR add compatibility to validate a JWT as JWE if the second parameter is true.

Checklist

  • [x] PR contains only changes related
  • [x] README updated (where applicable)
  • [x] Tests written (where applicable)

damikael avatar Aug 18 '22 14:08 damikael

Codecov Report

Merging #2031 (3243b61) into master (86a07ba) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master     #2031   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          104       104           
  Lines         2203      2206    +3     
  Branches       477       480    +3     
=========================================
+ Hits          2203      2206    +3     
Impacted Files Coverage Δ
src/lib/isJWT.js 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Aug 18 '22 15:08 codecov[bot]