2015-12-06 18:58:49 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Http;
|
|
|
|
|
2017-09-24 01:45:25 +00:00
|
|
|
use Pterodactyl\Http\Middleware\DaemonAuthenticate;
|
2015-12-06 18:58:49 +00:00
|
|
|
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
2017-09-24 01:45:25 +00:00
|
|
|
use Illuminate\Routing\Middleware\SubstituteBindings;
|
2017-10-19 03:32:19 +00:00
|
|
|
use Pterodactyl\Http\Middleware\Server\SubuserBelongsToServer;
|
|
|
|
use Pterodactyl\Http\Middleware\Server\DatabaseBelongsToServer;
|
|
|
|
use Pterodactyl\Http\Middleware\Server\ScheduleBelongsToServer;
|
2015-12-06 18:58:49 +00:00
|
|
|
|
|
|
|
class Kernel extends HttpKernel
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The application's global HTTP middleware stack.
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
protected $middleware = [
|
|
|
|
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
|
|
|
|
\Pterodactyl\Http\Middleware\EncryptCookies::class,
|
|
|
|
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
|
2017-04-02 01:01:10 +00:00
|
|
|
\Pterodactyl\Http\Middleware\TrimStrings::class,
|
2017-02-01 19:31:24 +00:00
|
|
|
|
2017-04-02 01:01:10 +00:00
|
|
|
/*
|
|
|
|
* Custom middleware applied to all routes.
|
|
|
|
*/
|
2017-02-01 19:10:28 +00:00
|
|
|
\Fideloper\Proxy\TrustProxies::class,
|
2015-12-06 18:58:49 +00:00
|
|
|
];
|
|
|
|
|
2016-09-03 21:09:00 +00:00
|
|
|
/**
|
|
|
|
* The application's route middleware groups.
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
protected $middlewareGroups = [
|
|
|
|
'web' => [
|
|
|
|
\Pterodactyl\Http\Middleware\EncryptCookies::class,
|
|
|
|
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
|
|
|
|
\Illuminate\Session\Middleware\StartSession::class,
|
|
|
|
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
|
|
|
\Pterodactyl\Http\Middleware\VerifyCsrfToken::class,
|
|
|
|
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
2017-04-02 01:01:10 +00:00
|
|
|
\Pterodactyl\Http\Middleware\LanguageMiddleware::class,
|
2017-09-26 01:58:16 +00:00
|
|
|
\Pterodactyl\Http\Middleware\RequireTwoFactorAuthentication::class,
|
2016-09-03 21:09:00 +00:00
|
|
|
],
|
|
|
|
'api' => [
|
2017-04-02 04:11:52 +00:00
|
|
|
\Pterodactyl\Http\Middleware\HMACAuthorization::class,
|
2016-09-03 21:09:00 +00:00
|
|
|
'throttle:60,1',
|
|
|
|
'bindings',
|
|
|
|
],
|
2017-09-24 01:45:25 +00:00
|
|
|
'daemon' => [
|
|
|
|
\Pterodactyl\Http\Middleware\Daemon\DaemonAuthenticate::class,
|
|
|
|
SubstituteBindings::class,
|
|
|
|
],
|
2016-09-03 21:09:00 +00:00
|
|
|
];
|
|
|
|
|
2015-12-06 18:58:49 +00:00
|
|
|
/**
|
|
|
|
* The application's route middleware.
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
protected $routeMiddleware = [
|
2016-09-03 21:09:00 +00:00
|
|
|
'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
|
2015-12-06 18:58:49 +00:00
|
|
|
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
|
|
|
|
'guest' => \Pterodactyl\Http\Middleware\RedirectIfAuthenticated::class,
|
2017-09-03 02:35:33 +00:00
|
|
|
'server' => \Pterodactyl\Http\Middleware\ServerAuthenticate::class,
|
2017-09-25 01:27:57 +00:00
|
|
|
'subuser.auth' => \Pterodactyl\Http\Middleware\SubuserAccessAuthenticate::class,
|
2015-12-06 18:58:49 +00:00
|
|
|
'admin' => \Pterodactyl\Http\Middleware\AdminAuthenticate::class,
|
2017-09-24 01:45:25 +00:00
|
|
|
'daemon-old' => DaemonAuthenticate::class,
|
2016-01-12 06:05:44 +00:00
|
|
|
'csrf' => \Pterodactyl\Http\Middleware\VerifyCsrfToken::class,
|
2016-09-03 21:09:00 +00:00
|
|
|
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
|
|
|
'can' => \Illuminate\Auth\Middleware\Authorize::class,
|
|
|
|
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
|
2017-03-31 10:19:44 +00:00
|
|
|
'recaptcha' => \Pterodactyl\Http\Middleware\VerifyReCaptcha::class,
|
2017-10-19 03:32:19 +00:00
|
|
|
|
|
|
|
// Server specific middleware (used for authenticating access to resources)
|
|
|
|
//
|
|
|
|
// These are only used for individual server authentication, and not gloabl
|
|
|
|
// actions from other resources. They are defined in the route files.
|
|
|
|
'server..database' => DatabaseBelongsToServer::class,
|
|
|
|
'server..subuser' => SubuserBelongsToServer::class,
|
|
|
|
'server..schedule' => ScheduleBelongsToServer::class,
|
2015-12-06 18:58:49 +00:00
|
|
|
];
|
|
|
|
}
|