PolicyProvider

final readonly class \TYPO3\CMS\Core\Security\ContentSecurityPolicy\PolicyProvider

Provide a Content-Security-Policy representation for a given scope (e.g. backend, frontend, frontend.my-site).

Attributes

#[Autoconfigure]
$public: true

Table of Contents

Methods

__construct()  : mixed
getDefaultReportingUriBase()  : UriInterface
Returns the URI base, for better partitioning it should be extended by `&requestTime=...`
getReportingUrlFor()  : UriInterface|null
prepare()  : void
provideFor()  : Policy
Provides the complete, dynamically mutated policy to be used in HTTP responses.

Methods

__construct()

public __construct(RequestId $requestId, SiteFinder $siteFinder, PolicyRegistry $policyRegistry, EventDispatcherInterface $eventDispatcher, MutationRepository $mutationRepository, BackendEntryPointResolver $backendEntryPointResolver, HashService $hashService) : mixed

Parameters

$requestId : RequestId
$siteFinder : SiteFinder
$policyRegistry : PolicyRegistry
$eventDispatcher : EventDispatcherInterface
$mutationRepository : MutationRepository
$backendEntryPointResolver : BackendEntryPointResolver
$hashService : HashService

getDefaultReportingUriBase()

Returns the URI base, for better partitioning it should be extended by `&requestTime=...`

public getDefaultReportingUriBase(Scope $scope, ServerRequestInterface $request[, bool $absolute = true ]) : UriInterface

Parameters

$scope : Scope
$request : ServerRequestInterface
$absolute : bool = true

Return values

UriInterface

getReportingUrlFor()

public getReportingUrlFor(Scope $scope, ServerRequestInterface $request[, DispositionConfiguration|null $dispositionConfiguration = null ]) : UriInterface|null

Parameters

$scope : Scope
$request : ServerRequestInterface
$dispositionConfiguration : DispositionConfiguration|null = null

Return values

UriInterface|null

prepare()

public prepare(PolicyBag $policyBag, ServerRequestInterface $request, string|ResponseInterface|null $response) : void

Parameters

$policyBag : PolicyBag
$request : ServerRequestInterface
$response : string|ResponseInterface|null
On this page