1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-16 16:13:20 +01:00
invoiceninja/app/Http/Kernel.php

189 lines
6.1 KiB
PHP
Raw Normal View History

2018-10-04 19:10:43 +02:00
<?php
2019-05-11 05:32:07 +02:00
/**
* Invoice Ninja (https://invoiceninja.com).
2019-05-11 05:32:07 +02:00
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
2019-05-11 05:32:07 +02:00
*
* @license https://opensource.org/licenses/AAL
*/
2018-10-04 19:10:43 +02:00
namespace App\Http;
2020-10-28 11:10:49 +01:00
use App\Http\Middleware\ApiSecretCheck;
use App\Http\Middleware\Authenticate;
use App\Http\Middleware\CheckClientExistence;
2020-10-28 11:10:49 +01:00
use App\Http\Middleware\CheckForMaintenanceMode;
use App\Http\Middleware\ClientPortalEnabled;
use App\Http\Middleware\ContactAccount;
2020-10-28 11:10:49 +01:00
use App\Http\Middleware\ContactKeyLogin;
use App\Http\Middleware\ContactRegister;
use App\Http\Middleware\ContactSetDb;
2019-07-08 02:08:57 +02:00
use App\Http\Middleware\ContactTokenAuth;
2020-10-28 11:10:49 +01:00
use App\Http\Middleware\Cors;
use App\Http\Middleware\EncryptCookies;
use App\Http\Middleware\Locale;
use App\Http\Middleware\PasswordProtection;
use App\Http\Middleware\PhantomSecret;
use App\Http\Middleware\QueryLogging;
use App\Http\Middleware\RedirectIfAuthenticated;
use App\Http\Middleware\SetDb;
use App\Http\Middleware\SetDbByCompanyKey;
use App\Http\Middleware\SetDomainNameDb;
use App\Http\Middleware\SetEmailDb;
use App\Http\Middleware\SetInviteDb;
use App\Http\Middleware\SetWebDb;
use App\Http\Middleware\Shop\ShopTokenAuth;
use App\Http\Middleware\TokenAuth;
use App\Http\Middleware\TrimStrings;
use App\Http\Middleware\TrustProxies;
use App\Http\Middleware\UrlSetDb;
2021-02-25 22:06:43 +01:00
use App\Http\Middleware\UserVerified;
2020-10-28 11:10:49 +01:00
use App\Http\Middleware\VerifyCsrfToken;
use Illuminate\Auth\Middleware\AuthenticateWithBasicAuth;
use Illuminate\Auth\Middleware\Authorize;
use Illuminate\Auth\Middleware\EnsureEmailIsVerified;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
2018-10-04 19:10:43 +02:00
use Illuminate\Foundation\Http\Kernel as HttpKernel;
2020-10-28 11:10:49 +01:00
use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull;
use Illuminate\Foundation\Http\Middleware\ValidatePostSize;
use Illuminate\Http\Middleware\SetCacheHeaders;
use Illuminate\Routing\Middleware\SubstituteBindings;
use Illuminate\Routing\Middleware\ThrottleRequests;
use Illuminate\Routing\Middleware\ValidateSignature;
use Illuminate\Session\Middleware\StartSession;
use Illuminate\View\Middleware\ShareErrorsFromSession;
2018-10-04 19:10:43 +02:00
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 = [
2020-10-28 11:10:49 +01:00
CheckForMaintenanceMode::class,
ValidatePostSize::class,
TrimStrings::class,
ConvertEmptyStringsToNull::class,
TrustProxies::class,
2021-06-02 05:14:40 +02:00
// \Fruitcake\Cors\HandleCors::class,
2020-10-28 11:10:49 +01:00
Cors::class,
2020-06-18 12:52:25 +02:00
2018-10-04 19:10:43 +02:00
];
/**
* The application's route middleware groups.
*
* @var array
*/
protected $middlewareGroups = [
'web' => [
2020-10-28 11:10:49 +01:00
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
QueryLogging::class,
2018-10-04 19:10:43 +02:00
],
'api' => [
2020-10-22 12:14:14 +02:00
'throttle:300,1',
2018-10-04 19:10:43 +02:00
'bindings',
2019-03-26 05:46:08 +01:00
'query_logging',
2018-10-04 19:10:43 +02:00
],
2019-07-08 02:08:57 +02:00
'contact' => [
'throttle:60,1',
'bindings',
'query_logging',
],
'client' => [
2020-10-28 11:10:49 +01:00
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
2021-06-02 05:14:40 +02:00
// \Illuminate\Session\Middleware\AuthenticateSession::class,
2020-10-28 11:10:49 +01:00
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
QueryLogging::class,
],
2020-07-28 13:19:51 +02:00
'shop' => [
2020-10-22 12:14:14 +02:00
'throttle:120,1',
2020-07-28 13:19:51 +02:00
'bindings',
'query_logging',
],
2018-10-04 19:10:43 +02:00
];
/**
* The application's route middleware.
*
* These middleware may be assigned to groups or used individually.
*
* @var array
*/
protected $routeMiddleware = [
2020-10-28 11:10:49 +01:00
'auth' => Authenticate::class,
'auth.basic' => AuthenticateWithBasicAuth::class,
'bindings' => SubstituteBindings::class,
'cache.headers' => SetCacheHeaders::class,
'can' => Authorize::class,
'guest' => RedirectIfAuthenticated::class,
'signed' => ValidateSignature::class,
'throttle' => ThrottleRequests::class,
'verified' => EnsureEmailIsVerified::class,
'query_logging' => QueryLogging::class,
'token_auth' => TokenAuth::class,
'api_secret_check' => ApiSecretCheck::class,
'contact_token_auth' => ContactTokenAuth::class,
'contact_db' => ContactSetDb::class,
'contact_account' => ContactAccount::class,
2020-10-28 11:10:49 +01:00
'domain_db' => SetDomainNameDb::class,
'email_db' => SetEmailDb::class,
'invite_db' => SetInviteDb::class,
'password_protected' => PasswordProtection::class,
'signed' => ValidateSignature::class,
'portal_enabled' => ClientPortalEnabled::class,
'url_db' => UrlSetDb::class,
'web_db' => SetWebDb::class,
'api_db' => SetDb::class,
'company_key_db' => SetDbByCompanyKey::class,
'locale' => Locale::class,
2021-06-05 12:59:53 +02:00
'contact_register' => ContactRegister::class,
2020-10-28 11:10:49 +01:00
'shop_token_auth' => ShopTokenAuth::class,
'phantom_secret' => PhantomSecret::class,
'contact_key_login' => ContactKeyLogin::class,
'check_client_existence' => CheckClientExistence::class,
2021-02-25 22:06:43 +01:00
'user_verified' => UserVerified::class,
2018-10-04 19:10:43 +02:00
];
protected $middlewarePriority = [
2021-06-02 01:07:53 +02:00
Cors::class,
2021-05-15 08:54:27 +02:00
SetDomainNameDb::class,
SetDb::class,
SetWebDb::class,
UrlSetDb::class,
ContactSetDb::class,
SetEmailDb::class,
SetInviteDb::class,
SetDbByCompanyKey::class,
TokenAuth::class,
ContactTokenAuth::class,
2021-05-14 00:29:52 +02:00
ContactKeyLogin::class,
2021-05-14 00:03:57 +02:00
Authenticate::class,
ShopTokenAuth::class,
ContactRegister::class,
PhantomSecret::class,
CheckClientExistence::class,
ClientPortalEnabled::class,
PasswordProtection::class,
Locale::class,
SubstituteBindings::class,
ContactAccount::class,
];
2018-10-04 19:10:43 +02:00
}