@@ -2,6 +2,7 @@
|
||||
|
||||
// In-process GET validation only: existing actors, array sessions, pre-execution SQL write refusal.
|
||||
// No routes, login shortcuts, users, grants or changes are installed by this checker.
|
||||
use App\Http\Middleware\HandleInertiaRequests;
|
||||
use App\Models\User;
|
||||
use App\Services\StandaloneRuntime;
|
||||
use Illuminate\Contracts\Http\Kernel;
|
||||
@@ -35,7 +36,8 @@ $app = require $root.'/bootstrap/app.php';
|
||||
$kernel = $app->make(Kernel::class);
|
||||
$kernel->bootstrap();
|
||||
$onlyReads = static function (string $sql): void {
|
||||
if (! preg_match('/^\s*(SELECT\b|SHOW\b|SET\s+LOCAL\b|SET\s+CONSTRAINTS\b)/i', $sql)) {
|
||||
if (! preg_match('/^\s*(SELECT\b|SHOW\b|SET\s+LOCAL\b|SET\s+CONSTRAINTS\b)/i', $sql)
|
||||
&& strcasecmp(trim($sql), 'SET TRANSACTION ISOLATION LEVEL REPEATABLE READ READ ONLY') !== 0) {
|
||||
throw new LogicException('PROFILE_CHECK_SQL_WRITE_REFUSED');
|
||||
}
|
||||
};
|
||||
@@ -72,7 +74,7 @@ foreach (['admin', 'procurement', 'finance', 'warehouse'] as $role) {
|
||||
$request = Request::create('http://127.0.0.1:8005'.$path, 'GET', server: ['REMOTE_ADDR' => '127.0.0.1',
|
||||
'HTTP_ACCEPT' => 'application/json', 'HTTP_X_INERTIA' => 'true']);
|
||||
$app->instance('request', $request);
|
||||
$request->headers->set('X-Inertia-Version', app(\App\Http\Middleware\HandleInertiaRequests::class)->version($request));
|
||||
$request->headers->set('X-Inertia-Version', app(HandleInertiaRequests::class)->version($request));
|
||||
Auth::guard('web')->setUser($actor);
|
||||
$session = app('session')->driver();
|
||||
$session->start();
|
||||
|
||||
Reference in New Issue
Block a user