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

hapi-gitlab-webhooks

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-gitlab-webhooks

A Hapi plugin for receiving requests from the GitLab webhooks API.

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

hapi-gitlab-webhooks

Github version here: node-github-webhook.

Description

npm version Build Status Dependency Status Dev Dependency Status Peer Dependency Status

An authentication strategy plugin for hapi for validating webhook requests from Gitlab. This strategy validates the payload with the signature sent with the request.

The 'gitlabwebhook' scheme takes the following options:

  • secret - (required) the token configured for the webhook (never share or commit this to your project!)

Usage

var hapi = require('hapi');
var gitlabWebhooksPlugin = require('hapi-gitlab-webhooks');
var token = 'SomeUnsharedSecretToken';
var server = new hapi.Server();

server.connection({
    host: host,
    port: port
});

server.register(gitlabWebhooksPlugin, function (err) {
  // Register gitlab webhook auth strategy
  server.auth.strategy('gitlabwebhook', 'gitlabwebhook', { secret: token});
  // Apply the strategy to the route that handles webhooks
  server.route([
    {
      method: 'POST',
      path: '/webhooks/gitlab',
      config: {
          auth: {
              strategies: ['gitlabwebhook'],
              payload: 'required'
          }
      },
      handler: function(request, reply) {
        // request.payload is the validated payload from Gitlab
        reply();
      }
    }
  ]);
});

Keywords

FAQs

Package last updated on 31 Jan 2018

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

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