nanaweb / github-listener-bundle
Installs: 8
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- ext-json: *
Requires (Dev)
- phpunit/phpunit: ^7.5
- symfony/annotations-pack: ^1.0
- symfony/framework-bundle: ~4.3
- symfony/security: ^4.3
- symfony/test-pack: ^1.0
- symfony/yaml: ^4.3
This package is auto-updated.
Last update: 2024-12-10 03:16:56 UTC
README
How to install
composer require nanaweb/github-listener-bundle:"~0.9"
Then, add Nanaweb\GithubListenerBundle\NanawebGithubListenerBundle
to your registered bundle list in AppKernel.
No configuration needed.
How to use
Create your own OperationRunner
class for github webhook events .
OperationRunners must implement Nanaweb\GithubListenerBundle\OperationRunner\OperationRunnerInterface
.
Register to Symfony DI Container with nanaweb_github_listener.operation_runner
tag with event
attribute like this:
services:
fake_operation_runner:
class: App\GithubListener\OperationRunner\MyOperationRunner
tags:
- { name: nanaweb_github_listener.operation_runner, event: pull_request }
How to secure your webhook
Configure your guard security setting with Nanaweb\GithubListenerBundle\Security\Guard\GithubWebhookAuthenticator
:
# config/packages/security.yaml
security:
# ...
firewalls:
# ...
main:
anonymous: ~
logout: ~
guard:
authenticators:
- Nanaweb\GithubListenerBundle\Security\Guard\GithubWebhookAuthenticator
And don't forget to add access_control configuration for ReceiveController:
# config/packages/security.yaml
security:
# ...
access_control:
- { path: ^/nanaweb-github-listener/receive, roles: ROLE_GITHUB_WEBHOOK }