PolicyProvider
Read onlyYes
FinalYes
Provide a Content-Security-Policy representation for a given scope (e.g. backend, frontend, frontend.my-site).
Attributes
- #[Autoconfigure]
- $public: true
Table of Contents
Constants
- REPORTING_URI = '@http-reporting'
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.
Constants
REPORTING_URI
protected
mixed
REPORTING_URI
= '@http-reporting'
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
UriInterfacegetReportingUrlFor()
public
getReportingUrlFor(Scope $scope, ServerRequestInterface $request[, DispositionConfiguration|null $dispositionConfiguration = null ]) : UriInterface|null
Parameters
- $scope : Scope
- $request : ServerRequestInterface
- $dispositionConfiguration : DispositionConfiguration|null = null
Return values
UriInterface|nullprepare()
public
prepare(PolicyBag $policyBag, ServerRequestInterface $request, null|string|ResponseInterface $response) : void
Parameters
- $policyBag : PolicyBag
- $request : ServerRequestInterface
- $response : null|string|ResponseInterface
provideFor()
Provides the complete, dynamically mutated policy to be used in HTTP responses.
public
provideFor(Scope $scope[, Disposition $disposition = Disposition::enforce ][, ServerRequestInterface|null $request = null ]) : Policy
Parameters
- $scope : Scope
- $disposition : Disposition = Disposition::enforce
- $request : ServerRequestInterface|null = null