2024-03-03 08:44:00 -05:00
|
|
|
<?php
|
|
|
|
|
2024-11-03 04:09:59 -05:00
|
|
|
namespace App\Http;
|
2024-03-03 08:44:00 -05:00
|
|
|
|
|
|
|
use Illuminate\Auth\Middleware\Authorize;
|
|
|
|
use Illuminate\Http\Middleware\HandleCors;
|
|
|
|
use Illuminate\Auth\Middleware\Authenticate;
|
|
|
|
use Illuminate\Http\Middleware\TrustProxies;
|
2024-11-03 04:09:59 -05:00
|
|
|
use App\Http\Middleware\TrimStrings;
|
2024-03-03 08:44:00 -05:00
|
|
|
use Illuminate\Session\Middleware\StartSession;
|
2024-11-03 04:09:59 -05:00
|
|
|
use App\Http\Middleware\EncryptCookies;
|
|
|
|
use App\Http\Middleware\Api\IsValidJson;
|
|
|
|
use App\Http\Middleware\VerifyCsrfToken;
|
|
|
|
use App\Http\Middleware\VerifyReCaptcha;
|
2024-03-03 08:44:00 -05:00
|
|
|
use Illuminate\Routing\Middleware\ThrottleRequests;
|
2024-11-03 04:09:59 -05:00
|
|
|
use App\Http\Middleware\LanguageMiddleware;
|
2024-03-03 08:44:00 -05:00
|
|
|
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
|
|
|
use Illuminate\Routing\Middleware\SubstituteBindings;
|
2024-11-03 04:09:59 -05:00
|
|
|
use App\Http\Middleware\Activity\TrackAPIKey;
|
2024-03-03 08:44:00 -05:00
|
|
|
use Illuminate\Session\Middleware\AuthenticateSession;
|
|
|
|
use Illuminate\View\Middleware\ShareErrorsFromSession;
|
2024-11-03 04:09:59 -05:00
|
|
|
use App\Http\Middleware\MaintenanceMiddleware;
|
|
|
|
use App\Http\Middleware\EnsureStatefulRequests;
|
|
|
|
use App\Http\Middleware\RedirectIfAuthenticated;
|
2024-03-03 08:44:00 -05:00
|
|
|
use Illuminate\Auth\Middleware\AuthenticateWithBasicAuth;
|
2024-11-03 04:09:59 -05:00
|
|
|
use App\Http\Middleware\Api\AuthenticateIPAccess;
|
2024-03-03 08:44:00 -05:00
|
|
|
use Illuminate\Foundation\Http\Middleware\ValidatePostSize;
|
|
|
|
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
|
2024-11-03 04:09:59 -05:00
|
|
|
use App\Http\Middleware\Api\Daemon\DaemonAuthenticate;
|
|
|
|
use App\Http\Middleware\Api\Client\RequireClientApiKey;
|
|
|
|
use App\Http\Middleware\RequireTwoFactorAuthentication;
|
2024-03-03 08:44:00 -05:00
|
|
|
use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull;
|
2024-11-03 04:09:59 -05:00
|
|
|
use App\Http\Middleware\Api\Client\SubstituteClientBindings;
|
2024-03-03 08:44:00 -05:00
|
|
|
use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance;
|
2024-11-03 04:09:59 -05:00
|
|
|
use App\Http\Middleware\Api\Application\AuthenticateApplicationUser;
|
2024-03-03 08:44:00 -05:00
|
|
|
|
|
|
|
class Kernel extends HttpKernel
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The application's global HTTP middleware stack.
|
|
|
|
*/
|
|
|
|
protected $middleware = [
|
|
|
|
TrustProxies::class,
|
|
|
|
HandleCors::class,
|
|
|
|
PreventRequestsDuringMaintenance::class,
|
|
|
|
ValidatePostSize::class,
|
|
|
|
TrimStrings::class,
|
|
|
|
ConvertEmptyStringsToNull::class,
|
|
|
|
];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The application's route middleware groups.
|
|
|
|
*/
|
|
|
|
protected $middlewareGroups = [
|
|
|
|
/* Blueprint middleware */
|
|
|
|
'blueprint' => [ EncryptCookies::class, AddQueuedCookiesToResponse::class, StartSession::class, ShareErrorsFromSession::class, VerifyCsrfToken::class, SubstituteBindings::class, LanguageMiddleware::class, ],
|
|
|
|
'blueprint/api' => [ EnsureStatefulRequests::class, 'auth:sanctum', IsValidJson::class, TrackAPIKey::class, RequireTwoFactorAuthentication::class, AuthenticateIPAccess::class, ],
|
|
|
|
'blueprint/application-api' => [ SubstituteBindings::class, AuthenticateApplicationUser::class, ],
|
|
|
|
'blueprint/client-api' => [ SubstituteClientBindings::class, RequireClientApiKey::class, ],
|
|
|
|
|
|
|
|
/* Pterodactyl middleware */
|
|
|
|
'web' => [
|
|
|
|
EncryptCookies::class,
|
|
|
|
AddQueuedCookiesToResponse::class,
|
|
|
|
StartSession::class,
|
|
|
|
ShareErrorsFromSession::class,
|
|
|
|
VerifyCsrfToken::class,
|
|
|
|
SubstituteBindings::class,
|
|
|
|
LanguageMiddleware::class,
|
|
|
|
],
|
|
|
|
'api' => [
|
|
|
|
EnsureStatefulRequests::class,
|
|
|
|
'auth:sanctum',
|
|
|
|
IsValidJson::class,
|
|
|
|
TrackAPIKey::class,
|
|
|
|
RequireTwoFactorAuthentication::class,
|
|
|
|
AuthenticateIPAccess::class,
|
|
|
|
],
|
|
|
|
'application-api' => [
|
|
|
|
SubstituteBindings::class,
|
|
|
|
AuthenticateApplicationUser::class,
|
|
|
|
],
|
|
|
|
'client-api' => [
|
|
|
|
SubstituteClientBindings::class,
|
|
|
|
RequireClientApiKey::class,
|
|
|
|
],
|
|
|
|
'daemon' => [
|
|
|
|
SubstituteBindings::class,
|
|
|
|
DaemonAuthenticate::class,
|
|
|
|
],
|
|
|
|
];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The application's route middleware.
|
|
|
|
*/
|
|
|
|
protected $middlewareAliases = [
|
|
|
|
'auth' => Authenticate::class,
|
|
|
|
'auth.basic' => AuthenticateWithBasicAuth::class,
|
|
|
|
'auth.session' => AuthenticateSession::class,
|
|
|
|
'guest' => RedirectIfAuthenticated::class,
|
|
|
|
'csrf' => VerifyCsrfToken::class,
|
|
|
|
'throttle' => ThrottleRequests::class,
|
|
|
|
'can' => Authorize::class,
|
|
|
|
'bindings' => SubstituteBindings::class,
|
|
|
|
'recaptcha' => VerifyReCaptcha::class,
|
|
|
|
'node.maintenance' => MaintenanceMiddleware::class,
|
|
|
|
];
|
|
|
|
}
|