Coder Social home page Coder Social logo

nomatic-jwt's Introduction

nomatic-jwt

Greenkeeper badge Semantic Release GitHub release npm Build Status Coverage Status Known Vulnerabilities dependencies Status devDependencies Status License

An opinionated library for encoding, decoding, and verifying JSON Web Tokens (JWTs), heavily inspired by node-jwt-simple.

Installation

You can install from npm by doing:

npm i --save nomatic-jwt

Basic Usage

const JWT = require('nomatic-jwt').JWT;

const jwt = new JWT({
    algorithm: 'HS256', // "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512"
    expiresIn: 60 * 60, // 1hr
    key: 'somethingMoreSecureThanThis', // Valid only with HMAC-SHA algorithms
    timeOffset: 60, // allowable wiggle room for expiration (`exp`) and not valid before (`nbf`) claims
    validate: true // If false, won't validate when decoding
});

// Encode
const token = jwt.encode({
    sub: 'user/12345678',
    roles: ['manager']
});
/* eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9
 * .eyJzdWIiOiJ1c2VyLzEyMzQ1Njc4Iiwicm9sZXMiOlsibWFuYWdlciJdLCJleHAiOjE1MDY4Nzk1ODAsIm5iZiI6MTUwNjg3NTk4MCwiaWF0IjoxNTA
 * 2ODc1OTgwfQ
 * .FjHYltcA1Natf6Iu72HyGxkk4GX2phMRG3yNW65_IsQ'
 */


// Decode
const decoded = jwt.decode(token);

nomatic-jwt's People

Contributors

bdfoster avatar greenkeeper[bot] avatar

Stargazers

 avatar  avatar

Watchers

James Cloos avatar  avatar

nomatic-jwt's Issues

An in-range update of @types/node is breaking the build 🚨

Version 8.0.42 of @types/node was just published.

Branch Build failing 🚨
Dependency @types/node
Current Version 8.0.41
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

@types/node is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
  • βœ… bitHound - Code No failing files. Details
  • βœ… bitHound - Dependencies No failing dependencies. Details

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @types/mocha is breaking the build 🚨

Version 2.2.45 of @types/mocha was just published.

Branch Build failing 🚨
Dependency @types/mocha
Current Version 2.2.44
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

@types/mocha is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ bitHound - Dependencies 1 failing dependency. Details
  • βœ… bitHound - Code No failing files. Details
  • βœ… continuous-integration/travis-ci/push The Travis CI build passed Details
  • βœ… coverage/coveralls First build on greenkeeper/@types/mocha-2.2.45 at 80.228% Details

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected πŸ€–


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of nyc is breaking the build 🚨

Version 11.3.0 of nyc was just published.

Branch Build failing 🚨
Dependency nyc
Current Version 11.2.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

nyc is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • βœ… bitHound - Code No failing files. Details
  • ❌ bitHound - Dependencies 1 failing dependency. Details
  • βœ… continuous-integration/travis-ci/push The Travis CI build passed Details
  • βœ… coverage/coveralls First build on greenkeeper/nyc-11.3.0 at 80.228% Details

Commits

