chore(encryption): Remove unused attribute $uid in KeyManager::getFileKey

It’s a private API in the application, no need to keep an unused

attribute.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>

[skip ci]
This commit is contained in:
Côme Chilliet 2025-09-08 16:21:31 +02:00 committed by backportbot[bot]
parent ca4dfe5575
commit d58f82cde3
5 changed files with 5 additions and 5 deletions

View file

@ -85,7 +85,7 @@ class DropLegacyFileKey extends Command {
$output->writeln('<error>' . $path . ' does not have a proper header</error>');
} else {
try {
$legacyFileKey = $this->keyManager->getFileKey($path, null, true);
$legacyFileKey = $this->keyManager->getFileKey($path, true);
if ($legacyFileKey === '') {
$output->writeln('Got an empty legacy filekey for ' . $path . ', continuing', OutputInterface::VERBOSITY_VERBOSE);
continue;

View file

@ -437,7 +437,7 @@ class Encryption implements IEncryptionModule {
* @throws DecryptionFailedException
*/
public function isReadable($path, $uid) {
$fileKey = $this->keyManager->getFileKey($path, $uid, null);
$fileKey = $this->keyManager->getFileKey($path, null);
if (empty($fileKey)) {
$owner = $this->util->getOwner($path);
if ($owner !== $uid) {

View file

@ -182,7 +182,7 @@ class Recovery {
if ($item['type'] === 'dir') {
$this->addRecoveryKeys($filePath . '/');
} else {
$fileKey = $this->keyManager->getFileKey($filePath, $this->user->getUID(), null);
$fileKey = $this->keyManager->getFileKey($filePath, null);
if (!empty($fileKey)) {
$accessList = $this->file->getAccessList($filePath);
$publicKeys = [];

View file

@ -248,7 +248,7 @@ class EncryptionTest extends TestCase {
->willReturn(true);
$this->keyManagerMock->expects($this->once())
->method('getFileKey')
->with($path, null, null, true)
->with($path, null, true)
->willReturn($fileKey);
$this->instance->begin($path, 'user', 'r', [], []);

View file

@ -443,7 +443,7 @@ class KeyManagerTest extends TestCase {
}
$this->assertSame($expected,
$this->instance->getFileKey($path, null, null)
$this->instance->getFileKey($path, null)
);
}