mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-14 06:17:36 +00:00
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:
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);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user