Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@deshartman/check-bearer

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@deshartman/check-bearer - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

10

checkBearer.js
import jwt from 'jsonwebtoken';
/**
* This is a utility class that checks the HTTP header for a "Bearer: JWT" and compares the JWT validity against
* the Twilio API Key Secret. This is because Twilio JWTs are created using and API Key Secret, so a good way to secure
* a client bearer on the server side.
*
* Constructor:
* @param {string} headers - The HTTP headers containing authorization information.
* @param {string} secret - The Twilio API Key Secret.
*
*/
export default class CheckBearer {

@@ -4,0 +14,0 @@ constructor(headers = {}, secret = "") {

3

package.json
{
"name": "@deshartman/check-bearer",
"version": "1.0.0",
"version": "1.0.1",
"description": "Utility: Checks the Twilio token (JWT) in the Auth Bearer header using the Twilio API secret key",

@@ -11,2 +11,3 @@ "main": "checkBearer.js",

"license": "ISC",
"type": "module",
"dependencies": {

@@ -13,0 +14,0 @@ "jsonwebtoken": "^8.5.1"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc