‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Security\ContentSecurityPolicy\ModelService Class Reference

Public Member Functions

 __construct (private readonly ?FrontendInterface $cache=null)
 
 buildMutationSuggestionFromArray (array $array)
 
 buildMutationCollectionFromArray (array $array)
 
 buildMutationFromArray (array $array)
 
 buildSourcesFromItems (string ... $items)
 
 buildSourceFromString (string $string)
 
 serializeSources (SourceInterface ... $sources)
 
 compileSources (ConsumableNonce $nonce, SourceCollection $collection)
 
 serializeSource (SourceInterface $source, ?ConsumableNonce $nonce=null)
 

Private Member Functions

list< class-string< SourceValueInterface > > resolvePrioritizedSourceInterfaces ()
 

Private Attributes

const SOURCE_PARSING_PRIORITIES
 

Detailed Description

Helpers for working with Content-Security-Policy models.

Definition at line 27 of file ModelService.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Security\ContentSecurityPolicy\ModelService::__construct ( private readonly ?FrontendInterface  $cache = null)
Parameters
?FrontendInterface‪$cache to be used for storing compiled CSP aspects (disabled in install tool)

Definition at line 37 of file ModelService.php.

Member Function Documentation

◆ buildMutationCollectionFromArray()

TYPO3\CMS\Core\Security\ContentSecurityPolicy\ModelService::buildMutationCollectionFromArray ( array  $array)

◆ buildMutationFromArray()

TYPO3\CMS\Core\Security\ContentSecurityPolicy\ModelService::buildMutationFromArray ( array  $array)

◆ buildMutationSuggestionFromArray()

TYPO3\CMS\Core\Security\ContentSecurityPolicy\ModelService::buildMutationSuggestionFromArray ( array  $array)

◆ buildSourceFromString()

TYPO3\CMS\Core\Security\ContentSecurityPolicy\ModelService::buildSourceFromString ( string  $string)

◆ buildSourcesFromItems()

TYPO3\CMS\Core\Security\ContentSecurityPolicy\ModelService::buildSourcesFromItems ( string ...  $items)

◆ compileSources()

TYPO3\CMS\Core\Security\ContentSecurityPolicy\ModelService::compileSources ( ConsumableNonce  $nonce,
SourceCollection  $collection 
)

◆ resolvePrioritizedSourceInterfaces()

list<class-string<SourceValueInterface> > TYPO3\CMS\Core\Security\ContentSecurityPolicy\ModelService::resolvePrioritizedSourceInterfaces ( )
private

Resolves reverse sorted SourceInterface classes (higher priorities first).

Returns
‪list<class-string<SourceValueInterface>>

Definition at line 165 of file ModelService.php.

References TYPO3\CMS\Core\Security\ContentSecurityPolicy\ModelService\SOURCE_PARSING_PRIORITIES.

Referenced by TYPO3\CMS\Core\Security\ContentSecurityPolicy\ModelService\buildSourceFromString().

◆ serializeSource()

TYPO3\CMS\Core\Security\ContentSecurityPolicy\ModelService::serializeSource ( SourceInterface  $source,
?ConsumableNonce  $nonce = null 
)
Parameters
ConsumableNonce | null$nonce‪used to substitute SourceKeyword::nonceProxy items during compilation

Definition at line 141 of file ModelService.php.

Referenced by TYPO3\CMS\Core\Security\ContentSecurityPolicy\ModelService\compileSources(), and TYPO3\CMS\Core\Security\ContentSecurityPolicy\ModelService\serializeSources().

◆ serializeSources()

TYPO3\CMS\Core\Security\ContentSecurityPolicy\ModelService::serializeSources ( SourceInterface ...  $sources)

Member Data Documentation

◆ SOURCE_PARSING_PRIORITIES

const TYPO3\CMS\Core\Security\ContentSecurityPolicy\ModelService::SOURCE_PARSING_PRIORITIES
private
Initial value:
= [
HashProxy::class => 50,
HashValue::class => 50,
]

Definition at line 29 of file ModelService.php.

Referenced by TYPO3\CMS\Core\Security\ContentSecurityPolicy\ModelService\resolvePrioritizedSourceInterfaces().