Adds raw body information (body as buffer, encoding)
to `RequestDetails` to support more request validation
use cases.
Additionally, uses the raw body to retrieve the transmitted
JSON string unparsed/raw to correctly validate the signature.
Previously, we re-stringified the parsed JSON payload
which could lead to different JSON strings.
Those differences can lead to the rejection of requests
due to a mismatch in expected signature.
Fixes: #26709
Relates-to: PR #26884
Co-authored-by: Christopher Diaz <cdiaz@rvohealth.com>
Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
Add `createGithubSignatureValidator(config)` which can be used
to create a validator used at an ingress for topic `github`.
On top, there is a new `githubWebhookEventsModule` for the new backend plugin API
which auto-registers the `HttpPostIngress` for topic `github` incl. the validator.
Relates-to: PR #13931
Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
Add an event router for GitHub
which handles events from the topic `github`
and re-publishes events under their more specific topic
based on the `x-github-event` metadata
like e.g., `github.push`.
Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>