Protects against unverified webhooks from 3rd party services.
- Compatible with PSR-7, PSR-15 and PSR-17
- No dependencies
- Supported drivers
- Bitbucket
- Github
- Gitlab
- Mailgun
- Shopify
- Trello
- Coding style follow PSR-2, PSR-4
- php >=7.1
Begin by pulling in the package through Composer.
$ composer require lemonphp/webhook-shield
-
Installation Slim application follow link http://www.slimframework.com/docs/v4/start/installation.html
$ composer require slim/slim slim/psr7 lemonphp/webhook-shield
-
Make
public/index.php
with below content<?php use Lemon\WebhookShield\ServiceProfiles\Facebook; use Lemon\WebhookShield\WebhookShieldMiddleware; use Psr\Http\Message\ResponseInterface as Response; use Psr\Http\Message\ServerRequestInterface as Request; use Slim\Factory\AppFactory; require __DIR__ . '/../vendor/autoload.php'; $app = AppFactory::create(); $shield = new WebhookShieldMiddleware(new Facebook('secret'), $app->getResponseFactory()); $app->post('/webhook/facebook', function (Request $req, Response $res, $args) { // TODO: Add webhook event to message queue return $res->withStatus(200, 'OK'); })->add($shield); // other routes $app->run();
See all change logs in CHANGELOG
$ git clone [email protected]/lemonphp/webhook-shield.git /path
$ cd /path
$ composer install
$ composer test
Please see CONTRIBUTING for details.
If you discover any security related issues, please email to Oanh Nguyen instead of using the issue tracker.
This project is released under the MIT License.
Copyright © 2019 LemonPHP Team.