New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@cuties/jwt

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cuties/jwt

Cutie extension for generating and validating JWT for authentication.

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

cutie-jwt

NPM Version Build Status codecov

Cutie extension for generating and validating JWT. It's based on the Async Tree Pattern.

Examples

You can find examples of using this library in the test directory.

Install

npm install @cuties/jwt

Run test

npm test

Run build

npm run build

Async objects

GeneratedHS256JWT(payload, secret[, minutesFromNow])

Generates JWT using HS256 algorithm. You can also use parameter minutesFromNow to set expiration time to payload(payload object will not be changed, it will be copied with set exp property).

IsHS256JWTValid(token, secret)

Validates token by secret. If it's valid this async object represents true, otherwise it represents false.

GeneratedRS256JWT(payload, privateKey[, minutesFromNow])

Generates JWT using RS256 algorithm. You can also use parameter minutesFromNow to set expiration time to payload(payload object will not be changed, it will be copied with set exp property).

IsRS256JWTValid(token, publicKey)

Validates token by publicKey. If it's valid this async object represents true, otherwise it represents false.

JWTOfRequest(request[, tokenName])

Retrieves JWT from Authorization header of incoming request parsing by tokenName(by default it's Bearer).

JWTPayload(token)

Retrieves payload from token.

JWTPayloadValue(token, key)

Retrieves payload value from token by key.

Keywords

async

FAQs

Package last updated on 11 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts