Logentries Webhook Authentication Middleware for Express
Express middleware for logentries webhook api, written in typescript with types available.
Logentries documentation on webhooks
Usage
const express = ; const bodyParser = ; // Optional. const logentriesWebhookAuth = ; const app = ; // This step isn't necessary for authentication, but you'll want it // if you want to parse the payload that LogEntries posts. app; // Use the middleware with a pre shared password. app; // "user" is now available on request.logentriesWebhookAuth.user // "payload" is now available on request.body // ...Your routes here... app;
Development
npm install
- Setup dependencies and build projectnpm run build
- Build source files manuallynpm 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.