Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions app/Enums/EnvironmentEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

namespace App\Enums;

use Filament\Support\Contracts\HasLabel;

enum EnvironmentEnum: string implements HasLabel
enum EnvironmentEnum: string
{
case LOCAL = 'local';
case STAGING = 'staging';
Expand Down
4 changes: 1 addition & 3 deletions app/Enums/GuardEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

namespace App\Enums;

use Filament\Support\Contracts\HasLabel;

enum GuardEnum: string implements HasLabel
enum GuardEnum: string
{
case WEB = 'web';

Expand Down
4 changes: 1 addition & 3 deletions app/Enums/LocaleEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

namespace App\Enums;

use Filament\Support\Contracts\HasLabel;

enum LocaleEnum: string implements HasLabel
enum LocaleEnum: string
{
case DE = 'de_CH';
case EN = 'en_CH';
Expand Down
4 changes: 1 addition & 3 deletions app/Enums/RoleEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

namespace App\Enums;

use Filament\Support\Contracts\HasLabel;

enum RoleEnum: string implements HasLabel
enum RoleEnum: string
{
case ADMINISTRATOR = 'administrator';
case USER = 'user';
Expand Down
4 changes: 1 addition & 3 deletions app/Enums/SessionKeyEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

namespace App\Enums;

use Filament\Support\Contracts\HasLabel;

enum SessionKeyEnum: string implements HasLabel
enum SessionKeyEnum: string
{
case LANGUAGE = 'language';

Expand Down
16 changes: 0 additions & 16 deletions app/Http/Middleware/AddContentSecurityPolicyHeaders.php

This file was deleted.

20 changes: 20 additions & 0 deletions app/Http/Middleware/AddReferrerPolicyMiddleware.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;

class AddReferrerPolicyMiddleware
{
public function handle(Request $request, Closure $next): Response
{
/** @var \Symfony\Component\HttpFoundation\Response $response */
$response = $next($request);

$response->headers->set('Referrer-Policy', 'strict-origin-when-cross-origin');

return $response;
}
}
41 changes: 28 additions & 13 deletions app/Security/Presets/MyCspPreset.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,43 @@ public function configure(Policy $policy): void
{
$policy->add(Directive::BASE, Keyword::SELF);

$policy->add(Directive::CONNECT, Keyword::SELF);
$policy->add(Directive::DEFAULT, Keyword::SELF);
$policy->add(Directive::FONT, Keyword::SELF);
$policy->add(Directive::FORM_ACTION, Keyword::SELF);
$policy->add(Directive::IMG, [

$policy->add(Directive::SCRIPT, [
Keyword::SELF,
'data:',
'cdn.usefathom.com',
'cdn-eu.usefathom.com',
]);
$policy->add(Directive::MEDIA, Keyword::SELF);
$policy->add(Directive::OBJECT, Keyword::NONE);

$policy->add(Directive::SCRIPT, Keyword::SELF);
$policy->add(Directive::SCRIPT_ELEM, [
Keyword::SELF,
'cdn.usefathom.com',
'cdn-eu.usefathom.com',
]);

$policy->add(Directive::STYLE, [
Keyword::SELF,
Keyword::UNSAFE_INLINE,
]);

// Fathom Analytics
$policy->add(Directive::SCRIPT, 'cdn.usefathom.com');
$policy->add(Directive::CONNECT, 'cdn.usefathom.com');
$policy->add(Directive::SCRIPT, 'cdn-eu.usefathom.com');
$policy->add(Directive::CONNECT, 'cdn-eu.usefathom.com');
$policy->add(Directive::STYLE_ELEM, [
Keyword::SELF,
Keyword::UNSAFE_INLINE,
]);

$policy->add(Directive::IMG, [
Keyword::SELF,
'data:',
]);

$policy->add(Directive::FONT, Keyword::SELF);
$policy->add(Directive::FORM_ACTION, Keyword::SELF);
$policy->add(Directive::MEDIA, Keyword::SELF);
$policy->add(Directive::OBJECT, Keyword::NONE);
$policy->add(Directive::CONNECT, [
Keyword::SELF,
'cdn.usefathom.com',
'cdn-eu.usefathom.com',
]);
}
}
4 changes: 2 additions & 2 deletions bootstrap/app.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

use App\Http\Middleware\AddContentSecurityPolicyHeaders;
use App\Http\Middleware\AddReferrerPolicyMiddleware;
use App\Http\Middleware\SetLanguage;
use App\Providers\AppServiceProvider;
use App\Providers\EventServiceProvider;
Expand All @@ -25,7 +25,7 @@
->withMiddleware(function (Middleware $middleware) {
$middleware->web(append: [
AddCspHeaders::class,
// AddContentSecurityPolicyHeaders::class,
AddReferrerPolicyMiddleware::class,
AddFeaturePolicyHeaders::class,
SetLanguage::class,
CacheResponse::class,
Expand Down
3 changes: 0 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
"require": {
"php": "^8.4",
"codebar-ag/laravel-flysystem-cloudinary": "^v12.0.1",
"filament/filament": "^3.3",
"laravel/framework": "^v12.1.1",
"laravel/tinker": "^2.10.1",
"league/flysystem-aws-s3-v3": "^3.28",
"livewire/livewire": "^3.5",
"mazedlx/laravel-feature-policy": "^2.2",
"sammyjo20/lasso": "3.4.0",
"spatie/laravel-csp": "^3.8",
Expand All @@ -38,7 +36,6 @@
"pestphp/pest-plugin-arch": "^3.0",
"pestphp/pest-plugin-faker": "^3.0",
"pestphp/pest-plugin-laravel": "^3.1",
"pestphp/pest-plugin-livewire": "^3.1",
"pestphp/pest-plugin-type-coverage": "^3.3",
"phpstan/extension-installer": "^1.4.3",
"phpstan/phpstan": "2.1.6",
Expand Down
Loading