aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/Federation/ICloudIdResolver.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/Federation/ICloudIdResolver.php')
-rw-r--r--lib/public/Federation/ICloudIdResolver.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/lib/public/Federation/ICloudIdResolver.php b/lib/public/Federation/ICloudIdResolver.php
new file mode 100644
index 00000000000..79f9ed11dd7
--- /dev/null
+++ b/lib/public/Federation/ICloudIdResolver.php
@@ -0,0 +1,40 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+namespace OCP\Federation;
+
+use OCP\AppFramework\Attribute\Consumable;
+use OCP\AppFramework\Attribute\Implementable;
+
+/**
+ * Interface for resolving federated cloud ids
+ *
+ * @since 32.0.0
+ */
+#[Consumable(since: '32.0.0')]
+#[Implementable(since: '32.0.0')]
+interface ICloudIdResolver {
+ /**
+ * @param string $cloudId
+ * @return ICloudId
+ * @throws \InvalidArgumentException
+ *
+ * @since 32.0.0
+ */
+ public function resolveCloudId(string $cloudId): ICloudId;
+
+ /**
+ * Check if the input is a correctly formatted cloud id
+ *
+ * @param string $cloudId
+ * @return bool
+ *
+ * @since 32.0.0
+ */
+ public function isValidCloudId(string $cloudId): bool;
+}