Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable22] add migration for encryption keys in wrong location #35826

Merged
merged 2 commits into from
Dec 30, 2022

Conversation

PVince81
Copy link
Member

@PVince81 PVince81 commented Dec 19, 2022

Backport of #35500 to stable22

Reason: it might be necessary to repair encryption keys before upgrading

Signed-off-by: Robin Appelman <robin@icewind.nl>

/**
* @param Folder $folder
* @return \Generator<File>

Check notice

Code scanning / Psalm

MoreSpecificReturnType

The declared return type 'Generator<mixed, OCP\Files\File, mixed, mixed>' for OCA\Encryption\Command\FixKeyLocation::getAllFiles is more specific than the inferred return type 'Generator<int|mixed, OCP\Files\File|OCP\Files\Node, mixed, void>'
protected function execute(InputInterface $input, OutputInterface $output): int {
$dryRun = $input->getOption('dry-run');
$userId = $input->getArgument('user');
$user = $this->userManager->get($userId);

Check notice

Code scanning / Psalm

PossiblyInvalidArgument

Argument 1 of OCP\IUserManager::get expects string, possibly different type array<array-key, string>|null|string provided
$userId = $input->getArgument('user');
$user = $this->userManager->get($userId);
if (!$user) {
$output->writeln("<error>User $userId not found</error>");

Check notice

Code scanning / Psalm

PossiblyInvalidCast

array<array-key, string> cannot be cast to string
Signed-off-by: Robin Appelman <robin@icewind.nl>
@icewind1991 icewind1991 merged commit 4fced6d into stable22 Dec 30, 2022
@icewind1991 icewind1991 deleted the backport/35107/stable22 branch December 30, 2022 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants