feat(api): require POST for state-changing endpoints

Make start/stop/restart, deploy, enable/disable, and server validate
POST-only, with GET returning 405. Server validate accepts optional
install and uses ValidateAndInstallServerJob. Update OpenAPI and tests.
This commit is contained in:
Andras Bacsai committed 2026-07-19 11:42:04 +02:00
1 parent e2c2180f4f
commit 0633b543ee
16 files changed
+297 -605

No files matched your search

@@ -77,13 +77,13 @@ describe('POST /api/v1/servers', function () {
});
});
describe('GET /api/v1/servers/{uuid}/validate', function () {
describe('POST /api/v1/servers/{uuid}/validate', function () {
test('read-only token cannot trigger server validation', function () {
$token = $this->user->createToken('read-only', ['read']);
$response = $this->withHeaders([
'Authorization' => 'Bearer '.$token->plainTextToken,
])->getJson('/api/v1/servers/fake-uuid/validate');
])->postJson('/api/v1/servers/fake-uuid/validate');
$response->assertStatus(403);
});