Encryption copy keys first3 - #40483
Merged
Merged
Conversation
Member
Author
|
@phil-davis any chance to test this PR with all the apps in order to prevent having to revert it if something goes wrong? |
MeCorey
suggested changes
Nov 15, 2022
| if (!$this->util->isExcluded($source)) { | ||
| $target = $this->getFullPath($path2); | ||
| if (isset($this->unencryptedSize[$source])) { | ||
| $this->unencryptedSize[$target] = $this->unencryptedSize[$source]; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Member
Author
|
ping |
IljaN
reviewed
Dec 14, 2022
IljaN
left a comment
Contributor
There was a problem hiding this comment.
No need to check for exceptions as the files are always in a readable/acessible state between both operations. LGTM 👍
Restarting CI to check why it fails.
Contributor
|
💥 Acceptance tests pipeline webUILogin-chrome-mariadb10.2-php7.4 failed. The build has been cancelled. |
Contributor
|
|
IljaN
force-pushed
the
encryption_copy_keys_first3
branch
from
December 15, 2022 10:54
0d35d42 to
93ccf92
Compare
|
The only test failing is related to |
IljaN
self-requested a review
December 21, 2022 11:57
IljaN
approved these changes
Dec 21, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Follow up on #40433 to solve https://github.com/owncloud/enterprise/issues/5344
The PR will copy the encryption keys instead of renaming them, so in case of error we can revert the action and we keep the encryption keys in the right location so the target file can be decrypted.
It seems the old PR was causing problems due to the failures caused by empty directories, which don't have encryption keys associated. The copyKeys method was reporting a failure because the expected directory with the keys doesn't exist. This has been adjusted: both copyKeys and renameKeys methods will return true if the directory doesn't exists.
Related Issue
https://github.com/owncloud/enterprise/issues/5344
Motivation and Context
Tests from other apps were failing due to the changes made in the old PR (which was reverted). This PR should cover the old failing scenarios.
How Has This Been Tested?
Checked some of the previously failing scenarios.
With the old PR, a log about the encryption keys not being copied was showing. There was a forbidden exception happening. This is not happening with this PR.
occ encryption:recreate-master-keycommandWith the old PR, there were errors happening and uploading wasn't possible. This is also fixed with this PR.
There were errors happening in the acceptance tests (these steps are based on the failing test). It works fine with the PR.
Screenshots (if appropriate):
Types of changes
Checklist: