IRemoteHostValidator.php 809 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\Security;
  8. /**
  9. * Validator for remote hosts
  10. *
  11. * @since 26.0.0
  12. */
  13. interface IRemoteHostValidator {
  14. /**
  15. * Validate if a host may be connected to
  16. *
  17. * By default, Nextcloud does not connect to any local servers. That is neither
  18. * localhost nor any host in the local network.
  19. *
  20. * Admins can overwrite this behavior with the global `allow_local_remote_servers`
  21. * settings flag. If the flag is set to `true`, local hosts will be considered
  22. * valid.
  23. *
  24. * @param string $host hostname of the remote server, IPv4 or IPv6 address
  25. *
  26. * @return bool
  27. * @since 26.0.0
  28. */
  29. public function isValid(string $host): bool;
  30. }