@kofile/jwt-client
Advanced tools
Comparing version 1.0.1 to 2.0.0
@@ -46,11 +46,11 @@ const jsonwebtoken = require('jsonwebtoken') | ||
getUserId () { | ||
get userId () { | ||
return this._userId | ||
} | ||
getTenantId () { | ||
get tenantId () { | ||
return this._tenantId | ||
} | ||
getORT () { | ||
get ort () { | ||
return this._ort | ||
@@ -57,0 +57,0 @@ } |
@@ -1,53 +0,1 @@ | ||
{ | ||
"name": "@kofile/jwt-client", | ||
"version": "1.0.1", | ||
"description": "A simple JWT reader", | ||
"repository": "https://github.com/kofile/jwt-client", | ||
"author": "Evan Sherwood <evan@sherwood.io>", | ||
"license": "MIT", | ||
"main": "index.js", | ||
"files": [ | ||
"index.js" | ||
], | ||
"dependencies": { | ||
"jsonwebtoken": "^8.0.1" | ||
}, | ||
"devDependencies": { | ||
"@whizark/cz-cli": "^0.4.0", | ||
"ava": "^0.22.0", | ||
"commitizen": "^2.9.6", | ||
"coveralls": "^2.13.1", | ||
"cz-conventional-changelog": "^2.0.0", | ||
"husky": "^0.13.4", | ||
"lint-staged": "^3.6.0", | ||
"nyc": "^11.1.0", | ||
"prettier-standard": "^6.0.0", | ||
"ramda": "^0.25.0", | ||
"semantic-release": "^8.0.3", | ||
"snazzy": "^7.0.0", | ||
"standard": "^10.0.3" | ||
}, | ||
"lint-staged": { | ||
"*.js": [ | ||
"prettier-standard", | ||
"git add" | ||
] | ||
}, | ||
"scripts": { | ||
"precommit": "lint-staged", | ||
"commit": "git-cz", | ||
"lint": "standard | snazzy", | ||
"test": "nyc ava", | ||
"semantic-release": "semantic-release pre && npm publish && semantic-release post" | ||
}, | ||
"config": { | ||
"commitizen": { | ||
"path": "node_modules/cz-conventional-changelog" | ||
} | ||
}, | ||
"nyc": { | ||
"include": [ | ||
"index.js" | ||
] | ||
} | ||
} | ||
{"name":"@kofile/jwt-client","version":"2.0.0","description":"A simple JWT reader","repository":"https://github.com/kofile/jwt-client","author":"Evan Sherwood <evan@sherwood.io>","license":"MIT","main":"index.js","files":["index.js"],"dependencies":{"jsonwebtoken":"^8.0.1"},"devDependencies":{"@whizark/cz-cli":"^0.4.0","ava":"^0.22.0","commitizen":"^2.9.6","coveralls":"^2.13.1","cz-conventional-changelog":"^2.0.0","husky":"^0.13.4","lint-staged":"^3.6.0","nyc":"^11.1.0","prettier-standard":"^6.0.0","ramda":"^0.25.0","semantic-release":"^8.0.3","snazzy":"^7.0.0","standard":"^10.0.3"},"lint-staged":{"*.js":["prettier-standard","git add"]},"scripts":{"precommit":"lint-staged","commit":"git-cz","lint":"standard | snazzy","test":"nyc ava","semantic-release":"semantic-release pre && npm publish && semantic-release post"},"config":{"commitizen":{"path":"node_modules/cz-conventional-changelog"}},"nyc":{"include":["index.js"]}} |
@@ -18,8 +18,12 @@ # @kofile/jwt-client | ||
## API | ||
client.getUserId() | ||
client.userId | ||
client.getTenantId() | ||
client.tenantId | ||
client.getORT() | ||
client.ort | ||
client.encoded | ||
client.dump() | ||
client.getRoleIdForTenant(tenantId) | ||
@@ -45,12 +49,18 @@ | ||
// get user id | ||
client.getUserId() | ||
client.userId //=> 123 | ||
// get tenant id | ||
client.getTenantId() | ||
client.tenantId //=> 48121 | ||
//get ort | ||
client.getORT() | ||
client.ort //=> dsgsgasdgdfhws | ||
// get encoded jwt | ||
client.encoded //=> jsonwebtoken.sign(payload, 'key') | ||
// get the entire payload body | ||
client.dump() //=> payload | ||
// get role id for a tenant | ||
client.getRoleIdForTenant(tenantId) | ||
client.getRoleIdForTenant(tenantId) //=> 1 | ||
@@ -57,0 +67,0 @@ // check if an error is a custom JwtError |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
68
0
4319