Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/encryption/lib/Command/CleanOrphanedKeys.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
namespace OCA\Encryption\Command;

use OC\Encryption\Util;
use OC\Files\SetupManager;
use OCA\Encryption\Crypto\Encryption;
use OCP\Files\File;
use OCP\Files\Folder;
use OCP\Files\IRootFolder;
use OCP\Files\ISetupManager;
use OCP\Files\NotFoundException;
use OCP\IConfig;
use OCP\IUser;
Expand All @@ -34,7 +34,7 @@ public function __construct(
protected QuestionHelper $questionHelper,
private IUserManager $userManager,
private Util $encryptionUtil,
private SetupManager $setupManager,
private ISetupManager $setupManager,
private IRootFolder $rootFolder,
private LoggerInterface $logger,
) {
Expand Down
4 changes: 2 additions & 2 deletions apps/encryption/lib/Command/DropLegacyFileKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

use OC\Encryption\Exceptions\DecryptionFailedException;
use OC\Files\FileInfo;
use OC\Files\SetupManager;
use OC\Files\View;
use OCA\Encryption\KeyManager;
use OCP\Encryption\Exceptions\GenericEncryptionException;
use OCP\Files\ISetupManager;
use OCP\IUser;
use OCP\IUserManager;
use Symfony\Component\Console\Command\Command;
Expand All @@ -27,7 +27,7 @@ class DropLegacyFileKey extends Command {
public function __construct(
private readonly IUserManager $userManager,
private readonly KeyManager $keyManager,
private readonly SetupManager $setupManager,
private readonly ISetupManager $setupManager,
) {
parent::__construct();

Expand Down
4 changes: 2 additions & 2 deletions apps/encryption/lib/Command/FixEncryptedVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

namespace OCA\Encryption\Command;

use OC\Files\SetupManager;
use OC\Files\Storage\Wrapper\Encryption;
use OC\Files\View;
use OC\ServerNotAvailableException;
use OCA\Encryption\Util;
use OCP\Encryption\Exceptions\InvalidHeaderException;
use OCP\Files\ISetupManager;
use OCP\HintException;
use OCP\IConfig;
use OCP\IUser;
Expand All @@ -34,7 +34,7 @@ public function __construct(
private readonly IUserManager $userManager,
private readonly Util $util,
private readonly View $view,
private readonly SetupManager $setupManager,
private readonly ISetupManager $setupManager,
) {
parent::__construct();
}
Expand Down
4 changes: 2 additions & 2 deletions apps/encryption/lib/Command/FixKeyLocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

use OC\Encryption\Manager;
use OC\Encryption\Util;
use OC\Files\SetupManager;
use OC\Files\Storage\Wrapper\Encryption;
use OC\Files\View;
use OCP\Encryption\IManager;
Expand All @@ -19,6 +18,7 @@
use OCP\Files\File;
use OCP\Files\Folder;
use OCP\Files\IRootFolder;
use OCP\Files\ISetupManager;
use OCP\Files\Node;
use OCP\IUser;
use OCP\IUserManager;
Expand All @@ -38,7 +38,7 @@ public function __construct(
private readonly IUserMountCache $userMountCache,
private readonly Util $encryptionUtil,
private readonly IRootFolder $rootFolder,
private readonly SetupManager $setupManager,
private readonly ISetupManager $setupManager,
IManager $encryptionManager,
) {
$this->keyRootDirectory = rtrim($this->encryptionUtil->getKeyStorageRoot(), '/');
Expand Down
4 changes: 2 additions & 2 deletions apps/encryption/lib/Command/ScanLegacyFormat.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
*/
namespace OCA\Encryption\Command;

use OC\Files\SetupManager;
use OC\Files\View;
use OCA\Encryption\Util;
use OCP\Files\ISetupManager;
use OCP\IConfig;
use OCP\IUser;
use OCP\IUserManager;
Expand All @@ -27,7 +27,7 @@ public function __construct(
protected readonly IConfig $config,
protected readonly QuestionHelper $questionHelper,
private readonly IUserManager $userManager,
private readonly SetupManager $setupManager,
private readonly ISetupManager $setupManager,
) {
parent::__construct();

Expand Down
4 changes: 2 additions & 2 deletions apps/encryption/lib/Crypto/EncryptAll.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
namespace OCA\Encryption\Crypto;

use OC\Encryption\Exceptions\DecryptionFailedException;
use OC\Files\SetupManager;
use OC\Files\View;
use OCA\Encryption\KeyManager;
use OCA\Encryption\Users\Setup;
use OCA\Encryption\Util;
use OCP\Files\FileInfo;
use OCP\Files\ISetupManager;
use OCP\IConfig;
use OCP\IL10N;
use OCP\IUser;
Expand Down Expand Up @@ -53,7 +53,7 @@ public function __construct(
protected readonly QuestionHelper $questionHelper,
protected readonly ISecureRandom $secureRandom,
protected readonly LoggerInterface $logger,
protected readonly SetupManager $setupManager,
protected readonly ISetupManager $setupManager,
) {
}

Expand Down
8 changes: 2 additions & 6 deletions apps/encryption/lib/Listeners/UserEventsListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,15 @@

use OC\Core\Events\BeforePasswordResetEvent;
use OC\Core\Events\PasswordResetEvent;
use OC\Files\SetupManager;
use OCA\Encryption\KeyManager;
use OCA\Encryption\Services\PassphraseService;
use OCA\Encryption\Session;
use OCA\Encryption\Users\Setup;
use OCA\Encryption\Util;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
use OCP\Files\ISetupManager;
use OCP\IUser;
use OCP\IUserManager;
use OCP\IUserSession;
use OCP\Lockdown\ILockdownManager;
use OCP\User\Events\BeforePasswordUpdatedEvent;
use OCP\User\Events\PasswordUpdatedEvent;
Expand All @@ -40,9 +38,7 @@ public function __construct(
private Setup $userSetup,
private Session $session,
private KeyManager $keyManager,
private IUserManager $userManager,
private IUserSession $userSession,
private SetupManager $setupManager,
private ISetupManager $setupManager,
private PassphraseService $passphraseService,
private ILockdownManager $lockdownManager,
) {
Expand Down
4 changes: 2 additions & 2 deletions apps/encryption/tests/Command/FixEncryptedVersionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

namespace OCA\Encryption\Tests\Command;

use OC\Files\SetupManager;
use OC\Files\View;
use OCA\Encryption\Command\FixEncryptedVersion;
use OCA\Encryption\Util;
use OCP\Encryption\IManager;
use OCP\Files\ISetupManager;
use OCP\IAppConfig;
use OCP\IConfig;
use OCP\ITempManager;
Expand Down Expand Up @@ -69,7 +69,7 @@ public function setUp(): void {
Server::get(IUserManager::class),
$this->util,
new View('/'),
Server::get(SetupManager::class),
Server::get(ISetupManager::class),
);
$this->commandTester = new CommandTester($this->fixEncryptedVersion);

Expand Down
6 changes: 3 additions & 3 deletions apps/encryption/tests/Crypto/EncryptAllTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
*/
namespace OCA\Encryption\Tests\Crypto;

use OC\Files\SetupManager;
use OC\Files\View;
use OCA\Encryption\Crypto\EncryptAll;
use OCA\Encryption\KeyManager;
use OCA\Encryption\Users\Setup;
use OCA\Encryption\Util;
use OCP\Files\FileInfo;
use OCP\Files\ISetupManager;
use OCP\IConfig;
use OCP\IL10N;
use OCP\IUser;
Expand Down Expand Up @@ -50,7 +50,7 @@ class EncryptAllTest extends TestCase {
protected UserInterface&MockObject $userInterface;
protected ISecureRandom&MockObject $secureRandom;
protected LoggerInterface&MockObject $logger;
protected SetupManager&MockObject $setupManager;
protected ISetupManager&MockObject $setupManager;
protected IUser&MockObject $user1;
protected IUser&MockObject $user2;

Expand Down Expand Up @@ -84,7 +84,7 @@ protected function setUp(): void {
$this->userInterface = $this->getMockBuilder(UserInterface::class)
->disableOriginalConstructor()->getMock();
$this->logger = $this->createMock(LoggerInterface::class);
$this->setupManager = $this->createMock(SetupManager::class);
$this->setupManager = $this->createMock(ISetupManager::class);

/**
* We need format method to return a string
Expand Down
15 changes: 3 additions & 12 deletions apps/encryption/tests/Listeners/UserEventsListenersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@

use OC\Core\Events\BeforePasswordResetEvent;
use OC\Core\Events\PasswordResetEvent;
use OC\Files\SetupManager;
use OCA\Encryption\KeyManager;
use OCA\Encryption\Listeners\UserEventsListener;
use OCA\Encryption\Services\PassphraseService;
use OCA\Encryption\Session;
use OCA\Encryption\Users\Setup;
use OCA\Encryption\Util;
use OCP\Files\ISetupManager;
use OCP\IUser;
use OCP\IUserManager;
use OCP\IUserSession;
use OCP\Lockdown\ILockdownManager;
use OCP\User\Events\BeforePasswordUpdatedEvent;
use OCP\User\Events\PasswordUpdatedEvent;
Expand All @@ -32,14 +30,11 @@

#[\PHPUnit\Framework\Attributes\Group(name: 'DB')]
class UserEventsListenersTest extends TestCase {

protected Util&MockObject $util;
protected Setup&MockObject $userSetup;
protected Session&MockObject $session;
protected KeyManager&MockObject $keyManager;
protected IUserManager&MockObject $userManager;
protected IUserSession&MockObject $userSession;
protected SetupManager&MockObject $setupManager;
protected ISetupManager&MockObject $setupManager;
protected ILockdownManager&MockObject $lockdownManager;
protected PassphraseService&MockObject $passphraseService;

Expand All @@ -52,9 +47,7 @@ public function setUp(): void {
$this->userSetup = $this->createMock(Setup::class);
$this->session = $this->createMock(Session::class);
$this->keyManager = $this->createMock(KeyManager::class);
$this->userManager = $this->createMock(IUserManager::class);
$this->userSession = $this->createMock(IUserSession::class);
$this->setupManager = $this->createMock(SetupManager::class);
$this->setupManager = $this->createMock(ISetupManager::class);
$this->lockdownManager = $this->createMock(ILockdownManager::class);
$this->passphraseService = $this->createMock(PassphraseService::class);

Expand All @@ -63,8 +56,6 @@ public function setUp(): void {
$this->userSetup,
$this->session,
$this->keyManager,
$this->userManager,
$this->userSession,
$this->setupManager,
$this->passphraseService,
$this->lockdownManager,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

use OC\AppFramework\Http;
use OC\Files\Filesystem;
use OC\Files\SetupManager;
use OCA\FederatedFileSharing\AddressHandler;
use OCA\FederatedFileSharing\FederatedShareProvider;
use OCA\Federation\TrustedServers;
Expand All @@ -31,6 +30,7 @@
use OCP\Federation\ICloudIdManager;
use OCP\Federation\ISignedCloudFederationProvider;
use OCP\Files\IFilenameValidator;
use OCP\Files\ISetupManager;
use OCP\Files\NotFoundException;
use OCP\HintException;
use OCP\IConfig;
Expand Down Expand Up @@ -68,7 +68,7 @@ public function __construct(
private readonly LoggerInterface $logger,
private readonly IFilenameValidator $filenameValidator,
private readonly IProviderFactory $shareProviderFactory,
private readonly SetupManager $setupManager,
private readonly ISetupManager $setupManager,
private readonly ExternalShareMapper $externalShareMapper,
) {
}
Expand Down
5 changes: 2 additions & 3 deletions apps/files/lib/BackgroundJob/SanitizeFilenames.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,17 @@
*/
namespace OCA\Files\BackgroundJob;

use OC\Files\SetupManager;
use OCA\Files\AppInfo\Application;
use OCA\Files\Service\SettingsService;
use OCP\AppFramework\Services\IAppConfig;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\IJobList;
use OCP\BackgroundJob\QueuedJob;
use OCP\Config\IUserConfig;
use OCP\Files\File;
use OCP\Files\Folder;
use OCP\Files\IFilenameValidator;
use OCP\Files\IRootFolder;
use OCP\Files\ISetupManager;
use OCP\Files\Node;
use OCP\Files\NotFoundException;
use OCP\IUser;
Expand All @@ -43,7 +42,7 @@ public function __construct(
private IAppConfig $appConfig,
private IUserConfig $userConfig,
private IRootFolder $rootFolder,
private SetupManager $setupManager,
private ISetupManager $setupManager,
private IFilenameValidator $filenameValidator,
private LoggerInterface $logger,
) {
Expand Down
4 changes: 2 additions & 2 deletions apps/files_sharing/lib/External/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
namespace OCA\Files_Sharing\External;

use OC\Files\Filesystem;
use OC\Files\SetupManager;
use OC\User\NoUserException;
use OCA\FederatedFileSharing\Events\FederatedShareAddedEvent;
use OCA\Files_Sharing\Helper;
Expand All @@ -21,6 +20,7 @@
use OCP\Files\Events\InvalidateMountCacheEvent;
use OCP\Files\Folder;
use OCP\Files\IRootFolder;
use OCP\Files\ISetupManager;
use OCP\Files\NotFoundException;
use OCP\Files\NotPermittedException;
use OCP\Files\Storage\IStorageFactory;
Expand Down Expand Up @@ -53,7 +53,7 @@ public function __construct(
private IEventDispatcher $eventDispatcher,
private LoggerInterface $logger,
private IRootFolder $rootFolder,
private SetupManager $setupManager,
private ISetupManager $setupManager,
private ICertificateManager $certificateManager,
private ExternalShareMapper $externalShareMapper,
) {
Expand Down
4 changes: 2 additions & 2 deletions apps/files_sharing/lib/ShareTargetValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
namespace OCA\Files_Sharing;

use OC\Files\Filesystem;
use OC\Files\SetupManager;
use OC\Files\View;
use OCP\Cache\CappedMemoryCache;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\Config\ICachedMountInfo;
use OCP\Files\ISetupManager;
use OCP\Files\Mount\IMountManager;
use OCP\Files\Mount\IMountPoint;
use OCP\IUser;
Expand All @@ -30,7 +30,7 @@ class ShareTargetValidator {
public function __construct(
private readonly IManager $shareManager,
private readonly IEventDispatcher $eventDispatcher,
private readonly SetupManager $setupManager,
private readonly ISetupManager $setupManager,
private readonly IMountManager $mountManager,
) {
$this->folderExistsCache = new CappedMemoryCache();
Expand Down
Loading
Loading