api.php 2.2 KB
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
return new \App\Http\Resources\UserResource($request->user());
});

Route::group(['middleware' => 'guest:api'], function () {
Route::post('login', 'Auth\LoginController@login');
});

Route::group(['middleware' => 'auth:api'], function () {
Route::post('logout', 'Auth\LoginController@logout');


Route::group(['middleware' => 'admin'], function () {
Route::get('capec', 'CapecController@index');
});

Route::group(['prefix' => 'v1'], function () {

Route::post('adt', 'V1\Partners\AdtController@store');
Route::post('xlsiem', 'V1\Partners\XlsiemController@store');

Route::group(['prefix' => 'ceptd', 'middleware' => 'admin'], function () {
Route::get('start', 'V1\Components\CeptdController@start');
Route::get('status', 'V1\Components\CeptdController@status');
Route::get('stop', 'V1\Components\CeptdController@stop');
});
Route::group(['prefix' => 'mltd', 'middleware' => 'admin'], function () {
Route::get('start', 'V1\Components\MltdController@start');
Route::get('status', 'V1\Components\MltdController@status');
Route::get('stop/{pid}', 'V1\Components\MltdController@stop');
Route::get('{train_id}/{top}', 'V1\Components\MltdController@train');
});
Route::group(['prefix' => 'od', 'middleware' => 'admin'], function () {
Route::get('start', 'V1\Components\OdController@start');
Route::get('status', 'V1\Components\OdController@status');
Route::get('stop/{pid}', 'V1\Components\OdController@stop');
Route::post('analyze/{pid}', 'V1\Components\OdController@analyze');
});
});
});