swop/github-webhook 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

swop/github-webhook

最新稳定版本:v3.1

Composer 安装命令:

composer require swop/github-webhook

包简介

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

README 文档

README

Build Status

This library offers a set of tools which could become handy when dealing with GitHub web hook requests.

Installation

The recommended way to install this library is through Composer:

composer require "swop/github-webhook"

Usage

Payload signature checking

The SignatureValidator will verify if the incoming GitHub web hook request is correctly signed.

use Swop\GitHubWebHook\Security\SignatureValidator;

$validator = new SignatureValidator();

/** @var \Psr\Http\Message\ServerRequestInterface $request */
if ($validator->validate($request, 'secret')) {
    // Request is correctly signed
}

GitHub event object creation

The GitHubEventFactory can build GitHubEvent objects representing the GitHub event.

use Swop\GitHubWebHook\Event\GitHubEventFactory;

$factory = new GitHubEventFactory();

/** @var \Psr\Http\Message\ServerRequestInterface $request */
$gitHubEvent = $factory->buildFromRequest(RequestInterface $request);

$gitHubEvent->getType(); // Event type
$gitHubEvent->getPayload(); // Event deserialized payload

Contributing

See CONTRIBUTING file.

Original Credits

License

This library is released under the MIT license. See the complete license in the bundled LICENSE file.

统计信息

  • 总下载量: 19.13k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 11
  • 点击次数: 1
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

  • Stars: 11
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-11-21