lemonphp/webhook-shield
Composer 安装命令:
composer require lemonphp/webhook-shield
包简介
Protects against unverified webhooks from 3rd party services
README 文档
README
Protects against unverified webhooks from 3rd party services.
Features
- 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
Requirements
- php >=7.1
Installation
Begin by pulling in the package through Composer.
$ composer require lemonphp/webhook-shield
Usage
Slim 4
-
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.phpwith 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();
Changelog
See all change logs in CHANGELOG
Testing
$ git clone git@github.com/lemonphp/webhook-shield.git /path $ cd /path $ composer install $ composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email to Oanh Nguyen instead of using the issue tracker.
Credits
License
This project is released under the MIT License.
Copyright © 2019 LemonPHP Team.
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-01-10