craftcms / craftcms/webhooks

Add event to customize webhook request data

Open
#87 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
84
Forks
12
PR merge metrics
No merged PRs in 30d

Description

It would be great if an event can be added that allows to customize the data before a webhook request is queued up. For example to change the headers and body of the webhook request.

This would allow to set a hashed signature of the webhook as header, based on the body data. Like the commonly used hash_hmac('sha256', $rawRequestContent, 'secretKey'); header as signature.

Currently the webhooks plugin doesn't offer an option to set this, or offering an event to set via custom code. So by having the event this and other customizations can take place.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the webhook request construction and queuing path described in the issue. Done means an event is available before queuing so custom code can change both request headers and body, including adding a signature header.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.