Update allocations to support ids; protect endpoints; support notes

This commit is contained in:
Dane Everitt 2020-07-09 20:36:08 -07:00
parent 9c3b9a0fae
commit 2278927fb6
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
19 changed files with 217 additions and 62 deletions

View file

@ -2,6 +2,7 @@
use Illuminate\Support\Facades\Route;
use Pterodactyl\Http\Middleware\Api\Client\Server\AuthenticateServerAccess;
use Pterodactyl\Http\Middleware\Api\Client\Server\AllocationBelongsToServer;
/*
|--------------------------------------------------------------------------
@ -74,9 +75,11 @@ Route::group(['prefix' => '/servers/{server}', 'middleware' => [AuthenticateServ
Route::delete('/{schedule}/tasks/{task}', 'Servers\ScheduleTaskController@delete');
});
Route::group(['prefix' => '/network'], function () {
Route::get('/', 'Servers\NetworkController@index');
Route::put('/primary', 'Servers\NetworkController@storePrimary');
Route::group(['prefix' => '/network', 'middleware' => [AllocationBelongsToServer::class]], function () {
Route::get('/allocations', 'Servers\NetworkAllocationController@index');
Route::post('/allocations/{allocation}', 'Servers\NetworkAllocationController@update');
Route::post('/allocations/{allocation}/primary', 'Servers\NetworkAllocationController@setPrimary');
Route::delete('/allocations/{allocation}', 'Servers\NetworkAllocationController@delete');
});
Route::group(['prefix' => '/users'], function () {