feat: filter webhooks per project, board, and account

Adds optional project, board, and acting-user scope to each webhook so
events from a specific board or project can be routed to a single
endpoint without an external automation tool in the middle (closes
#1457).

A webhook now fires for an event only when every set scope matches:
empty scope still means "fire for everything", keeping existing
webhooks working unchanged. Scope filtering is centralized in the
sendWebhooks helper, which auto-derives projectId/boardId from the
event payload, so existing call sites are untouched.
This commit is contained in:
Symon
2026-05-02 10:31:30 +03:00
parent a8dcd7cef3
commit 05979a460f
12 changed files with 446 additions and 131 deletions
+10
View File
@@ -18,11 +18,21 @@ export default class extends BaseModel {
accessToken: attr(),
events: attr(),
excludedEvents: attr(),
projectId: fk({
to: 'Project',
as: 'project',
relatedName: 'webhooks',
}),
boardId: fk({
to: 'Board',
as: 'board',
relatedName: 'webhooks',
}),
userId: fk({
to: 'User',
as: 'user',
relatedName: 'webhooks',
}),
};
static reducer({ type, payload }, Webhook) {