auth0 / node-jws

JSON Web Signatures
http://self-issued.info/docs/draft-ietf-jose-json-web-signature.html
MIT License
709 stars 108 forks source link

Expose and document existing 'json' option in jws.decode and jws.createVerify APIs #105

Open loucadufault opened 1 year ago

loucadufault commented 1 year ago

Description

The json option is currently accepted by the jws.decode API, although it is not documented in repo. From its usage, it seems it intends to enable configuring how the payload should be parsed when the typ is not set to 'JWT' on the JWS header.

This change: a) documents the option as part of the API b) adds support for the option via the jws.createVerify API, which will pass through the option to jws.decode internally.

Testing

Added tests for when:

Checklist