mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-15 08:30:46 +02:00
Implemented desktop csp policies
This commit is contained in:
parent
bf7b24c3ee
commit
5e00deea19
@ -147,10 +147,11 @@ class FilterModule(object):
|
||||
tokens.append('https://www.google.com')
|
||||
|
||||
# Allow the loading of js from the cdn
|
||||
if directive == 'script-src-elem' and self.is_feature_enabled(applications, 'logout', application_id):
|
||||
domain = domains.get('web-svc-cdn')[0]
|
||||
tokens.append(f"{domain}")
|
||||
|
||||
if directive == 'script-src-elem':
|
||||
if self.is_feature_enabled(applications, 'logout', application_id) or self.is_feature_enabled(applications, 'port-ui-desktop', application_id):
|
||||
domain = domains.get('web-svc-cdn')[0]
|
||||
tokens.append(f"{domain}")
|
||||
|
||||
if directive == 'frame-ancestors':
|
||||
# Enable loading via ancestors
|
||||
if self.is_feature_enabled(applications, 'port-ui-desktop', application_id):
|
||||
|
@ -51,7 +51,8 @@ class TestCspFilters(unittest.TestCase):
|
||||
'app2': {}
|
||||
}
|
||||
self.domains = {
|
||||
'web-app-matomo': ['matomo.example.org']
|
||||
'web-app-matomo': ['matomo.example.org'],
|
||||
'web-svc-cdn': ['cdn.example.org'],
|
||||
}
|
||||
|
||||
def test_get_csp_whitelist_list(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user