mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
* Add more api helper functions to centralize code more * Enable cors * Initial Legacy route in Laravel * Force api v0 responses to json Add a couple more routes * more paths, pretty print the json response pass parameters to the api function * devices basic functions * Port generic graph function check permissions function accepts callback to avoid lots of if statements * move vlans * links * graphs * fdb * health * wireless * port graphs * ip functions split em up * port_stack * components * compoment add/edit/delete * get_device_groups * port stats * port graphs * get_devices_by_group * port_groups * api_get_graph * show_endpoints * get_bill * get_bill_graph * get_bill_graphdata * get_bill_history * get_bill_history_graph * remaining bill functions * list_alerts * ack/unmute alert * Some cleanups * Some cleanups * list_alert_rules * alert rule add/edit/delete * inventory * list_cbgp * vrf * list_ipsec * list_fdb * list_links (fix both usages) * list_locations * list_locations * list_vlans * list_ip_addresses * list_arp * list_ip_networks * cleanup * services * list_logs and fix authlog....... * cleanup * cleanup 2 * remove slim * don't load schema more than once * basic test * fix style * downgrade laravel-cors to a version that supports PHP 7.1
100 lines
3.4 KiB
PHP
100 lines
3.4 KiB
PHP
<?php
|
|
|
|
namespace App\Http;
|
|
|
|
use App\Checks;
|
|
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
|
|
|
class Kernel extends HttpKernel
|
|
{
|
|
/**
|
|
* The application's global HTTP middleware stack.
|
|
*
|
|
* These middleware are run during every request to your application.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $middleware = [
|
|
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
|
|
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
|
|
\App\Http\Middleware\TrimStrings::class,
|
|
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
|
|
\Fideloper\Proxy\TrustProxies::class,
|
|
];
|
|
|
|
/**
|
|
* The application's route middleware groups.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $middlewareGroups = [
|
|
'web' => [
|
|
\App\Http\Middleware\CheckInstalled::class,
|
|
\App\Http\Middleware\EncryptCookies::class,
|
|
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
|
|
\Illuminate\Session\Middleware\StartSession::class,
|
|
// \Illuminate\Session\Middleware\AuthenticateSession::class,
|
|
\App\Http\Middleware\SetLocale::class,
|
|
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
|
\App\Http\Middleware\VerifyCsrfToken::class,
|
|
\App\Http\Middleware\LegacyExternalAuth::class,
|
|
\App\Http\Middleware\LegacySession::class,
|
|
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
|
],
|
|
|
|
'minimal' => [
|
|
\App\Http\Middleware\EncryptCookies::class,
|
|
\Illuminate\Session\Middleware\StartSession::class,
|
|
],
|
|
|
|
'api' => [
|
|
'bindings',
|
|
'auth:token',
|
|
\Spatie\Cors\Cors::class,
|
|
],
|
|
];
|
|
|
|
/**
|
|
* The application's route middleware.
|
|
*
|
|
* These middleware may be assigned to groups or used individually.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $routeMiddleware = [
|
|
'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
|
|
'2fa' => \App\Http\Middleware\VerifyTwoFactor::class,
|
|
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
|
|
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
|
|
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
|
|
'can' => \Illuminate\Auth\Middleware\Authorize::class,
|
|
'deny-demo' => \App\Http\Middleware\DenyDemoUser::class,
|
|
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
|
|
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
|
|
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
|
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
|
];
|
|
|
|
/**
|
|
* The priority-sorted list of middleware.
|
|
*
|
|
* This forces non-global middleware to always be in the given order.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $middlewarePriority = [
|
|
\Illuminate\Session\Middleware\StartSession::class,
|
|
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
|
\Illuminate\Auth\Middleware\Authenticate::class,
|
|
\Illuminate\Session\Middleware\AuthenticateSession::class,
|
|
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
|
\Illuminate\Auth\Middleware\Authorize::class,
|
|
];
|
|
|
|
public function bootstrap()
|
|
{
|
|
Checks::preBoot();
|
|
parent::bootstrap();
|
|
}
|
|
}
|