diff options
Diffstat (limited to 'lib/public/OCM')
-rw-r--r-- | lib/public/OCM/Events/ResourceTypeRegisterEvent.php | 25 | ||||
-rw-r--r-- | lib/public/OCM/Exceptions/OCMArgumentException.php | 21 | ||||
-rw-r--r-- | lib/public/OCM/Exceptions/OCMProviderException.php | 21 | ||||
-rw-r--r-- | lib/public/OCM/ICapabilityAwareOCMProvider.php | 60 | ||||
-rw-r--r-- | lib/public/OCM/IOCMDiscoveryService.php | 21 | ||||
-rw-r--r-- | lib/public/OCM/IOCMProvider.php | 52 | ||||
-rw-r--r-- | lib/public/OCM/IOCMResource.php | 27 |
7 files changed, 103 insertions, 124 deletions
diff --git a/lib/public/OCM/Events/ResourceTypeRegisterEvent.php b/lib/public/OCM/Events/ResourceTypeRegisterEvent.php index 1048d8d0d49..c0129197566 100644 --- a/lib/public/OCM/Events/ResourceTypeRegisterEvent.php +++ b/lib/public/OCM/Events/ResourceTypeRegisterEvent.php @@ -1,26 +1,9 @@ <?php declare(strict_types=1); -/* - * @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> - * - * @author Joas Schilling <coding@schilljs.com> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * +/** + * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ namespace OCP\OCM\Events; @@ -49,7 +32,7 @@ class ResourceTypeRegisterEvent extends Event { * @param string $name * @param list<string> $shareTypes List of supported share recipients, e.g. 'user', 'group', … * @param array<string, string> $protocols List of supported protocols and their location, - * e.g. ['webdav' => '/remote.php/webdav/'] + * e.g. ['webdav' => '/remote.php/webdav/'] * @since 28.0.0 */ public function registerResourceType(string $name, array $shareTypes, array $protocols): void { diff --git a/lib/public/OCM/Exceptions/OCMArgumentException.php b/lib/public/OCM/Exceptions/OCMArgumentException.php index e3abd7bf26b..386c8c39b48 100644 --- a/lib/public/OCM/Exceptions/OCMArgumentException.php +++ b/lib/public/OCM/Exceptions/OCMArgumentException.php @@ -3,25 +3,8 @@ declare(strict_types=1); /** - * @copyright 2023, Maxence Lange <maxence@artificial-owl.com> - * - * @author Maxence Lange <maxence@artificial-owl.com> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * + * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ namespace OCP\OCM\Exceptions; diff --git a/lib/public/OCM/Exceptions/OCMProviderException.php b/lib/public/OCM/Exceptions/OCMProviderException.php index 32dab10dc68..b24f1d1e1b1 100644 --- a/lib/public/OCM/Exceptions/OCMProviderException.php +++ b/lib/public/OCM/Exceptions/OCMProviderException.php @@ -3,25 +3,8 @@ declare(strict_types=1); /** - * @copyright 2023, Maxence Lange <maxence@artificial-owl.com> - * - * @author Maxence Lange <maxence@artificial-owl.com> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * + * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ namespace OCP\OCM\Exceptions; diff --git a/lib/public/OCM/ICapabilityAwareOCMProvider.php b/lib/public/OCM/ICapabilityAwareOCMProvider.php new file mode 100644 index 00000000000..ae290abd2f8 --- /dev/null +++ b/lib/public/OCM/ICapabilityAwareOCMProvider.php @@ -0,0 +1,60 @@ +<?php + +declare(strict_types=1); + +/** + * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ +namespace OCP\OCM; + +/** + * Version 1.1 and 1.2 extensions to the Open Cloud Mesh Discovery API + * @link https://github.com/cs3org/OCM-API/ + * @since 32.0.0 + */ +interface ICapabilityAwareOCMProvider extends IOCMProvider { + /** + * get the capabilities + * + * @return array + * @since 32.0.0 + */ + public function getCapabilities(): array; + + /** + * get the provider name + * + * @return string + * @since 32.0.0 + */ + public function getProvider(): string; + + /** + * returns the invite accept dialog + * + * @return string + * @since 32.0.0 + */ + public function getInviteAcceptDialog(): string; + + /** + * set the capabilities + * + * @param array $capabilities + * + * @return $this + * @since 32.0.0 + */ + public function setCapabilities(array $capabilities): static; + + /** + * set the invite accept dialog + * + * @param string $inviteAcceptDialog + * + * @return $this + * @since 32.0.0 + */ + public function setInviteAcceptDialog(string $inviteAcceptDialog): static; +} diff --git a/lib/public/OCM/IOCMDiscoveryService.php b/lib/public/OCM/IOCMDiscoveryService.php index 2407e7b24e8..743c9d78958 100644 --- a/lib/public/OCM/IOCMDiscoveryService.php +++ b/lib/public/OCM/IOCMDiscoveryService.php @@ -3,25 +3,8 @@ declare(strict_types=1); /** - * @copyright Copyright (c) 2023 Maxence Lange <maxence@artificial-owl.com> - * - * @author Maxence Lange <maxence@artificial-owl.com> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * + * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ namespace OCP\OCM; diff --git a/lib/public/OCM/IOCMProvider.php b/lib/public/OCM/IOCMProvider.php index 6df7eed370c..7141b0a9ab9 100644 --- a/lib/public/OCM/IOCMProvider.php +++ b/lib/public/OCM/IOCMProvider.php @@ -3,27 +3,9 @@ declare(strict_types=1); /** - * @copyright Copyright (c) 2023 Maxence Lange <maxence@artificial-owl.com> - * - * @author Maxence Lange <maxence@artificial-owl.com> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * + * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ - namespace OCP\OCM; use JsonSerializable; @@ -34,6 +16,7 @@ use OCP\OCM\Exceptions\OCMProviderException; * Model based on the Open Cloud Mesh Discovery API * @link https://github.com/cs3org/OCM-API/ * @since 28.0.0 + * @deprecated 32.0.0 Please use {@see \OCP\OCM\ICapabilityAwareOCMProvider} */ interface IOCMProvider extends JsonSerializable { /** @@ -137,6 +120,22 @@ interface IOCMProvider extends JsonSerializable { */ public function extractProtocolEntry(string $resourceName, string $protocol): string; + // /** + // * store signatory (public/private key pair) to sign outgoing/incoming request + // * + // * @param Signatory $signatory + // * @experimental 31.0.0 + // */ + // public function setSignatory(Signatory $signatory): void; + + // /** + // * signatory (public/private key pair) used to sign outgoing/incoming request + // * + // * @return Signatory|null returns null if no Signatory available + // * @experimental 31.0.0 + // */ + // public function getSignatory(): ?Signatory; + /** * import data from an array * @@ -151,13 +150,18 @@ interface IOCMProvider extends JsonSerializable { /** * @return array{ * enabled: bool, - * apiVersion: string, + * apiVersion: '1.0-proposal1', * endPoint: string, - * resourceTypes: array{ + * publicKey?: array{ + * keyId: string, + * publicKeyPem: string + * }, + * resourceTypes: list<array{ * name: string, - * shareTypes: string[], + * shareTypes: list<string>, * protocols: array<string, string> - * }[] + * }>, + * version: string * } * @since 28.0.0 */ diff --git a/lib/public/OCM/IOCMResource.php b/lib/public/OCM/IOCMResource.php index 242c77116f1..60bf701e8ea 100644 --- a/lib/public/OCM/IOCMResource.php +++ b/lib/public/OCM/IOCMResource.php @@ -3,25 +3,8 @@ declare(strict_types=1); /** - * @copyright Copyright (c) 2023 Maxence Lange <maxence@artificial-owl.com> - * - * @author Maxence Lange <maxence@artificial-owl.com> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * + * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ namespace OCP\OCM; @@ -56,7 +39,7 @@ interface IOCMResource extends JsonSerializable { /** * set share types * - * @param string[] $shareTypes + * @param list<string> $shareTypes * * @return $this * @since 28.0.0 @@ -66,7 +49,7 @@ interface IOCMResource extends JsonSerializable { /** * get share types * - * @return string[] + * @return list<string> * @since 28.0.0 */ public function getShareTypes(): array; @@ -102,7 +85,7 @@ interface IOCMResource extends JsonSerializable { /** * @return array{ * name: string, - * shareTypes: string[], + * shareTypes: list<string>, * protocols: array<string, string> * } * @since 28.0.0 |