* Expose workspace webhooks through the API and MCP. The same create/update/test/rotate/replay/delete flow now lives in Actions so the web UI, REST API, and MCP tools stay in lockstep. * Keep webhook validation local to each web, API, and MCP entry point. * Extract MCP webhook rules into request classes and close remaining API/MCP review gaps. * Tighten webhook updates to a field whitelist and reset failures only on re-enable. * Treat a mismatched webhook replay as not found and mark secret rotation destructive.
23 lines
483 B
PHP
23 lines
483 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Mcp\Requests\Webhook;
|
|
|
|
use App\Enums\Webhook\EventType;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class CreateWebhookRequest
|
|
{
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public static function rules(): array
|
|
{
|
|
return [
|
|
'endpoint' => ['required', 'url', 'max:255'],
|
|
'events' => ['required', 'array', 'min:1'],
|
|
'events.*' => ['string', Rule::enum(EventType::class)],
|
|
];
|
|
}
|
|
}
|