PHPackages                             swop/stack-github-webhook - 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/stack-github-webhook

Abandoned → [swop/github-webhook-stackphp](/?search=swop%2Fgithub-webhook-stackphp)Library[Security](/categories/security)

swop/stack-github-webhook
=========================

Stack middleware which will verify if the incoming GitHub web hook request is correctly signed.

v1.1(9y ago)81.0kMITPHPPHP &gt;=5.3.3

Since Oct 29Pushed 9y ago1 watchersCompare

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

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

Github WebHook Stack middleware
===============================

[](#github-webhook-stack-middleware)

[![Build Status](https://camo.githubusercontent.com/0f21368d69534a209b63c85e32b8648ebafcd52b00c6317060bb7e0b8469d50c/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f53776f702f6769746875622d776562686f6f6b2d737461636b7068702e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/Swop/github-webhook-stackphp)

[Stack](http://stackphp.com) middleware to restrict application access to GitHub Event bot with signed payload.

Every incoming request will see its `X-Hub-Signature` header checked in order to validate that the request was originally performed by GitHub. Any requests which doesn't have correct signature will lead to a `401 Unauthorized` JSON response.

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

[](#installation)

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

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

```

Usage
-----

[](#usage)

### Silex example

[](#silex-example)

```
require __DIR__ . '/../vendor/autoload.php';

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

$app = new \Silex\Application();

$app->get('/', function(Request $request) {
    return new Response('Hello world!', 200);
});

$app = (new \Stack\Builder())
    ->push('Swop\GitHubWebHookStackPHP\GitHubWebHook', 'my_secret')
    ->resolve($app)
;

$request = Request::createFromGlobals();
$response = $app->handle($request)->send();

$app->terminate($request, $response);
```

### Symfony example

[](#symfony-example)

```
# web/app_dev.php

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Debug\Debug;

$loader = require_once __DIR__.'/../app/bootstrap.php.cache';
Debug::enable();

require_once __DIR__.'/../app/AppKernel.php';

$kernel = new AppKernel('dev', true);
$kernel->loadClassCache();

$stack = (new Stack\Builder())
    ->push('Swop\GitHubWebHookStackPHP\GitHubWebHook', 'my_secret')
;

$kernel = $stack->resolve($kernel);

Request::enableHttpMethodParameterOverride();
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
```

Contributing
------------

[](#contributing)

See [CONTRIBUTING](https://github.com/Swop/github-webhook-stackphp.png/blob/master/CONTRIBUTING.md) file.

Original Credits
----------------

[](#original-credits)

- [Sylvain MAUDUIT](https://github.com/Swop) ([@Swop](https://twitter.com/Swop)) as main author.

License
-------

[](#license)

This library is released under the MIT license. See the complete license in the bundled [LICENSE](https://github.com/Swop/github-webhook-stackphp.png/blob/master/LICENSE) file.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~248 days

Total

4

Last Release

3476d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b11bc8aee9703f3ce974c4fb4698be1d390a21e1a51ac03b61fa7397980b40ad?d=identicon)[Swop](/maintainers/Swop)

---

Top Contributors

[![Swop](https://avatars.githubusercontent.com/u/545340?v=4)](https://github.com/Swop "Swop (16 commits)")

---

Tags

stackgithubwebhookstack middleware

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/swop-stack-github-webhook/health.svg)

```
[![Health](https://phpackages.com/badges/swop-stack-github-webhook/health.svg)](https://phpackages.com/packages/swop-stack-github-webhook)
```

###  Alternatives

[alsar/stack-ip-restrict

Stack middleware for allowing application access for specific IP addresses

314.9k](/packages/alsar-stack-ip-restrict)[swop/github-webhook

Library which deals with incoming GitHub web hooks requests (signature validation &amp; payload parsing)

1119.5k4](/packages/swop-github-webhook)[lorddashme/php-simple-captcha

A simple captcha package that fit to any type of web application built on php.

102.9k](/packages/lorddashme-php-simple-captcha)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
