mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-12 15:53:46 -04:00
fix(mcp): return only service fields from get_service
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
5ff94dbd7a
commit
a44193b6e4
@@ -0,0 +1,4 @@
|
||||
---
|
||||
type: security
|
||||
---
|
||||
Removed the server details from the response of the `get_service` MCP tool
|
||||
@@ -46,7 +46,7 @@ class GetService extends Tool
|
||||
}
|
||||
|
||||
$service->setRelations([]);
|
||||
$service->makeHidden(['destination', 'source', 'environment', 'applications', 'databases', 'serviceApplications', 'serviceDatabases']);
|
||||
$service->makeHidden(['server', 'destination', 'source', 'environment', 'applications', 'databases', 'serviceApplications', 'serviceDatabases']);
|
||||
|
||||
return $this->mcpSuccess($request, $this->respond(
|
||||
$this->scrubSensitive($service->toArray()),
|
||||
|
||||
@@ -2675,3 +2675,21 @@ test('redactLogText redacts JSON secret fields in log lines', function () {
|
||||
->and($mixed)->not->toContain('redactme03')
|
||||
->and($mixed)->toContain(REDACTED);
|
||||
});
|
||||
|
||||
test('get_service does not return the server of the service', function () {
|
||||
$service = Service::factory()->create([
|
||||
'environment_id' => $this->environment->id,
|
||||
'server_id' => $this->server->id,
|
||||
'destination_id' => $this->destination->id,
|
||||
'destination_type' => $this->destination->getMorphClass(),
|
||||
]);
|
||||
|
||||
$response = mcpReadCall('get_service', ['uuid' => $service->uuid]);
|
||||
$response->assertOk();
|
||||
$data = mcpReadJson($response)['data'];
|
||||
|
||||
expect($data['uuid'])->toBe($service->uuid)
|
||||
->and($data)->toHaveKey('server_status')
|
||||
->and($data)->not->toHaveKey('server')
|
||||
->and(json_encode($data))->not->toContain($this->server->ip);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user