diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-11-29 22:02:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-29 22:02:23 +0100 |
commit | 331f3b2652c39cde05a8cdd774c5a290a0aac8bc (patch) | |
tree | ff280f37298a3aeb8cb0103895a9f214fcf66484 /lib | |
parent | a915594b03757a9e7f3f0a266dd29003ac6dd7d0 (diff) | |
parent | df32b7a40e794a9fc388e033d7d9cf26362d5132 (diff) | |
download | nextcloud-server-331f3b2652c39cde05a8cdd774c5a290a0aac8bc.tar.gz nextcloud-server-331f3b2652c39cde05a8cdd774c5a290a0aac8bc.zip |
Merge pull request #12691 from nextcloud/storage-no-encryption-interface
Add interface to allow storages from opting out of encryption
Diffstat (limited to 'lib')
-rw-r--r-- | lib/composer/composer/autoload_classmap.php | 1 | ||||
-rw-r--r-- | lib/composer/composer/autoload_static.php | 1 | ||||
-rw-r--r-- | lib/private/Encryption/EncryptionWrapper.php | 4 | ||||
-rw-r--r-- | lib/public/Files/Storage/IDisableEncryptionStorage.php | 31 |
4 files changed, 34 insertions, 3 deletions
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index 3f391d51974..a365ae15c67 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -227,6 +227,7 @@ return array( 'OCP\\Files\\StorageInvalidException' => $baseDir . '/lib/public/Files/StorageInvalidException.php', 'OCP\\Files\\StorageNotAvailableException' => $baseDir . '/lib/public/Files/StorageNotAvailableException.php', 'OCP\\Files\\StorageTimeoutException' => $baseDir . '/lib/public/Files/StorageTimeoutException.php', + 'OCP\\Files\\Storage\\IDisableEncryptionStorage' => $baseDir . '/lib/public/Files/Storage/IDisableEncryptionStorage.php', 'OCP\\Files\\Storage\\ILockingStorage' => $baseDir . '/lib/public/Files/Storage/ILockingStorage.php', 'OCP\\Files\\Storage\\INotifyStorage' => $baseDir . '/lib/public/Files/Storage/INotifyStorage.php', 'OCP\\Files\\Storage\\IStorage' => $baseDir . '/lib/public/Files/Storage/IStorage.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index 5b8c5b195e5..a85163c6dde 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -257,6 +257,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c 'OCP\\Files\\StorageInvalidException' => __DIR__ . '/../../..' . '/lib/public/Files/StorageInvalidException.php', 'OCP\\Files\\StorageNotAvailableException' => __DIR__ . '/../../..' . '/lib/public/Files/StorageNotAvailableException.php', 'OCP\\Files\\StorageTimeoutException' => __DIR__ . '/../../..' . '/lib/public/Files/StorageTimeoutException.php', + 'OCP\\Files\\Storage\\IDisableEncryptionStorage' => __DIR__ . '/../../..' . '/lib/public/Files/Storage/IDisableEncryptionStorage.php', 'OCP\\Files\\Storage\\ILockingStorage' => __DIR__ . '/../../..' . '/lib/public/Files/Storage/ILockingStorage.php', 'OCP\\Files\\Storage\\INotifyStorage' => __DIR__ . '/../../..' . '/lib/public/Files/Storage/INotifyStorage.php', 'OCP\\Files\\Storage\\IStorage' => __DIR__ . '/../../..' . '/lib/public/Files/Storage/IStorage.php', diff --git a/lib/private/Encryption/EncryptionWrapper.php b/lib/private/Encryption/EncryptionWrapper.php index d0f3ae79d48..c4650d39ee3 100644 --- a/lib/private/Encryption/EncryptionWrapper.php +++ b/lib/private/Encryption/EncryptionWrapper.php @@ -82,9 +82,7 @@ class EncryptionWrapper { 'mount' => $mount ]; - if (!$storage->instanceOfStorage('OCA\Files_Sharing\SharedStorage') - && !$storage->instanceOfStorage('OCA\Files_Sharing\External\Storage') - && !$storage->instanceOfStorage('OC\Files\Storage\OwnCloud')) { + if (!$storage->instanceOfStorage(Storage\IDisableEncryptionStorage::class)) { $user = \OC::$server->getUserSession()->getUser(); $mountManager = Filesystem::getMountManager(); diff --git a/lib/public/Files/Storage/IDisableEncryptionStorage.php b/lib/public/Files/Storage/IDisableEncryptionStorage.php new file mode 100644 index 00000000000..5ec4a2be843 --- /dev/null +++ b/lib/public/Files/Storage/IDisableEncryptionStorage.php @@ -0,0 +1,31 @@ +<?php +/** + * @copyright Copyright (c) 2018 Robin Appelman <robin@icewind.nl> + * + * @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/>. + * + */ + +namespace OCP\Files\Storage; + +/** + * Marks that a storage does not support server side encryption + * + * @since 16.0.0 + */ +interface IDisableEncryptionStorage { + +}
\ No newline at end of file |