feat(#3255): receive swarm-wide forge webhooks in the controller

A Forgejo webhook has one target_url, so every hive registering the same
swarm-wide hooks is last-writer-wins rather than idempotent. The controller
is the only swarm-wide thing in the deployment, so it becomes the receiver.

It verifies the HMAC and treats the payload as opaque bytes keyed by the hook
kind in the URL path; it deliberately does not parse the payload, because the
hives' existing handlers already decide what a delivery means.

Nothing is registered against the endpoint yet. The replacement path is built
and observable before anything takes the old one away, so the swarm's single
target_url never points at a receiver that forwards nowhere.
This commit is contained in:
atlas 2026-08-17 23:10:43 +02:00 committed by mara
commit b2596097d8
4 changed files with 550 additions and 0 deletions

2
Cargo.lock generated
View file

@ -4605,10 +4605,12 @@ dependencies = [
"hive-jobq",
"hive-jobq-wire",
"hive-types",
"hmac 0.13.0",
"problem_details",
"reqwest 0.13.1",
"serde",
"serde_json",
"sha2 0.11.0",
"swarm-authelia-bridge-sock",
"swarm-queue-client",
"tokio",