The new version differs by 12 commits.

  • d85118c chore(release): 11.3.0
  • 7792733 chore: explicitly update istanbul dependencies (#698)
  • 222a3d0 chore: slight difference in pinning logic, based on @ljharb's advice
  • f04b7a9 feat: add option to hook vm.runInContext (#680)
  • cdfdff3 feat: add --exclude-after-remap option for users who pre-instrument their codebase (#697)
  • a413f6a chore: upgrade to yargs 10 (#694)
  • 10125aa docs: fix reporters link
  • f5089ca docs: added examples of coverage reports (#656)
  • af281e7 chore: update spawn-wrap to 1.4.0 (#692)
  • a685f7c docs: missing options prefix -- in front of check-coverage (#695)
  • f31d7a6 feat: allow instrument-only to produce sourcemaps (#674)
  • 425c0fd chore: ignore package-lock.json (#683)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @types/crypto-js is breaking the build 🚨

Version 3.1.38 of @types/crypto-js was just published.

Branch Build failing 🚨
Dependency @types/crypto-js
Current Version 3.1.37
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

@types/crypto-js is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build is in progress Details
  • βœ… bitHound - Code No failing files. Details
  • ❌ bitHound - Dependencies 1 failing dependency. Details

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of cross-env is breaking the build 🚨

Version 5.1.1 of cross-env was just published.

Branch Build failing 🚨
Dependency cross-env
Current Version 5.1.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

cross-env is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • βœ… continuous-integration/travis-ci/push The Travis CI build passed Details
  • βœ… coverage/coveralls First build on greenkeeper/cross-env-5.1.1 at 79.365% Details
  • βœ… bitHound - Code No failing files. Details
  • ❌ bitHound - Dependencies 1 failing dependency. Details

Release Notes v5.1.1

5.1.1 (2017-10-27)

Bug Fixes

  • remove env variables that don't exist from the converted commands in Windows. (#149) (50299d9)
Commits

The new version differs by 1 commits.

  • 50299d9 fix: remove env variables that don't exist from the converted commands in Windows. (#149)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @types/chai is breaking the build 🚨

Version 4.0.5 of @types/chai was just published.

Branch Build failing 🚨
Dependency @types/chai
Current Version 4.0.4
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

@types/chai is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ bitHound - Dependencies 1 failing dependency. Details
  • βœ… bitHound - Code No failing files. Details
  • βœ… continuous-integration/travis-ci/push The Travis CI build passed Details
  • βœ… coverage/coveralls First build on greenkeeper/@types/chai-4.0.5 at 79.365% Details

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of typescript is breaking the build 🚨

Version 2.6.1 of typescript was just published.

Branch Build failing 🚨
Dependency typescript
Current Version 2.5.3
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

typescript is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ bitHound - Dependencies 1 failing dependency. Details
  • βœ… bitHound - Code No failing files. Details
  • βœ… continuous-integration/travis-ci/push The Travis CI build passed Details
  • βœ… coverage/coveralls First build on greenkeeper/typescript-2.6.1 at 79.365% Details

Release Notes TypeScript 2.6

For release notes, check out the release announcement

For new features, check out the What's new in TypeScript 2.6.

For breaking changes, check out the Breaking changes in TypeScript 2.6 page.

For API breaking changes, check out the API Breaking changes in TypeScript 2.6 page.

For the complete list of fixed issues, check out the issues fixed in TypeScript 2.6 RC and after TypeScript 2.6 RC.

Download:

Special thanks to all contributors to this release:

  • Adrian Leonhard
  • Alex Chugaev
  • Alex Eagle
  • Anders Hejlsberg
  • Andrew Casey
  • Andy Hanson
  • Armando Aguirre
  • Arthur Ozga
  • Basarat Ali Syed
  • Benjamin Lichtman
  • Charles Pierce
  • Daniel Rosenwasser
  • @falsandtru
  • Filipe Silva
  • Francois Wouts
  • Henry Mercer
  • Herrington Darkholme
  • Ivan Enderlin
  • Joe Calzaretta
  • Klaus Meinhardt
  • Magnus Kulke
  • Matt Bierner
  • Matt Mitchell
  • Mohamed Hegazy
  • Nathan Shively-Sanders
  • Paul van Brenk
  • Ron Buckton
  • Ryan Cavanaugh
  • Sheetal Nandi
  • Stas Vilchik
  • Taras Mankovski
  • Thomas den Hollander
  • Vakhurin Sergey
  • Wesley Wigham
  • Zeeshan Ahmed
  • Zev Spitz
Commits

The new version differs by 1177 commits ahead by 1177, behind by 85.

  • 477bdc7 Update LKG
  • 6bc04a9 Use lowercased names for generated locale directories (#19581)
  • 0f32f55 Make getCompletionEntryDetails and getCompletionEntrySymbol parameters non-optional (#19507) (#19592)
  • 1359a93 Update LKG
  • a7e172b Support multiple completions with the same name but different source module (#19455) (#19496)
  • c35e90e Merge pull request #19484 from Microsoft/reloadScriptsWithoutProject
  • 96c66a6 Add test case to verify reload works without open project
  • b16e6d4 Reload contents of file from disk irrespective of project presence and file already containing its own text
  • 6489a75 Update LKG
  • 1a1c672 Merge pull request #19445 from Microsoft/foundWhileSearchingNodeModules
  • 4e56347 Set the files found during node_modules search correctly when reusing existing program structure
  • aaaa280 Add the test case that fails and reports error for files not in root directory in watch mode
  • 3134111 Merge pull request #19434 from Microsoft/port-master-10-23
  • a362bbf Fix lint error
  • 02cc07c For @types installing quickfix, only activate for implicit-any module (#19394) (#19429)

There are 250 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of coveralls is breaking the build 🚨

Version 3.0.1 of coveralls was just published.

Branch Build failing 🚨
Dependency coveralls
Current Version 3.0.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

coveralls is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Release Notes Additional CI support

Maintenance:

Commits

The new version differs by 9 commits.

  • e7ae2bf version bump; logger test fix
  • 9b892bf Verbose use log level debug
  • 9cfb496 Add buildkite support (#177)
  • aa8c257 Done callback waits for unlink in testRepoTokenDetection to prevent race condition (#179)
  • 18c71c2 Fix a mistype in tests: fs.exists -> fs.existsSync (#184)
  • bd667c6 Add Semaphore support (#180)
  • 10d8b3e Update examples to include Jest (#183)
  • 720ee7c Add license (#175)
  • 83ff2cb Add mention about AppVeyor to the README (#164)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.