aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Encryption/Manager.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Encryption/Manager.php')
-rw-r--r--lib/private/Encryption/Manager.php72
1 files changed, 22 insertions, 50 deletions
diff --git a/lib/private/Encryption/Manager.php b/lib/private/Encryption/Manager.php
index a553d6a55d1..a07c778bfe0 100644
--- a/lib/private/Encryption/Manager.php
+++ b/lib/private/Encryption/Manager.php
@@ -1,27 +1,9 @@
<?php
+
/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Björn Schießle <bjoern@schiessle.org>
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Joas Schilling <coding@schilljs.com>
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- * @author Thomas Müller <thomas.mueller@tmit.eu>
- *
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * 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, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
*/
namespace OC\Encryption;
@@ -32,39 +14,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;
}
/**
@@ -73,7 +40,7 @@ class Manager implements IManager {
* @return bool true if enabled, false if not
*/
public function isEnabled() {
- $installed = $this->config->getSystemValue('installed', false);
+ $installed = $this->config->getSystemValueBool('installed', false);
if (!$installed) {
return false;
}
@@ -234,6 +201,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