lambda-github-webhook-validator

1.0.0 • Public • Published

NPM version Build status Coverage Status

Github request validator for AWS Lambda

Validates a github webhook event is correct. It will check the signature and all releveants headers that should exist.

Development

Install dependecies

yarn install

Tests

yarn test

How to use

The validator will call the lambda callback a response and return false if it fails to verify at any point the github request.

The responses are listed below:

  • 401 - No github signature found on request
  • 401 - Github signature does not match
  • 422 - Not a valid github event
 
const GithubWebhookValidator = require('lambda-github-webhook-validator');
 
const validator = GithubWebhookValidator({ secret: aSecret });
 
module.exports.handler = function(event, context, callback) => {
  if (validator.isSignatureValid(event, callback) {
      // Do work
  }
}
 

Readme

Keywords

none

Package Sidebar

Install

npm i lambda-github-webhook-validator

Weekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • mdedys