- Root .htaccess refuses everything outside public/, because local Apache serves the whole project folder (.env, logs with set-password links, .git). - Login allows 20 failed attempts a minute per IP across accounts, besides 5 per email and IP; the forgot-password page 5 requests a minute per IP. - A global middleware sends X-Frame-Options, frame-ancestors, nosniff, Referrer-Policy, Permissions-Policy and HSTS over HTTPS, and drops X-Powered-By. - The weekly time sheet locks the shown week and selected day, so the browser cannot set them. - Users who may not see personal identity codes can save a new code at most 10 times an hour, so the duplicate check cannot be used to test codes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
28 lines
909 B
PHP
28 lines
909 B
PHP
<?php
|
|
|
|
namespace App\Modules\Shared\Infrastructure\Providers;
|
|
|
|
use App\Modules\Shared\Application\Contracts\EventDispatcher;
|
|
use App\Modules\Shared\Application\Contracts\TransactionManager;
|
|
use App\Modules\Shared\Infrastructure\Events\LaravelEventDispatcher;
|
|
use App\Modules\Shared\Infrastructure\Persistence\LaravelTransactionManager;
|
|
use App\Modules\Shared\Presentation\Http\Middleware\SetSecurityHeaders;
|
|
use Illuminate\Contracts\Http\Kernel;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class SharedServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* @var array<class-string, class-string>
|
|
*/
|
|
public array $bindings = [
|
|
TransactionManager::class => LaravelTransactionManager::class,
|
|
EventDispatcher::class => LaravelEventDispatcher::class,
|
|
];
|
|
|
|
public function boot(): void
|
|
{
|
|
$this->app->make(Kernel::class)->pushMiddleware(SetSecurityHeaders::class);
|
|
}
|
|
}
|