ICloudIdManager.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\Federation;
  8. /**
  9. * Interface for resolving federated cloud ids
  10. *
  11. * @since 12.0.0
  12. */
  13. interface ICloudIdManager {
  14. /**
  15. * @param string $cloudId
  16. * @return ICloudId
  17. * @throws \InvalidArgumentException
  18. *
  19. * @since 12.0.0
  20. */
  21. public function resolveCloudId(string $cloudId): ICloudId;
  22. /**
  23. * Get the cloud id for a remote user
  24. *
  25. * @param string $user
  26. * @param string|null $remote (optional since 23.0.0 for local users)
  27. * @return ICloudId
  28. *
  29. * @since 12.0.0
  30. */
  31. public function getCloudId(string $user, ?string $remote): ICloudId;
  32. /**
  33. * Check if the input is a correctly formatted cloud id
  34. *
  35. * @param string $cloudId
  36. * @return bool
  37. *
  38. * @since 12.0.0
  39. */
  40. public function isValidCloudId(string $cloudId): bool;
  41. /**
  42. * remove scheme/protocol from an url
  43. *
  44. * @param string $url
  45. *
  46. * @return string
  47. * @since 28.0.0
  48. */
  49. public function removeProtocolFromUrl(string $url): string;
  50. }