Webhooks: name the tenant in the signed body, so one renderer can bind a delivery to its tenant
- Dominant language
- C#
- Stars
- 6
- Forks
- 7
- Avg merge
- 4h 42m
- Merged PRs (30d)
- 307
Description
Raised in review of BaryoDev/barakoPress#31, where one barakoPress container serves several tenants. barakoCMS signs change webhooks over `timestamp.body`, and the payload does not name the tenant. barakoPress therefore resolves the tenant from the request host, and a valid signature for one tenant's delivery cannot be told apart from the same body replayed at another tenant's domain on the same container. Signed webhooks require https, which limits who can capture one, but the signature itself should bind the tenant.
## Change
- Every change event delivery includes the tenant handle in its body, and the signed string stays `timestamp.body`, so the tenant is covered by the signature.
- A delivery also carries the tenant in a header for routing, and receivers are documented to trust only the signed body's value.
- docs/webhooks.md describes the field and the check, and barakoPress's revalidate route refuses a body whose tenant is not the tenant it resolved for the host (follow-up there once this ships).
## Done when
- A delivery's body names its tenant, a test proves the signature changes when the tenant changes, and existing receivers that ignore the new field keep working.
## Where it lives
Core: webhook delivery and signing.
Contributor guide
Research direction
Start by locating the core webhook delivery and signing code, then read docs/webhooks.md for the documented payload and verification behavior. Add coverage for the tenant changing the signature while preserving receivers that ignore the new field, and confirm the delivery body and routing header meet the listed done conditions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api, backend, security
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100