From 5a7f72c6a613aae2a497038c47e0de1a81cdb709 Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Fri, 17 Oct 2025 09:38:20 +0200 Subject: [PATCH 1/2] feat(cloud-federation-api): accept folder shares Normalize resourceType from folder to file in RequestHandlerController::addShare() to allow accepting OCM folder shares from oCIS/OpenCloud/CERNBox. Signed-off-by: Micke Nordin --- .../lib/Controller/RequestHandlerController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php b/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php index e15d57181a369..5a839e79a9c63 100644 --- a/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php +++ b/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php @@ -106,6 +106,9 @@ public function __construct( #[NoCSRFRequired] #[BruteForceProtection(action: 'receiveFederatedShare')] public function addShare($shareWith, $name, $description, $providerId, $owner, $ownerDisplayName, $sharedBy, $sharedByDisplayName, $protocol, $shareType, $resourceType) { + if ($resourceType === 'folder') { + $resourceType = 'file'; + } try { // if request is signed and well signed, no exception are thrown // if request is not signed and host is known for not supporting signed request, no exception are thrown From 432709328c936658a017a258e8049e198f87e547 Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Tue, 28 Oct 2025 15:28:25 +0100 Subject: [PATCH 2/2] feat(cloud-federation-api): Make duplicate entries Solve the problem by adding the provider for both files and folders Signed-off-by: Micke Nordin --- .../lib/Controller/RequestHandlerController.php | 3 --- .../lib/AppInfo/Application.php | 15 +++++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php b/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php index 5a839e79a9c63..e15d57181a369 100644 --- a/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php +++ b/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php @@ -106,9 +106,6 @@ public function __construct( #[NoCSRFRequired] #[BruteForceProtection(action: 'receiveFederatedShare')] public function addShare($shareWith, $name, $description, $providerId, $owner, $ownerDisplayName, $sharedBy, $sharedByDisplayName, $protocol, $shareType, $resourceType) { - if ($resourceType === 'folder') { - $resourceType = 'file'; - } try { // if request is signed and well signed, no exception are thrown // if request is not signed and host is known for not supporting signed request, no exception are thrown diff --git a/apps/federatedfilesharing/lib/AppInfo/Application.php b/apps/federatedfilesharing/lib/AppInfo/Application.php index fda75c475b69f..c4954948a7200 100644 --- a/apps/federatedfilesharing/lib/AppInfo/Application.php +++ b/apps/federatedfilesharing/lib/AppInfo/Application.php @@ -1,7 +1,7 @@ addCloudFederationProvider('file', - 'Federated Files Sharing', - function () use ($appContainer): CloudFederationProviderFiles { - return $appContainer->get(CloudFederationProviderFiles::class); - }); + $fileResourceTypes = ['file', 'folder']; + foreach ($fileResourceTypes as $type) { + $manager->addCloudFederationProvider($type, + 'Federated Files Sharing', + function () use ($appContainer): CloudFederationProviderFiles { + return $appContainer->get(CloudFederationProviderFiles::class); + }); + } } }