logentries-webhook-auth
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

Logentries Webhook Authentication Middleware for Express

CircleCI

Express middleware for logentries webhook api, written in typescript with types available.

Logentries documentation on webhooks

Usage

  const express = require('express');
  const bodyParser = require('body-parser');  // Optional.
  const logentriesWebhookAuth = require('logentries-webhook-auth');
  
  const app = express();
 
  // This step isn't necessary for authentication, but you'll want it 
  // if you want to parse the payload that LogEntries posts.
  app.use(bodyParser.urlencoded({
    extended: true
  }));
 
  // Use the middleware with a pre shared password.
  app.use(logentriesWebhookAuth('password'));
 
  // "user" is now available on request.logentriesWebhookAuth.user
  // "payload" is now available on request.body
 
  // ...Your routes here...
 
  app.listen(3000);

Development

  • npm install - Setup dependencies and build project
  • npm run build - Build source files manually
  • npm test - Run tests

Environment Variables

ENABLE_LOGENTRIES_WEBHOOK_AUTH_LOGGING : Enable logging from this middleware. This will log hashes and signatures, don't enable this in production.

/logentries-webhook-auth/

    Package Sidebar

    Install

    npm i logentries-webhook-auth

    Weekly Downloads

    1

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    22.5 kB

    Total Files

    20

    Last publish

    Collaborators

    • keeganj