135 lines
15 KiB
JSON
135 lines
15 KiB
JSON
|
{
|
||
|
"_args": [
|
||
|
[
|
||
|
{
|
||
|
"raw": "jsonwebtoken@^7.2.1",
|
||
|
"scope": null,
|
||
|
"escapedName": "jsonwebtoken",
|
||
|
"name": "jsonwebtoken",
|
||
|
"rawSpec": "^7.2.1",
|
||
|
"spec": ">=7.2.1 <8.0.0",
|
||
|
"type": "range"
|
||
|
},
|
||
|
"/home/jdaugherty/work/GT2/GT2-Android/node_modules/xdl"
|
||
|
]
|
||
|
],
|
||
|
"_from": "jsonwebtoken@>=7.2.1 <8.0.0",
|
||
|
"_id": "jsonwebtoken@7.4.3",
|
||
|
"_inCache": true,
|
||
|
"_location": "/jsonwebtoken",
|
||
|
"_nodeVersion": "4.4.3",
|
||
|
"_npmOperationalInternal": {
|
||
|
"host": "s3://npm-registry-packages",
|
||
|
"tmp": "tmp/jsonwebtoken-7.4.3.tgz_1502981444880_0.00893402541987598"
|
||
|
},
|
||
|
"_npmUser": {
|
||
|
"name": "ziluvatar",
|
||
|
"email": "eduardo.diaz@auth0.com"
|
||
|
},
|
||
|
"_npmVersion": "2.15.1",
|
||
|
"_phantomChildren": {
|
||
|
"moment": "2.20.1"
|
||
|
},
|
||
|
"_requested": {
|
||
|
"raw": "jsonwebtoken@^7.2.1",
|
||
|
"scope": null,
|
||
|
"escapedName": "jsonwebtoken",
|
||
|
"name": "jsonwebtoken",
|
||
|
"rawSpec": "^7.2.1",
|
||
|
"spec": ">=7.2.1 <8.0.0",
|
||
|
"type": "range"
|
||
|
},
|
||
|
"_requiredBy": [
|
||
|
"/xdl"
|
||
|
],
|
||
|
"_resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-7.4.3.tgz",
|
||
|
"_shasum": "77f5021de058b605a1783fa1283e99812e645638",
|
||
|
"_shrinkwrap": null,
|
||
|
"_spec": "jsonwebtoken@^7.2.1",
|
||
|
"_where": "/home/jdaugherty/work/GT2/GT2-Android/node_modules/xdl",
|
||
|
"author": {
|
||
|
"name": "auth0"
|
||
|
},
|
||
|
"bugs": {
|
||
|
"url": "https://github.com/auth0/node-jsonwebtoken/issues"
|
||
|
},
|
||
|
"dependencies": {
|
||
|
"joi": "^6.10.1",
|
||
|
"jws": "^3.1.4",
|
||
|
"lodash.once": "^4.0.0",
|
||
|
"ms": "^2.0.0",
|
||
|
"xtend": "^4.0.1"
|
||
|
},
|
||
|
"description": "JSON Web Token implementation (symmetric and asymmetric)",
|
||
|
"devDependencies": {
|
||
|
"atob": "^1.1.2",
|
||
|
"chai": "^1.10.0",
|
||
|
"conventional-changelog": "~1.1.0",
|
||
|
"mocha": "^2.1.0",
|
||
|
"nsp": "^2.6.2",
|
||
|
"sinon": "^1.15.4"
|
||
|
},
|
||
|
"directories": {},
|
||
|
"dist": {
|
||
|
"shasum": "77f5021de058b605a1783fa1283e99812e645638",
|
||
|
"tarball": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-7.4.3.tgz"
|
||
|
},
|
||
|
"engines": {
|
||
|
"node": ">=0.12",
|
||
|
"npm": ">=1.4.28"
|
||
|
},
|
||
|
"gitHead": "e54e53c70ad3fa0d6b54f916ea4a2a2d5a8c47c2",
|
||
|
"homepage": "https://github.com/auth0/node-jsonwebtoken#readme",
|
||
|
"keywords": [
|
||
|
"jwt"
|
||
|
],
|
||
|
"license": "MIT",
|
||
|
"main": "index.js",
|
||
|
"maintainers": [
|
||
|
{
|
||
|
"name": "dschenkelman",
|
||
|
"email": "damian.schenkelman@gmail.com"
|
||
|
},
|
||
|
{
|
||
|
"name": "iaco",
|
||
|
"email": "sebastian.iacomuzzi@gmail.com"
|
||
|
},
|
||
|
{
|
||
|
"name": "jaredhanson",
|
||
|
"email": "jaredhanson@gmail.com"
|
||
|
},
|
||
|
{
|
||
|
"name": "jfromaniello",
|
||
|
"email": "jfromaniello@gmail.com"
|
||
|
},
|
||
|
{
|
||
|
"name": "pose",
|
||
|
"email": "albertopose@gmail.com"
|
||
|
},
|
||
|
{
|
||
|
"name": "rolodato",
|
||
|
"email": "rolodato@rolodato.com"
|
||
|
},
|
||
|
{
|
||
|
"name": "woloski",
|
||
|
"email": "matiasw@gmail.com"
|
||
|
},
|
||
|
{
|
||
|
"name": "ziluvatar",
|
||
|
"email": "eduardo.diaz@auth0.com"
|
||
|
}
|
||
|
],
|
||
|
"name": "jsonwebtoken",
|
||
|
"optionalDependencies": {},
|
||
|
"readme": "# jsonwebtoken\n\n[![Build Status](https://secure.travis-ci.org/auth0/node-jsonwebtoken.svg?branch=master)](http://travis-ci.org/auth0/node-jsonwebtoken)[![Dependency Status](https://david-dm.org/auth0/node-jsonwebtoken.svg)](https://david-dm.org/auth0/node-jsonwebtoken)\n\n\nAn implementation of [JSON Web Tokens](https://tools.ietf.org/html/rfc7519).\n\nThis was developed against `draft-ietf-oauth-json-web-token-08`. It makes use of [node-jws](https://github.com/brianloveswords/node-jws)\n\n# Install\n\n```bash\n$ npm install jsonwebtoken\n```\n\n# Usage\n\n### jwt.sign(payload, secretOrPrivateKey, [options, callback])\n\n(Asynchronous) If a callback is supplied, callback is called with the `err` or the JWT.\n\n(Synchronous) Returns the JsonWebToken as string\n\n`payload` could be an object literal, buffer or string. *Please note that* `exp` is only set if the payload is an object literal.\n\n`secretOrPrivateKey` is a string, buffer, or object containing either the secret for HMAC algorithms or the PEM\nencoded private key for RSA and ECDSA. In case of a private key with passphrase an object `{ key, passphrase }` can be used (based on [crypto documentation](https://nodejs.org/api/crypto.html#crypto_sign_sign_private_key_output_format)), in this case be sure you pass the `algorithm` option.\n\n`options`:\n\n* `algorithm` (default: `HS256`)\n* `expiresIn`: expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms). Eg: `60`, `\"2 days\"`, `\"10h\"`, `\"7d\"`\n* `notBefore`: expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms). Eg: `60`, `\"2 days\"`, `\"10h\"`, `\"7d\"`\n* `audience`\n* `issuer`\n* `jwtid`\n* `subject`\n* `noTimestamp`\n* `header`\n* `keyid`\n\nIf `payload` is not a buffer or a string, it will be coerced into a string using `JSON.stringify`.\n\nThere are no default values for `expiresIn`, `notBefore`, `audience`, `subject`, `issuer`. These claims can also be provided in the payload directly with `exp`, `nbf`, `aud`, `sub` and `iss` respectively, but you can't include in both places.\n\nRemember that `exp`, `nbf` and `iat` are **NumericDate**, see related [Token Expiration (exp claim)](#token-expiration-exp-claim)\n\n\nThe header can be customized via the `option.header` object.\n\nGenerated jwts will include an `iat` (issued at) claim by default unless `noTimestamp` is specified. If `iat` is inserted in the payload, it will be used instead of the real timestamp for calculating other things like `exp` given a timespan in `options.expiresIn`.\n\nExample\n\n```js\n// sign with default (HMAC SHA256)\nvar jwt = require('jsonwebtoken');\nvar token = jwt.sign({ foo: 'bar' }, 'shhhhh');\n//backdate a jwt 30 seconds\nvar older_token = jwt.sign({ foo: 'bar', iat: Math.floor(Date.now() / 1000) - 30 }, 'shhhhh');\n\n// sign with RSA SHA256\nvar cert = fs.readFileSync('private.key'); // get private key\nvar token = jwt.sign({ foo: 'bar' }, cert, { algorithm: 'RS256'});\n\n// sign asynchronously\njwt.sign({ foo: 'bar' }, cert, { algorithm: 'RS256' }, function(err, token) {\n console.log(token);\n});\n```\n\n#### Token Expiration (exp claim)\n\nThe standard for JWT defines an `exp` claim for expiration. The expiration is represented as a **NumericDate**:\n\n> A JSON numeric value representing the number of seconds from 1970-01-01T00:00:00Z UTC until the specified UTC date/time, ignoring leap seconds. This is equivalent to the IEEE Std 1003.1, 2013 Edition [POSIX.1] definition \"Seconds Since the Epoch\", in which each day is accounted for by exactly 86400 seconds, other than that non-integer values can be represented. See RFC 3339 [RFC3339] for details regarding date/times in general and UTC in particular.\n\nThis means that the `exp` field should contain the number of seconds since the epoch.\n\nSigning a token with 1 hour of expiration:\n\n```javascript\njwt.sign({\n exp: Math.floor(Date.now() / 1000) + (60 * 60),\n data: 'foobar'\n}, 'secret');\n```\n\nAnother way to generate a token like this with this library is:\n\n```j
|
||
|
"readmeFilename": "README.md",
|
||
|
"repository": {
|
||
|
"type": "git",
|
||
|
"url": "git+https://github.com/auth0/node-jsonwebtoken.git"
|
||
|
},
|
||
|
"scripts": {
|
||
|
"test": "mocha --require test/util/fakeDate && nsp check"
|
||
|
},
|
||
|
"version": "7.4.3"
|
||
|
}
|