freyr / message-broker-webhook-http
HTTP webhook sender for freyr/message-broker: signed parallel requests (Standard Webhooks) with Symfony HttpClient
Package info
github.com/freyr/message-broker-webhook-http
pkg:composer/freyr/message-broker-webhook-http
Requires
- php: >=8.4
- freyr/message-broker: ^0.15
- psr/log: ^3.0
- symfony/clock: ^8.1
- symfony/http-client: ^8.1
- symfony/http-foundation: ^8.1
Requires (Dev)
- freyr/message-broker-storage-postgresql: ^0.1
- infection/infection: ^0.35.11
- phpunit/phpunit: ^13.4
Suggests
- ext-intl: Internationalized host names in subscription URLs (or symfony/polyfill-intl-idn)
- symfony/polyfill-intl-idn: Internationalized host names in subscription URLs, when ext-intl is not loaded
Provides
Conflicts
None
Replaces
None
README
This package is the HTTP webhook sender of the Freyr Message Broker library,
namespace Freyr\MessageBroker\Webhook\Http\.
The repository
freyr/message-broker-webhook-httpis a read-only copy of the folderwebhook/http/of freyr/message-broker. Development, issues and pull requests are in freyr/message-broker. A release has the tagwebhook-http-v<version>in freyr/message-broker and the tagv<version>infreyr/message-broker-webhook-http.
The adapter holds HttpDeliverySender, which implements the port
Webhook\DeliverySender of the core with Symfony HttpClient. It sends the
deliveries of one claim in parallel as POST requests, signs each request as
the Standard Webhooks specification says, follows no redirect, and refuses a
destination in a private network by default.
Requirements
- PHP 8.4 or later
freyr/message-broker^0.15 (the core)symfony/http-client^8.1 andsymfony/http-foundation^8.1psr/log^3.0- A storage adapter for the webhook deliveries, for example
freyr/message-broker-storage-postgresql
Install
composer require freyr/message-broker-webhook-http
Minimal wiring
use Freyr\MessageBroker\Webhook\Http\HttpDeliverySender; use Freyr\MessageBroker\Webhook\Http\HttpSenderConfig; $sender = new HttpDeliverySender(new HttpSenderConfig(), logger: $logger); // Give $sender to Webhook\DeliveryLoop of the core.
Documents
- HTTP sender: the request, the configuration, the results, the timeouts, the DNS allowance and its known limit, the connections
- Signature: the
webhook-headers, the secret, the verification by a receiver - Network rules: the private network rule, the proxy rule, the
httpsrule, no redirects - Webhooks: the model, the ports and the delivery loop of the core
- Webhook delivery storage: the PostgreSQL store of the deliveries
- Quickstart: a webhook example with the three packages
Tests
The functional tests need a test HTTP server and PostgreSQL; see Tests.