Nextcloud PHP API (master)

EmptyFeaturePolicy
in package

Class EmptyFeaturePolicy is a simple helper which allows applications to modify the FeaturePolicy sent by Nextcloud. Per default the policy is forbidding everything.

As alternative with sane exemptions look at FeaturePolicy

Tags
see
FeaturePolicy
since
17.0.0

Table of Contents

Properties

$autoplayDomains  : array<string|int, string>
$cameraDomains  : array<string|int, string>
$fullscreenDomains  : array<string|int, string>
$geolocationDomains  : array<string|int, string>
$microphoneDomains  : array<string|int, string>
$paymentDomains  : array<string|int, string>

Methods

addAllowedAutoplayDomain()  : $this
Allows to use autoplay from a specific domain. Use * to allow from all domains.
addAllowedCameraDomain()  : $this
Allows to use the camera on a specific domain. Use * to allow from all domains
addAllowedFullScreenDomain()  : $this
Allows the full screen functionality to be used on a specific domain. Use * to allow from all domains
addAllowedGeoLocationDomain()  : $this
Allows to use the geolocation on a specific domain. Use * to allow from all domains
addAllowedMicrophoneDomain()  : $this
Allows to use the microphone on a specific domain. Use * to allow from all domains
addAllowedPaymentDomain()  : $this
Allows to use the payment API on a specific domain. Use * to allow from all domains
buildPolicy()  : string
Get the generated Feature-Policy as a string

Properties

$autoplayDomains

protected array<string|int, string> $autoplayDomains = null

of allowed domains to autoplay media

$cameraDomains

protected array<string|int, string> $cameraDomains = null

of allowed domains that can access the camera

$fullscreenDomains

protected array<string|int, string> $fullscreenDomains = null

of allowed domains that can use fullscreen

$geolocationDomains

protected array<string|int, string> $geolocationDomains = null

of allowed domains that can use the geolocation of the device

$microphoneDomains

protected array<string|int, string> $microphoneDomains = null

of allowed domains that can use the microphone

$paymentDomains

protected array<string|int, string> $paymentDomains = null

of allowed domains that can use the payment API

Methods

addAllowedAutoplayDomain()

Allows to use autoplay from a specific domain. Use * to allow from all domains.

public addAllowedAutoplayDomain(string $domain) : $this
Parameters
$domain : string

Domain to whitelist. Any passed value needs to be properly sanitized.

Tags
since
17.0.0
Return values
$this

addAllowedCameraDomain()

Allows to use the camera on a specific domain. Use * to allow from all domains

public addAllowedCameraDomain(string $domain) : $this
Parameters
$domain : string

Domain to whitelist. Any passed value needs to be properly sanitized.

Tags
since
17.0.0
Return values
$this

addAllowedFullScreenDomain()

Allows the full screen functionality to be used on a specific domain. Use * to allow from all domains

public addAllowedFullScreenDomain(string $domain) : $this
Parameters
$domain : string

Domain to whitelist. Any passed value needs to be properly sanitized.

Tags
since
17.0.0
Return values
$this

addAllowedGeoLocationDomain()

Allows to use the geolocation on a specific domain. Use * to allow from all domains

public addAllowedGeoLocationDomain(string $domain) : $this
Parameters
$domain : string

Domain to whitelist. Any passed value needs to be properly sanitized.

Tags
since
17.0.0
Return values
$this

addAllowedMicrophoneDomain()

Allows to use the microphone on a specific domain. Use * to allow from all domains

public addAllowedMicrophoneDomain(string $domain) : $this
Parameters
$domain : string

Domain to whitelist. Any passed value needs to be properly sanitized.

Tags
since
17.0.0
Return values
$this

addAllowedPaymentDomain()

Allows to use the payment API on a specific domain. Use * to allow from all domains

public addAllowedPaymentDomain(string $domain) : $this
Parameters
$domain : string

Domain to whitelist. Any passed value needs to be properly sanitized.

Tags
since
17.0.0
Return values
$this

buildPolicy()

Get the generated Feature-Policy as a string

public buildPolicy() : string
Tags
since
17.0.0
Return values
string

        
On this page

Search results