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:
Andras Bacsai committed 2026-07-07 21:39:57 +02:00
1 parent 31f904ef9f
commit 6ed92cb97a
11 files changed
+448 -20

No files matched your search

+14
View File
@@ -150,3 +150,17 @@ it('handles empty successful responses from Vultr API', function () {
Http::assertSentCount(2);
});
it('encodes instance IDs in request paths', function () {
Http::fake([
'https://api.vultr.com/v2/instances/instance%2F1' => Http::response([
'instance' => ['id' => 'instance/1'],
], 200),
]);
$service = new VultrService('fake-token');
expect($service->getInstance('instance/1')['id'])->toBe('instance/1');
Http::assertSent(fn ($request) => $request->url() === 'https://api.vultr.com/v2/instances/instance%2F1');
});