* 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.
29 lines
816 B
PHP
29 lines
816 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Resources\Api;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class WebhookLogResource extends JsonResource
|
|
{
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'event_type' => $this->event_type,
|
|
'payload' => $this->payload,
|
|
'response_status' => $this->response_status,
|
|
'response_body' => $this->response_body,
|
|
'delivered_at' => $this->delivered_at?->toIso8601String(),
|
|
'failed_at' => $this->failed_at?->toIso8601String(),
|
|
'attempts' => $this->attempts,
|
|
'created_at' => $this->created_at->toIso8601String(),
|
|
];
|
|
}
|
|
}
|