sofyco/facebook-security-voter-bundle 问题修复 & 功能扩展

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

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

sofyco/facebook-security-voter-bundle

Composer 安装命令:

composer require sofyco/facebook-security-voter-bundle

包简介

Symfony Facebook Security Voter Bundle

README 文档

README

CI codecov stable

Installation

composer req sofyco/facebook-security-voter-bundle

Configuration

The bundle exposes a facebook_security_voter configuration node with two required, non-empty string arguments:

  • secret — Facebook App Secret; verifies the x-hub-signature-256 HMAC-SHA256 header on POST webhooks.
  • signature — verify token; verifies the hub_verify_token query parameter on GET verification requests.
# config/packages/facebook_security_voter.yaml
facebook_security_voter:
    secret: '%env(FACEBOOK_APP_SECRET)%'
    signature: '%env(FACEBOOK_VERIFY_TOKEN)%'

Both options are resolved into the FacebookWebhookVoter constructor ($secret and $signature); the RequestStack argument is autowired.

Usage

The bundle registers a security voter (FacebookWebhookVoter) that grants access when the current request is a legitimate Facebook webhook call:

  • GET requests are validated against the hub_verify_token query parameter;
  • POST requests are validated against the x-hub-signature-256 HMAC-SHA256 header.

Use the FacebookWebhookVoter::SIGNATURE attribute to protect a controller:

use Sofyco\Bundle\FacebookSecurityVoterBundle\Security\Voter\FacebookWebhookVoter;
use Symfony\Component\Security\Http\Attribute\IsGranted;

#[IsGranted(FacebookWebhookVoter::SIGNATURE)]
public function __invoke(): Response
{
    // ...
}

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-07-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固