Implement Discord webhook delivery #59

Merged
Twyco merged 3 commits from codex/v0.5-webhook-notification/05-discord-webhook-delivery into main 2026-04-24 16:50:18 +00:00
2 changed files with 6 additions and 0 deletions
Showing only changes of commit bd2355b7cd - Show all commits
@@ -272,6 +272,9 @@ class DeliverNotificationAction implements ShouldQueue
->timeout(10) ->timeout(10)
->post($notificationAction->delivery_url, [ ->post($notificationAction->delivery_url, [
'content' => $message, 'content' => $message,
Review

Should fix: Discord receives rendered ticket data from user-controlled fields ($ticket_title, $project_name, $actor_name) as raw content. Without allowed_mentions, values like @everyone / <@&role> will create real pings and enable mention-spam. Please include an explicit allowed_mentions policy (for example { "parse": [] }) or sanitize mention tokens before sending.

**Should fix:** Discord receives rendered ticket data from user-controlled fields (`$ticket_title`, `$project_name`, `$actor_name`) as raw `content`. Without `allowed_mentions`, values like `@everyone` / `<@&role>` will create real pings and enable mention-spam. Please include an explicit `allowed_mentions` policy (for example `{ "parse": [] }`) or sanitize mention tokens before sending.
'allowed_mentions' => [
'parse' => [],
],
]); ]);
} }
@@ -89,6 +89,9 @@ class DeliverNotificationActionTest extends TestCase
&& $request->hasHeader('Content-Type', 'application/json') && $request->hasHeader('Content-Type', 'application/json')
&& $request->data() === [ && $request->data() === [
'content' => 'CORE-42 moved from Backlog to Doing by Erica Example: https://kanbangit.test/projects/core/tickets/42 ($unknown)', 'content' => 'CORE-42 moved from Backlog to Doing by Erica Example: https://kanbangit.test/projects/core/tickets/42 ($unknown)',
'allowed_mentions' => [
'parse' => [],
],
]; ];
}); });