* Updating Node version in package.json
Updated Node version from 0.12 to 1.4 in package.json engines
* Updated node version
Updated Node version from 0.12 to 4 in package.json Engines Spec
Fixes Issue #509
Refactor the existing tests for the nbf claim to use the async/sync test
helpers. This required fixing a case where an error was improperly
handled for an async call.
Refactor existing tests for the exp claim to use the async/sync test
helpers. This required fixing a case where an error was improperly
handled in the async case.
It is difficult to write tests that ensure that both the asynchronous
and synchronous calls to the sign and verify functions had the same
result. These helpers ensure that the calls are the same and return the
common result.
As a proof of concept, the iat claim tests have been updated to use the
new helpers.
This change extracts all tests related to the iat claim and the maxAge
verify option into two test files. Several additional tests are added
that were missing from the existing tests.
This change extracts all tests in the existing files related to the
subject option and sub claim into a single test file. Several other
tests are also added that were missing from the existing files.
This change extracts all tests in the existing test files related to
audience and aud into a single test file. Several other tests are also
added that were missing from the existing files.
* Add extension to ESLint config file
The .eslintrc file without an extension was deprecated a few years ago,
so this change renames the file to add the required extension.
See: https://github.com/eslint/eslint/commit/c9a8883d450d63a8d044a9e66d275f5b1973a3ba
* Add ESLint to package.json
This change adds ESLint as a dev-dependency and adds a lint script that
will run ESLint.
* Complete switch from JSHint to ESLint
Convert all the JSHint rules to the ESLint equivalents where possible.
The no-undef rule in ESLint caught a few cases of undefined usages in
the tests, so they were also fixed.
* Add a .eslintignore file
The HTML coverage report is currently being linted, which causes a lot
if invalid linting errors. This change adds a ignore file to ensure these
files are properly skipped during linting.
* Introduction of the secret callback
Without the more contentious 'none'-changes
* Removed some spaces...
I should really add a editor.config and eslint to this project ;-)
* Removed xtend as a dependency, as the native Object.Assign can do this as well
* Removed xtend as a dependency, as the native Object.Assign can do this as well
* Resolve feedback from review
* Added extra test and fixed the associated bug
* The return of the header
* Forgot to change this one as well... Sorry bout that
* Updated the readme and made the if-statements consistent
* Space; The final frontier
* 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
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.