diff options
Diffstat (limited to 'lib/private/Encryption/Manager.php')
-rw-r--r-- | lib/private/Encryption/Manager.php | 44 |
1 files changed, 17 insertions, 27 deletions
diff --git a/lib/private/Encryption/Manager.php b/lib/private/Encryption/Manager.php index f751bd94b28..f48d259eea0 100644 --- a/lib/private/Encryption/Manager.php +++ b/lib/private/Encryption/Manager.php @@ -32,39 +32,24 @@ use OC\Memcache\ArrayCache; use OC\ServiceUnavailableException; use OCP\Encryption\IEncryptionModule; use OCP\Encryption\IManager; +use OCP\Files\Mount\IMountPoint; +use OCP\Files\Storage\IStorage; use OCP\IConfig; use OCP\IL10N; use Psr\Log\LoggerInterface; class Manager implements IManager { - /** @var array */ - protected $encryptionModules; - - /** @var IConfig */ - protected $config; - - protected LoggerInterface $logger; - - /** @var Il10n */ - protected $l; - - /** @var View */ - protected $rootView; - - /** @var Util */ - protected $util; - - /** @var ArrayCache */ - protected $arrayCache; - - public function __construct(IConfig $config, LoggerInterface $logger, IL10N $l10n, View $rootView, Util $util, ArrayCache $arrayCache) { + protected array $encryptionModules; + + public function __construct( + protected IConfig $config, + protected LoggerInterface $logger, + protected IL10N $l, + protected View $rootView, + protected Util $util, + protected ArrayCache $arrayCache, + ) { $this->encryptionModules = []; - $this->config = $config; - $this->logger = $logger; - $this->l = $l10n; - $this->rootView = $rootView; - $this->util = $util; - $this->arrayCache = $arrayCache; } /** @@ -234,6 +219,11 @@ class Manager implements IManager { } } + public function forceWrapStorage(IMountPoint $mountPoint, IStorage $storage) { + $encryptionWrapper = new EncryptionWrapper($this->arrayCache, $this, $this->logger); + return $encryptionWrapper->wrapStorage($mountPoint->getMountPoint(), $storage, $mountPoint, true); + } + /** * check if key storage is ready |