Issue Feature Under Review

#111024Allow webhook messages to target specific webhooks

Josua Vogel 10/12/26, 06:12 updated 11/15/26, 16:16

Description

EXT:webhooks delivers every webhook message to all sys_webhook records configured for the message’s trigger. The code dispatching a message has no way to restrict delivery to a subset of these records.

This is fine for system-wide triggers like “login error” or “file added”, where every configured endpoint is interested in every occurrence. It is not sufficient for triggers whose payload belongs to a specific configuration in the backend – for example a form submission, where an editor wants the data of one particular form to reach one particular endpoint, and personal data must not be sent to endpoints that are not supposed to receive it.

Introduce TYPO3\CMS\Core\Messaging\TargetedWebhookMessageInterface, extending WebhookMessageInterface, with one method:

public function getTargetWebhookIdentifiers(): array;

returning the identifiers (UUIDs) of the sys_webhook records the message is meant for.

WebhookMessageHandler checks for the interface. If a message implements it, only records that
  • are configured for the message’s trigger,
  • are active (default restrictions), and
  • have an identifier listed by the message
    receive the request.

Following rules may apply:

  • An empty list delivers nothing (fail-closed).
  • Identifiers of records configured for another trigger are ignored, so the payload of one trigger can never reach an endpoint configured for another.
  • Listed identifiers without a matching active record are skipped and logged as a warning.
  • Messages that do not implement the interface are delivered exactly as before.

The target identifiers are properties of the message, not part of the JSON body, and survive serialization when the message is routed to an asynchronous transport.

Reviews 2

History 14