PHPackages                             swop/github-webhook-middleware - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. swop/github-webhook-middleware

ActiveLibrary[Security](/categories/security)

swop/github-webhook-middleware
==============================

PSR-7 style &amp; PSR-15 compatible middleware which will verify if the incoming GitHub web hook request is correctly signed.

v1.0(9y ago)1351MITPHPPHP &gt;=5.4

Since Nov 22Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Swop/github-webhook-middleware)[ Packagist](https://packagist.org/packages/swop/github-webhook-middleware)[ RSS](/packages/swop-github-webhook-middleware/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (5)Versions (3)Used By (0)

Github WebHook PSR-7 / PSR-15 middleware
========================================

[](#github-webhook-psr-7--psr-15-middleware)

[![Build Status](https://camo.githubusercontent.com/97d1ef4bf8015b26fe83c01f384642980ba7f66ff8d308935a6a044f023d5395/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f53776f702f6769746875622d776562686f6f6b2d6d6964646c65776172652e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/Swop/github-webhook-middleware)

This library offers a PSR-7 style &amp; PSR-15 middleware which will verify if the incoming GitHub web hook request is correctly signed.

The provided PSR-7 request will have its `X-Hub-Signature` header checked in order to see if the request was originally performed by GitHub using the correct secret to sign the request.

If the request signature validation fails, a `401` JSON response will be send back.

Installation
------------

[](#installation)

The recommended way to install this library is through [Composer](https://getcomposer.org/):

```
composer require "swop/github-webhook-middleware"

```

Usage
-----

[](#usage)

### Ex: PSR-7 style middleware using Zend Diactoros Server

[](#ex-psr-7-style-middleware-using-zend-diactoros-server)

```
