1
0

FeaturePolicy.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\AppFramework\Http;
  8. /**
  9. * Class FeaturePolicy is a simple helper which allows applications to
  10. * modify the Feature-Policy sent by Nextcloud. Per default only autoplay is allowed
  11. * from the same domain and full screen as well from the same domain.
  12. *
  13. * Even if a value gets modified above defaults will still get appended. Please
  14. * notice that Nextcloud ships already with sensible defaults and those policies
  15. * should require no modification at all for most use-cases.
  16. *
  17. * @since 17.0.0
  18. */
  19. class FeaturePolicy extends EmptyFeaturePolicy {
  20. protected $autoplayDomains = [
  21. '\'self\'',
  22. ];
  23. /** @var string[] of allowed domains that can access the camera */
  24. protected $cameraDomains = [];
  25. protected $fullscreenDomains = [
  26. '\'self\'',
  27. ];
  28. /** @var string[] of allowed domains that can use the geolocation of the device */
  29. protected $geolocationDomains = [];
  30. /** @var string[] of allowed domains that can use the microphone */
  31. protected $microphoneDomains = [];
  32. /** @var string[] of allowed domains that can use the payment API */
  33. protected $paymentDomains = [];
  34. }