Commit Graph
382 Commits
Author SHA1 Message Date
Eduardo DiazandJosé F. Romaniello f081aeffcf fix ci execution, remove not needed script (#472) 2018-05-22 12:15:22 -05:00
Josh UngerandEduardo Diaz e96b826066 Update README.md (#461) 2018-04-26 12:27:49 +02:00
Eduardo Diaz a05a4b3548 8.2.1 v8.2.1 2018-04-05 13:38:11 +02:00
Eduardo Diaz 31e0e8d2fc update changelog 2018-04-05 13:32:17 +02:00
Nicolas CognauxandEduardo Diaz e50764b070 Check payload is not null when decoded. (#444)
* Check payload is not null when decoded.
Fixed "Cannot read property 'nbf' of null"

* Condition on obj !== null for clarity

* Added test for decoding null token
2018-04-05 13:28:41 +02:00
David BeiteyandEduardo Diaz cc7c41b109 Clarify that buffer/string payloads must be JSON (#442)
It does kinda go without saying that JWTs (_JSON_ Web Tokens) need to contain JSON but it's worth mentioning that signing doesn't check your payload.  In some unit tests I was writing where the payload was a dummy (non-JSON parsable) string, JWTs were being signed okay but they're not valid according to the spec.
2018-03-02 14:08:24 +01:00
Eduardo Diaz 8bc7d5b5e7 8.2.0 v8.2.0 2018-03-02 13:56:32 +01:00
Eduardo Diaz 5276392d58 update changelog 2018-03-02 13:56:17 +01:00
Jonathan Gros-DuboisandEduardo Diaz cab1c43ee4 Add a new mutatePayload option (#446)
This option allows you to keep a reference to the raw token payload after claims have been applied to it but before it has been encoded.
2018-03-02 13:48:25 +01:00
Eduardo Diaz 09a2b8e855 8.1.1 v8.1.1 2018-01-22 20:27:15 +01:00
Eduardo Diaz 3ac7a784a0 update changelog 2018-01-22 20:27:15 +01:00
Tim OramandEduardo Diaz 9f9d93b40e Not Before (nbf) calculated based on iat/timestamp (#437)
fix #435
2018-01-19 18:28:49 +01:00
Tim OramandEduardo Diaz a6422365ab Bump ms version to add support for negative numbers (#438) 2018-01-19 14:20:57 +01:00
Daniel SchmidtandEduardo Diaz c619575175 add newer node versions to build matrix (#428)
* add newer node versions to build matrix

* Dont test for node 9

Its not stable and seems to fail on travis
2018-01-10 22:38:47 +01:00
Harkirat SinghandEduardo Diaz bab4a35287 Minor typo (#424) 2017-11-17 17:20:04 +01:00
Eduardo Diaz 1101e00f1e 8.1.0 v8.1.0 2017-10-09 19:36:47 +02:00
Eduardo Diaz da4564ce6a update changelog 2017-10-09 19:36:35 +02:00
Jeff AlderandEduardo Diaz b848551927 #403: Clarify error wording. (#409)
* #403: Clarify error wording.

* #403: Improve wording for payload vs options
2017-10-09 19:29:48 +02:00
TheBusCantSwimandEduardo Diaz 5193ee5616 Enhance audience check to verify against regular expressions (#398)
* Enhance audience check to verify against regular expressions

* Enhance audience check to verify against regular expressions

* Adapted README to have a showcase of the new RegExp-check for the audience validation
2017-10-09 19:29:15 +02:00
Jeff AlderandEduardo Diaz b00c459bc6 #402: Don't fail if captureStackTrace is not a function (#410) 2017-10-09 19:28:37 +02:00
Jeff AlderandEduardo Diaz a5e0c09c2d #385: Tweak README (#408)
* #385: Tweak README

* #385 Further wording tweaks for consistency.
2017-10-09 13:57:02 +02:00
oughterandEduardo Diaz 04a88aba0d Fix typo in 'options.header' reference; Update Buffer() example to use recommended method (#380) 2017-09-15 11:31:21 +02:00
Eduardo Diaz b3dc03e170 8.0.1 v8.0.1 2017-09-12 12:55:34 +02:00
Eduardo Diaz 0c3b67b9ab update changelog 2017-09-12 12:55:22 +02:00
Tomas ChmelevskijandEduardo Diaz 8fe1f3f44f Remove lodash.isarray dependency (#394) 2017-09-12 12:52:22 +02:00
Eduardo Diaz 96188a9990 8.0.0 v8.0.0 2017-09-06 17:45:05 +02:00
Eduardo Diaz 0e2b2c6a78 updated changelog 2017-09-06 17:44:49 +02:00
Germán LenaandGitHub 4ead059855 Merge pull request #393 from ziluvatar/migration-notes-to-readme
docs: readme, migration notes
2017-09-06 12:37:11 -03:00
Eduardo Diaz 8d37ed85a3 docs: readme, migration notes 2017-09-06 16:49:06 +02:00
Fredrik LiljegrenandGitHub 3f2bff62d4 Merge pull request #349 from ziluvatar/fix-max-age-number-and-seconds
maxAge: Fix logic with number + use seconds instead of ms
2017-09-06 16:43:23 +02:00
ilyapxandEduardo Diaz 2bbd6a37b4 verify: remove process.nextTick (#302)
running synchronous code asynchronously using process.nextTick
has a negative latency impact
2017-09-06 16:41:55 +02:00
Jorrit SchippersandEduardo Diaz 80b0f8535f Reduce size of NPM package (#347) 2017-09-06 16:36:01 +02:00
Chris PriceandEduardo Diaz 75b897b11d Remove joi to shrink module size (#348)
* Add cost-of-modules report to npm test

Results before any changes

┌─────────────┬────────────┬───────┐
│ name        │ children   │ size  │
├─────────────┼────────────┼───────┤
│ joi         │ 4          │ 3.12M │ <--!!!
├─────────────┼────────────┼───────┤
│ jws         │ 5          │ 0.18M │
├─────────────┼────────────┼───────┤
│ lodash.once │ 0          │ 0.01M │
├─────────────┼────────────┼───────┤
│ ms          │ 0          │ 0.01M │
├─────────────┼────────────┼───────┤
│ xtend       │ 0          │ 0.00M │
├─────────────┼────────────┼───────┤
│ 5 modules   │ 9 children │ 3.32M │
└─────────────┴────────────┴───────┘

* Replace joi with bespoke validator based on lodash

Dramatically reduces the module size without breaking ES5 compatability -

┌──────────────────────┬────────────┬───────┐
│ name                 │ children   │ size  │
├──────────────────────┼────────────┼───────┤
│ jws                  │ 5          │ 0.18M │
├──────────────────────┼────────────┼───────┤
│ lodash.includes      │ 0          │ 0.02M │
├──────────────────────┼────────────┼───────┤
│ lodash.once          │ 0          │ 0.01M │
├──────────────────────┼────────────┼───────┤
│ lodash.isinteger     │ 0          │ 0.01M │
├──────────────────────┼────────────┼───────┤
│ ms                   │ 0          │ 0.01M │
├──────────────────────┼────────────┼───────┤
│ lodash.isplainobject │ 0          │ 0.01M │
├──────────────────────┼────────────┼───────┤
│ xtend                │ 0          │ 0.00M │
├──────────────────────┼────────────┼───────┤
│ lodash.isstring      │ 0          │ 0.00M │
├──────────────────────┼────────────┼───────┤
│ lodash.isboolean     │ 0          │ 0.00M │
├──────────────────────┼────────────┼───────┤
│ lodash.isnumber      │ 0          │ 0.00M │
├──────────────────────┼────────────┼───────┤
│ lodash.isarray       │ 0          │ 0.00M │
├──────────────────────┼────────────┼───────┤
│ 11 modules           │ 5 children │ 0.25M │
└──────────────────────┴────────────┴───────┘

* Enhance validator error messages and add tests
2017-09-06 16:24:55 +02:00
Eduardo Diaz 23cb6f1d24 maxAge: Add validation to timespan result 2017-08-29 12:24:08 +02:00
Eduardo Diaz be10962135 update changelog 2017-08-17 16:21:21 +02:00
Eduardo Diaz 27771716b5 7.4.3 v7.4.3 2017-08-17 16:18:23 +02:00
Fredrik LiljegrenandGitHub 00b19d591b Merge pull request #386 from ziluvatar/issue_381
Fix breaking change on 7.4.2 for empty secret + "none" algorithm (sync code style)
2017-08-17 14:28:20 +02:00
Eduardo Diaz d63c87dc7c add test & modify guard code 2017-08-17 13:50:26 +02:00
Rhys Anthony McCaig 7ff56f77f3 Fixed alg non + secret set unit test 2017-08-11 17:32:06 -07:00
Rhys Anthony McCaig 95e73a269a Fix for #381. Set secret string before using jws when alg is none 2017-08-11 17:25:55 -07:00
Eduardo Diaz 57e97dbcb0 update changelog 2017-08-04 14:36:03 +02:00
Eduardo Diaz ee20a9e200 7.4.2 v7.4.2 2017-08-04 14:33:50 +02:00
José F. RomanielloandGitHub 36b6342170 Merge pull request #374 from ziluvatar/add-check-for-empty-secrets
sign: add check to be sure secret has a value
2017-08-04 09:31:49 -03:00
Eduardo Diaz 4cc2615033 sign: add check to be sure secret has a value 2017-07-24 16:59:07 -05:00
Fredrik LiljegrenandGitHub 93c2a4af49 Merge pull request #371 from ziluvatar/docs-about-refreshing-tokens
docs: about refreshing tokens
2017-07-14 13:57:26 +02:00
Eduardo Diaz 18137809c9 docs: about refreshing tokens 2017-07-14 13:21:57 +02:00
Fredrik LiljegrenandGitHub ff77aa1b33 Merge pull request #365 from ziluvatar/information-regarding-base64-secrets
docs: verifying with base64 encoded secrets
2017-06-27 11:49:16 +02:00
Eduardo Diaz 5c47d0deee docs: verifying with base64 encoded secrets 2017-06-24 11:44:14 +02:00
Fredrik LiljegrenandGitHub 512a02c4dc Merge pull request #360 from ziluvatar/add-ecdsa-tests
Add tests for ES256
2017-06-14 18:22:58 +02:00
rjruizesandEduardo Diaz c797714223 document keyid as option (#361) 2017-06-14 13:27:47 +02:00