🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@ovos-media/sign-helpers

Package Overview
Dependencies
Maintainers
13
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ovos-media/sign-helpers

Helpers for sign service.

latest
Source
npmnpm
Version
2.2.1
Version published
Maintainers
13
Created
Source

@ovos-media/sign-helpers

Helpers for signed resources.

Usage

const makeVerifyRequest = require('@ovos-media/sign-helpers').verifyRequest;

const verifyRequest = makeVerifyRequest({
  basePath: process.env.SERVICE_PATH,
  path(ctx) { return ctx.request.url; },
  parseReferer: true, // this is a default, can be overwritten optional
  refererRegex: /https?:\/\/[a-zA-Z0-9\.\:]*(.*)\// // this is a default, can be overwritten optional
});

const work = (ctx) => {
  const credentials = verifyRequest(ctx);

  if (credentials) {
    ctx.status = 200;
  } else {
    ctx.status = 401;
  }
}

router.get('/url', work);

Contributors

created at ovos with ♥

FAQs

Package last updated on 08 Apr 2021

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