Project

General

Profile

Actions

Bug #105432

closed

Resolve placeholders in config/sites/*/csp.yaml

Added by Sebastian Iffland 28 days ago. Updated 23 days ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Content Security Policy
Target version:
Start date:
2024-10-24
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.1
Tags:
Complexity:
trivial
Is Regression:
Sprint Focus:

Description

Current behavior

The csp.yaml file will not replace placeholders like %env(MY_VAR)%

Expected behavior

The csp.yaml is parsed like the config.yaml and replaces placeholders as described in documentation.

Steps to reproduce

Create config/sites/*/csp.yaml with content like:

inheritDefault: false
mutations:
  - mode: set
    directive: 'default-src'
    sources:
      - "'self'" 
      - '%env(MAIN_SITE_BASE_URI)%'
      - '%env(SUB_SITE_BASE_URI)%'

As seen in sample, especially for multi-site systems, but also in single site environments this is helpful to keep base URL definition in central place which also reduce chance of spelling mistakes while defined in multiple files.

Actions

Also available in: Atom PDF