2015-12-06 18:58:49 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Http;
|
|
|
|
|
2017-10-29 20:57:43 +00:00
|
|
|
use Illuminate\Auth\Middleware\Authorize;
|
2022-10-14 16:59:20 +00:00
|
|
|
use Illuminate\Http\Middleware\HandleCors;
|
2017-10-29 20:57:43 +00:00
|
|
|
use Illuminate\Auth\Middleware\Authenticate;
|
2022-05-14 20:03:50 +00:00
|
|
|
use Illuminate\Http\Middleware\TrustProxies;
|
2017-10-29 20:57:43 +00:00
|
|
|
use Pterodactyl\Http\Middleware\TrimStrings;
|
|
|
|
use Illuminate\Session\Middleware\StartSession;
|
|
|
|
use Pterodactyl\Http\Middleware\EncryptCookies;
|
2020-07-01 03:05:11 +00:00
|
|
|
use Pterodactyl\Http\Middleware\Api\IsValidJson;
|
2017-10-29 20:57:43 +00:00
|
|
|
use Pterodactyl\Http\Middleware\VerifyCsrfToken;
|
|
|
|
use Pterodactyl\Http\Middleware\VerifyReCaptcha;
|
|
|
|
use Illuminate\Routing\Middleware\ThrottleRequests;
|
|
|
|
use Pterodactyl\Http\Middleware\LanguageMiddleware;
|
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;
|
2022-06-18 16:07:44 +00:00
|
|
|
use Pterodactyl\Http\Middleware\Activity\TrackAPIKey;
|
2018-07-01 00:50:58 +00:00
|
|
|
use Illuminate\Session\Middleware\AuthenticateSession;
|
2017-10-29 20:57:43 +00:00
|
|
|
use Illuminate\View\Middleware\ShareErrorsFromSession;
|
2018-06-06 06:42:34 +00:00
|
|
|
use Pterodactyl\Http\Middleware\MaintenanceMiddleware;
|
2022-05-22 20:50:36 +00:00
|
|
|
use Pterodactyl\Http\Middleware\EnsureStatefulRequests;
|
2017-10-29 20:57:43 +00:00
|
|
|
use Pterodactyl\Http\Middleware\RedirectIfAuthenticated;
|
|
|
|
use Illuminate\Auth\Middleware\AuthenticateWithBasicAuth;
|
2018-02-25 21:30:56 +00:00
|
|
|
use Pterodactyl\Http\Middleware\Api\AuthenticateIPAccess;
|
2017-12-16 18:20:09 +00:00
|
|
|
use Illuminate\Foundation\Http\Middleware\ValidatePostSize;
|
2017-10-29 20:57:43 +00:00
|
|
|
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
|
2018-01-13 22:06:19 +00:00
|
|
|
use Pterodactyl\Http\Middleware\Api\Daemon\DaemonAuthenticate;
|
2022-05-22 23:03:51 +00:00
|
|
|
use Pterodactyl\Http\Middleware\Api\Client\RequireClientApiKey;
|
2022-06-26 20:21:07 +00:00
|
|
|
use Pterodactyl\Http\Middleware\RequireTwoFactorAuthentication;
|
2017-12-16 18:20:09 +00:00
|
|
|
use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull;
|
2022-05-22 18:10:01 +00:00
|
|
|
use Pterodactyl\Http\Middleware\Api\Client\SubstituteClientBindings;
|
2022-05-22 22:16:47 +00:00
|
|
|
use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance;
|
2018-02-25 21:30:56 +00:00
|
|
|
use Pterodactyl\Http\Middleware\Api\Application\AuthenticateApplicationUser;
|
2015-12-06 18:58:49 +00:00
|
|
|
|
|
|
|
class Kernel extends HttpKernel
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The application's global HTTP middleware stack.
|
|
|
|
*/
|
|
|
|
protected $middleware = [
|
2022-05-22 22:16:47 +00:00
|
|
|
TrustProxies::class,
|
|
|
|
HandleCors::class,
|
|
|
|
PreventRequestsDuringMaintenance::class,
|
2017-12-16 18:20:09 +00:00
|
|
|
ValidatePostSize::class,
|
2017-10-29 20:57:43 +00:00
|
|
|
TrimStrings::class,
|
2017-12-16 18:20:09 +00:00
|
|
|
ConvertEmptyStringsToNull::class,
|
2015-12-06 18:58:49 +00:00
|
|
|
];
|
|
|
|
|
2016-09-03 21:09:00 +00:00
|
|
|
/**
|
|
|
|
* The application's route middleware groups.
|
|
|
|
*/
|
|
|
|
protected $middlewareGroups = [
|
|
|
|
'web' => [
|
2022-05-22 22:16:47 +00:00
|
|
|
EncryptCookies::class,
|
2017-10-29 20:57:43 +00:00
|
|
|
AddQueuedCookiesToResponse::class,
|
|
|
|
StartSession::class,
|
|
|
|
ShareErrorsFromSession::class,
|
|
|
|
VerifyCsrfToken::class,
|
|
|
|
SubstituteBindings::class,
|
|
|
|
LanguageMiddleware::class,
|
2016-09-03 21:09:00 +00:00
|
|
|
],
|
|
|
|
'api' => [
|
2022-05-22 20:50:36 +00:00
|
|
|
EnsureStatefulRequests::class,
|
2022-05-22 18:57:06 +00:00
|
|
|
'auth:sanctum',
|
2022-05-22 21:23:48 +00:00
|
|
|
IsValidJson::class,
|
2022-06-18 16:07:44 +00:00
|
|
|
TrackAPIKey::class,
|
2022-05-22 18:57:06 +00:00
|
|
|
RequireTwoFactorAuthentication::class,
|
|
|
|
AuthenticateIPAccess::class,
|
2022-05-14 19:51:05 +00:00
|
|
|
],
|
|
|
|
'application-api' => [
|
2022-05-22 18:10:01 +00:00
|
|
|
SubstituteBindings::class,
|
2018-02-25 21:30:56 +00:00
|
|
|
AuthenticateApplicationUser::class,
|
2016-09-03 21:09:00 +00:00
|
|
|
],
|
2022-05-22 23:03:51 +00:00
|
|
|
'client-api' => [
|
|
|
|
SubstituteClientBindings::class,
|
|
|
|
RequireClientApiKey::class,
|
|
|
|
],
|
2017-09-24 01:45:25 +00:00
|
|
|
'daemon' => [
|
|
|
|
SubstituteBindings::class,
|
2017-11-04 22:16:44 +00:00
|
|
|
DaemonAuthenticate::class,
|
2017-09-24 01:45:25 +00:00
|
|
|
],
|
2016-09-03 21:09:00 +00:00
|
|
|
];
|
|
|
|
|
2015-12-06 18:58:49 +00:00
|
|
|
/**
|
|
|
|
* The application's route middleware.
|
|
|
|
*/
|
|
|
|
protected $routeMiddleware = [
|
2017-10-29 20:57:43 +00:00
|
|
|
'auth' => Authenticate::class,
|
|
|
|
'auth.basic' => AuthenticateWithBasicAuth::class,
|
2022-05-22 22:16:47 +00:00
|
|
|
'auth.session' => AuthenticateSession::class,
|
2022-10-29 07:17:23 +00:00
|
|
|
'cors' => HandleCors::class,
|
2017-10-29 20:57:43 +00:00
|
|
|
'guest' => RedirectIfAuthenticated::class,
|
|
|
|
'csrf' => VerifyCsrfToken::class,
|
|
|
|
'throttle' => ThrottleRequests::class,
|
|
|
|
'can' => Authorize::class,
|
|
|
|
'bindings' => SubstituteBindings::class,
|
|
|
|
'recaptcha' => VerifyReCaptcha::class,
|
2018-05-31 14:40:18 +00:00
|
|
|
'node.maintenance' => MaintenanceMiddleware::class,
|
2015-12-06 18:58:49 +00:00
|
|
|
];
|
|
|
|
}
|