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:
@@ -0,0 +1,22 @@
|
||||
/*!
|
||||
* Copyright (c) 2024 PLANKA Software GmbH
|
||||
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
|
||||
*/
|
||||
|
||||
exports.up = (knex) =>
|
||||
knex.schema.alterTable('webhook', (table) => {
|
||||
table.bigInteger('project_id');
|
||||
table.bigInteger('user_id');
|
||||
|
||||
table.index('project_id');
|
||||
table.index('user_id');
|
||||
});
|
||||
|
||||
exports.down = (knex) =>
|
||||
knex.schema.alterTable('webhook', (table) => {
|
||||
table.dropIndex('user_id');
|
||||
table.dropIndex('project_id');
|
||||
|
||||
table.dropColumn('user_id');
|
||||
table.dropColumn('project_id');
|
||||
});
|
||||
Reference in New Issue
Block a user