Removed unnecessary function

This commit is contained in:
2025-05-14 18:01:03 +02:00
parent ec5dbc7e80
commit 02d773b6e1
3 changed files with 1 additions and 87 deletions

View File

@@ -5,34 +5,6 @@ def is_feature_enabled(applications, feature: str, application_id: str) -> bool:
app = applications.get(application_id, {})
return bool(app.get('features', {}).get(feature, False))
def get_csp_whitelist(applications, application_id: str, directive: str) -> list:
"""
Return the list of extra hosts/URLs to whitelist for a given CSP directive.
"""
app = applications.get(application_id, {})
wl = app.get('csp', {}).get('whitelist', {}).get(directive, [])
if isinstance(wl, list):
return wl
if wl:
return [wl]
return []
def get_csp_flags(applications, application_id: str, directive: str) -> list:
"""
Read 'unsafe_eval' and 'unsafe_inline' flags from csp.flags.<directive>.
Returns a list of string tokens, e.g. ["'unsafe-eval'", "'unsafe-inline'"].
"""
app = applications.get(application_id, {})
flags_config = app.get('csp', {}).get('flags', {}).get(directive, {})
tokens = []
if flags_config.get('unsafe_eval', False):
tokens.append("'unsafe-eval'")
if flags_config.get('unsafe_inline', False):
tokens.append("'unsafe-inline'")
return tokens
def get_docker_compose(path_docker_compose_instances: str, application_id: str) -> dict:
"""
Build the docker_compose dict based on