mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-17 06:14:40 +00:00
fix(vultr): validate public network and token scope
Require IPv6 when public IPv4 is disabled, constrain cloud token lookup by team and provider during deletion, and encode Vultr instance IDs in API paths.
This commit is contained in:
1 parent
31f904ef9f
commit
6ed92cb97a
11 files changed
+448
-20
No files matched your search
@@ -153,19 +153,19 @@ class VultrService
|
||||
|
||||
public function getInstance(string $instanceId): array
|
||||
{
|
||||
$response = $this->request('get', "/instances/{$instanceId}");
|
||||
$response = $this->request('get', $this->instanceEndpoint($instanceId));
|
||||
|
||||
return $response['instance'] ?? [];
|
||||
}
|
||||
|
||||
public function startInstance(string $instanceId): array
|
||||
{
|
||||
return $this->request('post', "/instances/{$instanceId}/start");
|
||||
return $this->request('post', $this->instanceEndpoint($instanceId).'/start');
|
||||
}
|
||||
|
||||
public function deleteInstance(string $instanceId): void
|
||||
{
|
||||
$this->request('delete', "/instances/{$instanceId}");
|
||||
$this->request('delete', $this->instanceEndpoint($instanceId));
|
||||
}
|
||||
|
||||
public function getInstances(): array
|
||||
@@ -183,4 +183,9 @@ class VultrService
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private function instanceEndpoint(string $instanceId): string
|
||||
{
|
||||
return '/instances/'.rawurlencode($instanceId);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user