Skip to content
This repository was archived by the owner on Feb 21, 2025. It is now read-only.

Commit b135761

Browse files
authored
Add connect-src, add searchable for type
1 parent fbf39e0 commit b135761

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/Models/CSPDomain.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
use Page;
66
use SilverStripe\Forms\FieldList;
77
use SilverStripe\ORM\DataObject;
8+
use SilverStripe\ORM\FieldType\DBEnum;
9+
use SilverStripe\ORM\FieldType\DBVarchar;
810
use SilverStripe\ORM\ManyManyList;
911
use SilverStripe\Security\Member;
1012
use SilverStripe\Security\Permission;
@@ -25,8 +27,8 @@ class CSPDomain extends DataObject implements PermissionProvider
2527
private static $table_name = 'CSPDomain';
2628

2729
private static $db = [
28-
'Domain' => 'Varchar(255)',
29-
'Source' => 'Enum("default,script,style,img,media,font,form,frame,ancestor,worker")'
30+
'Domain' => DBVarchar::class,
31+
'Source' => DBEnum::class . '("default,script,style,img,media,font,form,frame,ancestor,worker,connect")'
3032
];
3133

3234
private static $belongs_many_many = [
@@ -55,11 +57,13 @@ class CSPDomain extends DataObject implements PermissionProvider
5557
'font' => 'Fonts',
5658
'form' => 'Forms',
5759
'frame' => 'Iframes',
58-
'worker' => 'Worker'
60+
'worker' => 'Worker',
61+
'connect' => 'Connect'
5962
];
6063

6164
private static $searchable_fields = [
6265
'Domain',
66+
'Source'
6367
];
6468

6569
/**

0 commit comments

Comments
 (0)