Skip to content

Conversation

@mrow4a
Copy link
Contributor

@mrow4a mrow4a commented Mar 25, 2023

Description

With OC10.7 the user-key encyption has been deprecated. This PR makes it not possible to auto-enable user-key encryption when no module is selected when executing occ encryption:encrypt-all

Related Issue

Types of changes

  • Technical debt

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket (not needed)
  • Changelog item, see TEMPLATE

@mrow4a mrow4a requested review from jvillafanez and pako81 March 25, 2023 13:00
@mrow4a mrow4a self-assigned this Mar 25, 2023
@mrow4a mrow4a marked this pull request as ready for review March 25, 2023 13:38
@pako81
Copy link

pako81 commented Mar 25, 2023

Makes sense - @mrow4a maybe this is also a good time to start thinking about removing user-key encryption as an option in the webUI.

@mrow4a
Copy link
Contributor Author

mrow4a commented Mar 26, 2023

Makes sense - @mrow4a maybe this is also a good time to start thinking about removing user-key encryption as an option in the webUI.

yes, I work on bigger change in encryption app to make it work. but not yet finished.

@jvillafanez
Copy link
Member

I think it's better to point the user to what he should do instead of just saying "None of the encryption modules is enabled". You can also add something like "Set master encryption through the web UI" or something like that (not sure if it's possible through command line).

@mrow4a
Copy link
Contributor Author

mrow4a commented Mar 27, 2023

I think it's better to point the user to what he should do instead of just saying "None of the encryption modules is enabled". You can also add something like "Set master encryption through the web UI" or something like that (not sure if it's possible through command line).

it is core repo, this should not be aware of any encryption modules or even the apps that are used, right ? What I did here was to more maintain backwards compatibility with previous development here.

@owncloud owncloud deleted a comment from update-docs bot Mar 27, 2023
Copy link
Contributor

@phil-davis phil-davis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - I suppose that the encryption app should be the place that tries to guide admins if they enable the app but have not yet chosen the master or user key encryption.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell E 1 Code Smell

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@jvillafanez
Copy link
Member

it is core repo, this should not be aware of any encryption modules or even the apps that are used, right ? What I did here was to more maintain backwards compatibility with previous development here.

That's right. It shouldn't but now it is checking if user key or master key encryption is enabled. I'm ok if this is addressed in the future, otherwise the easiest solution is to adjust the error message (making the code module-agnostic will likely take a while)

@mrow4a
Copy link
Contributor Author

mrow4a commented Mar 27, 2023

@jvillafanez now I start thinking, that this part of the code was only to make sure that default encryption mode - use-key encryption - gets enabled by default. I think the best option is just to remove that block instead, as it was hacky anyways. If none of modules is enabled this explodes anyways.

@jvillafanez
Copy link
Member

As long as it explodes with a meaningful message...

From what I understand, there is only one encryption module, which is the default one. "master key" and "user key" are options of such module, which won't be available in other modules.

I think a reasonable approach is to get the encryption module earlier, and show a message with the module id or displayname before starting doing anything. This way, we can give the encryption module a change of throwing an exception if it isn't properly configured (such as not having selected any mode in the default encryption module). There should be a proper method to check if the module is ready, but there isn't any and it's late to add one in the interface.

@DeepDiver1975
Copy link
Member

related: owncloud/encryption#389

new installations will only run master key encryption ...

@mrow4a mrow4a merged commit 5fcffe7 into master Mar 28, 2023
@delete-merged-branch delete-merged-branch bot deleted the e4939-deprec/user-encr branch March 28, 2023 10:59
jnweiger added a commit that referenced this pull request Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants