forked from inex/IXP-Manager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKernel.php
More file actions
186 lines (164 loc) · 5.64 KB
/
Kernel.php
File metadata and controls
186 lines (164 loc) · 5.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<?php
namespace IXP\Http;
/*
* Copyright (C) 2009 - 2020 Internet Neutral Exchange Association Company Limited By Guarantee.
* All Rights Reserved.
*
* This file is part of IXP Manager.
*
* IXP Manager is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version v2.0 of the License.
*
* IXP Manager is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GpNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License v2.0
* along with IXP Manager. If not, see:
*
* http://www.gnu.org/licenses/gpl-2.0.html
*/
use Illuminate\Auth\Middleware\{
AuthenticateWithBasicAuth,
Authorize,
EnsureEmailIsVerified
};
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
use Illuminate\Foundation\Http\Middleware\{
CheckForMaintenanceMode,
ConvertEmptyStringsToNull,
ValidatePostSize
};
use Illuminate\Http\Middleware\HandleCors;
use Illuminate\Http\Middleware\SetCacheHeaders;
use Illuminate\Routing\Middleware\{
SubstituteBindings,
ThrottleRequests
};
use Illuminate\Session\Middleware\StartSession;
use Illuminate\Session\Middleware\AuthenticateSession;
use Illuminate\View\Middleware\ShareErrorsFromSession;
use IXP\Http\Middleware\{
PreventRequestsDuringMaintenance,
Authenticate};
use Illuminate\Http\Middleware\TrustProxies;
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 = [
TrustProxies::class,
HandleCors::class,
PreventRequestsDuringMaintenance::class,
ValidatePostSize::class,
Middleware\TrimStrings::class,
ConvertEmptyStringsToNull::class,
];
/**
* The application's route middleware groups.
*
* @var array
*/
protected $middlewareGroups = [
'web' => [
Middleware\EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
ShareErrorsFromSession::class,
Middleware\VerifyCsrfToken::class,
SubstituteBindings::class,
Middleware\ControllerEnabled::class,
],
'apibase' => [
Middleware\EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
ShareErrorsFromSession::class,
SubstituteBindings::class,
Middleware\ControllerEnabled::class,
//'throttle:60,1',
//'bindings',
Middleware\ControllerEnabled::class,
],
'public/api/v4' => [
'apibase',
'apimaybeauth',
],
'api/v4' => [
'apibase',
'apiauth',
],
'e2frontend' => [
'web',
'eloquent2Frontend',
],
'grapher' => [
Middleware\EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
Middleware\ControllerEnabled::class,
'apimaybeauth',
Middleware\Services\Grapher::class,
],
'lookingglass' => [
'web',
Middleware\ControllerEnabled::class,
Middleware\Services\LookingGlass::class,
],
// Middleware group for simple APIs where we do not want to create cookies.
'publicapi' => [
SubstituteBindings::class,
Middleware\ControllerEnabled::class,
],
];
/**
* The application's route middleware.
*
* @var array
*/
protected $routeMiddleware = [
'2fa' => Middleware\Google2FA::class,
'apiauth' => Middleware\ApiAuthenticate::class,
'apideprecated' => Middleware\ApiDeprecated::class,
'apimaybeauth' => Middleware\ApiMaybeAuthenticate::class,
'assert.privilege' => Middleware\AssertUserPrivilege::class,
'auth' => Middleware\Authenticate::class,
'auth.basic' => AuthenticateWithBasicAuth::class,
'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
//'bindings' => SubstituteBindings::class,
'cache.headers' => SetCacheHeaders::class,
'can' => Authorize::class,
'controller-enabled' => Middleware\ControllerEnabled::class,
'eloquent2Frontend' => Middleware\Eloquent2Frontend::class,
'grapher' => Middleware\Services\Grapher::class,
'guest' => Middleware\RedirectIfAuthenticated::class,
'rs-prefixes' => Middleware\RsPrefixes::class,
'signed' => Middleware\ValidateSignature::class,
'throttle' => ThrottleRequests::class,
'verified' => EnsureEmailIsVerified::class,
];
/**
* The priority-sorted list of middleware.
*
* This forces non-global middleware to always be in the given order.
*
* @var array
*/
protected $middlewarePriority = [
StartSession::class,
ShareErrorsFromSession::class,
Authenticate::class,
ThrottleRequests::class,
AuthenticateSession::class,
SubstituteBindings::class,
Authorize::class,
];
}