mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
feat: add IPartialMountProvider to support authoritative mounts
IMountProviders implementing this interface will be able to take advantage of authoritative mounts. The function `getMountsFromMountPoints` will receive the path that the provider is asked to set-up and an array of IMountProviderArgs providing information regarding the stored mount points and the file cache data for the related root. The mount provider should verify the validity of the mounts and return IMountPoints related to them. Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
This commit is contained in:
parent
9b519b4679
commit
fcdb28e4a3
4 changed files with 71 additions and 0 deletions
|
|
@ -420,7 +420,9 @@ return array(
|
|||
'OCP\\Files\\Config\\ICachedMountInfo' => $baseDir . '/lib/public/Files/Config/ICachedMountInfo.php',
|
||||
'OCP\\Files\\Config\\IHomeMountProvider' => $baseDir . '/lib/public/Files/Config/IHomeMountProvider.php',
|
||||
'OCP\\Files\\Config\\IMountProvider' => $baseDir . '/lib/public/Files/Config/IMountProvider.php',
|
||||
'OCP\\Files\\Config\\IMountProviderArgs' => $baseDir . '/lib/public/Files/Config/IMountProviderArgs.php',
|
||||
'OCP\\Files\\Config\\IMountProviderCollection' => $baseDir . '/lib/public/Files/Config/IMountProviderCollection.php',
|
||||
'OCP\\Files\\Config\\IPartialMountProvider' => $baseDir . '/lib/public/Files/Config/IPartialMountProvider.php',
|
||||
'OCP\\Files\\Config\\IRootMountProvider' => $baseDir . '/lib/public/Files/Config/IRootMountProvider.php',
|
||||
'OCP\\Files\\Config\\IUserMountCache' => $baseDir . '/lib/public/Files/Config/IUserMountCache.php',
|
||||
'OCP\\Files\\ConnectionLostException' => $baseDir . '/lib/public/Files/ConnectionLostException.php',
|
||||
|
|
|
|||
|
|
@ -461,7 +461,9 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
|
|||
'OCP\\Files\\Config\\ICachedMountInfo' => __DIR__ . '/../../..' . '/lib/public/Files/Config/ICachedMountInfo.php',
|
||||
'OCP\\Files\\Config\\IHomeMountProvider' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IHomeMountProvider.php',
|
||||
'OCP\\Files\\Config\\IMountProvider' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IMountProvider.php',
|
||||
'OCP\\Files\\Config\\IMountProviderArgs' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IMountProviderArgs.php',
|
||||
'OCP\\Files\\Config\\IMountProviderCollection' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IMountProviderCollection.php',
|
||||
'OCP\\Files\\Config\\IPartialMountProvider' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IPartialMountProvider.php',
|
||||
'OCP\\Files\\Config\\IRootMountProvider' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IRootMountProvider.php',
|
||||
'OCP\\Files\\Config\\IUserMountCache' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IUserMountCache.php',
|
||||
'OCP\\Files\\ConnectionLostException' => __DIR__ . '/../../..' . '/lib/public/Files/ConnectionLostException.php',
|
||||
|
|
|
|||
24
lib/public/Files/Config/IMountProviderArgs.php
Normal file
24
lib/public/Files/Config/IMountProviderArgs.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
namespace OCP\Files\Config;
|
||||
|
||||
use OCP\Files\Cache\ICacheEntry;
|
||||
|
||||
/**
|
||||
* Data-class containing information related to a mount and its root.
|
||||
*
|
||||
* @since 33.0.0
|
||||
*/
|
||||
class IMountProviderArgs {
|
||||
public function __construct(
|
||||
public ICachedMountInfo $mountInfo,
|
||||
public ICacheEntry $cacheEntry,
|
||||
) {
|
||||
}
|
||||
}
|
||||
43
lib/public/Files/Config/IPartialMountProvider.php
Normal file
43
lib/public/Files/Config/IPartialMountProvider.php
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
namespace OCP\Files\Config;
|
||||
|
||||
use OCP\Files\Mount\IMountPoint;
|
||||
use OCP\Files\Storage\IStorageFactory;
|
||||
|
||||
/**
|
||||
* This interface marks mount providers that can provide IMountPoints related to
|
||||
* a path based on the provided mount and root metadata.
|
||||
*
|
||||
* @since 33.0.0
|
||||
*/
|
||||
interface IPartialMountProvider extends IMountProvider {
|
||||
|
||||
/**
|
||||
* Called during the Filesystem setup of a specific path.
|
||||
*
|
||||
* The provided arguments give information about the path being set up,
|
||||
* as well as information about mount points known to be provided by the
|
||||
* mount provider and contained in the path or in its sub-paths.
|
||||
*
|
||||
* Implementations should verify the IMountProviderArgs and return the
|
||||
* corresponding IMountPoint instances.
|
||||
*
|
||||
* @param string $path path for which the mounts are set up
|
||||
* @param IMountProviderArgs[] $mountProviderArgs
|
||||
* @param IStorageFactory $loader
|
||||
* @return array<string, IMountPoint> IMountPoint instances, indexed by
|
||||
* mount-point
|
||||
*/
|
||||
public function getMountsForPath(
|
||||
string $path,
|
||||
array $mountProviderArgs,
|
||||
IStorageFactory $loader,
|
||||
): array;
|
||||
}
|
||||
Loading…
Reference in a new issue