Commit graph

14 commits

Author SHA1 Message Date
Filip Skokan
6c98b61597 feat: validate JWTs according to a JWT profile - ID Token
It is now possible to pass a profile to `JWT.verify` and have the JWT
validated according to it. This makes sure you pass all the right
options and that required claims are present, prohibited claims are
missing and that the right JWT typ is used.

More profiles will be added in the future.
2019-07-23 14:50:16 +02:00
Filip Skokan
36c9ce20c5 fix: honour the JWT.sign jti option
fixes #33
2019-07-14 19:30:04 +03:00
Filip Skokan
5b53cb0155 fix: limit calculation of missing RSA private components
- this deprecates the use of `JWK.importKey` in favor of
`JWK.asKey`
- this deprecates the use of `JWKS.KeyStore.fromJWKS` in favor of
`JWKS.asKeyStore`

Both `JWK.importKey` and `JWKS.KeyStore.fromJWKS` could have resulted
in the process getting blocked when large bitsize RSA private keys
were missing their components and could also result in an endless
calculation loop when the private key's private exponent was outright
invalid or tampered with.

The new methods still allow to import private RSA keys with these
optimization key parameters missing but its disabled by default and one
should choose to enable it when working with keys from trusted sources

It is recommended not to use @panva/jose versions with this feature in
its original on-by-default form - v1.1.0 and v1.2.0 These will
2019-06-20 23:32:13 +02:00
Filip Skokan
6453e1ffc9 refactor: require order and base64url split encode buffer/string 2019-03-06 22:12:43 +01:00
Filip Skokan
dba1abdaf3 feat: add JWT.sign/verify/decode 2019-02-27 22:38:30 +01:00
Filip Skokan
775ea638b6 chore: cleanup 2019-02-10 17:45:55 +01:00
Filip Skokan
faa45bc03b refactor: remove generic errors 2019-01-20 19:37:27 +01:00
Filip Skokan
6862c78bed refactor: JWT verify errors 2019-01-20 19:25:36 +01:00
Filip Skokan
7080840f62 feat: verify and decode complete options 2019-01-20 14:26:09 +01:00
Filip Skokan
a752663317 refactor: move keys around 2019-01-19 17:24:43 +01:00
Filip Skokan
033a025a34 feat: jwt.verify 2019-01-19 16:33:17 +01:00
Filip Skokan
f9ec6e340d feat: cache last input key object 2019-01-19 11:41:52 +01:00
Filip Skokan
94b29d1c44 feat: jwt first commit 2019-01-19 00:33:45 +01:00
Filip Skokan
b8709756f0 chore: initial commit 2018-11-03 12:30:32 +01:00