encryption 2.0 app - #14472
Conversation
There was a problem hiding this comment.
yes needs refactoring, a lot of things are not in di either.
There was a problem hiding this comment.
Yes, its just an identifier for the key, it used to be an md5 of the time so security isnt a big concern.
There was a problem hiding this comment.
http://crypto.junod.info/2012/05/24/owncloud-4-0-and-encryption/ – that's how we generated the key in the past, so we had quite some mistakes 🙈
But you are absolutely right: In this case this is okay. Valid point 👍
There was a problem hiding this comment.
But you are absolutely right
Never get tired of hearing that 😉 Lol (as infrequently as i do...)
92b1dea to
e84bdb0
Compare
There was a problem hiding this comment.
please get rid of this - that's what different exception classes are for
There was a problem hiding this comment.
Was copying functionality over, already have a note to update. (will be in next update)
|
2.6k SLOC and not one single unit test? @schiesbn @th3fallen did you miss to add them? (Let there be hope ....) |
|
@DeepDiver1975 can't speak for @th3fallen but I assume that he is still in the state where he copied a lot of stuff from the old encryption app, restructure it, start adding new code etc. So it is probably to early for unit tests (similar to my pr). I'm quite sure unit test will come if it is the right time for it. @th3fallen of course you will add new unit tests for your classes and methods. But because most of the existing test in apps/files_encryption are quite high level you can probably reuse most of it as a addition to the new tests. I would also recommend to keep most of them around. Over time we added a lot of corner cases to the tests. So if the old (high-level) tests will pass on the new encryption we can already be quite sure that a lot of the new stuff works as expected. |
There was a problem hiding this comment.
you no longer need to register a stream wrapper. The stream wrapper is now in core
There was a problem hiding this comment.
thanks removed, will push with next update
Well - in the first place we can keep the existing Furthermore unit test are to be written TOGETHER with the code and not afterwards. Feel free to ping me anytime to get into the details - maybe a personal talk is better suited then commenting on github. Thanks |
|
You probably also don't need all the file and sharing related hooks. Rename and delete operations will update the key storage right here https://github.com/owncloud/core/pull/14376/files#diff-a36b9c0307e0126dd50baa38fb4bb74aR1 And I think I will also listen to share hooks in core calculate the new list of users and then use the update() call to inform you that a file/folder needs to be re-encrypted for a new set of users https://github.com/owncloud/core/pull/14376/files#diff-8d7e0ca7514556cd6929b4c073c9629dR90 |
|
thanks for the notes @schiesbn will update, @DeepDiver1975 Since this is much more of a refactor than a rewrite i was waiting until i go the functionality copied over before i assessed the current status of tests. So i don't end up writing tests that are already written. |
well - this is only partially valid - the existing test are more of an integration test type - we require unit tests. I'm bugging you all that much - because code needs to written and structured in a way that true unit testing is possible. Just coding right away and applying unit tests afterwards will break. So these are my requirement:
^ Still applies 😉 |
|
fair enough... adds another thing to my list |
dd1cbf7 to
bc57d17
Compare
bc57d17 to
1c58251
Compare
Write the unit tests in advance. Design the way you want to interact with the encryption in the unit/acceptance test and then write the implement the code that does the work ;) Trust me: This will make the code a lot better! ;) |
There was a problem hiding this comment.
From a unit test and performance POV using an Storage interface here makes more sense instead of the View - do I miss anything?
There was a problem hiding this comment.
It would be better to have seperate key stores for system keys and user keys (where you inject the $uid so you have one keystore object per user)
Additionally instead of working on a View you should work directly on a Storage
The storage should have the keys in the root of the storage (create a new local storage for $user->getHome() .'/files/encryption' or $dataDir . '/files_encryption)
Working on a view wont work since you need to access the keyfiles without going trough encryption.
There was a problem hiding this comment.
@icewind1991 can I ask you to come up with a POC on this approach? A PR against this branch would be best I guess - THX
There was a problem hiding this comment.
And unit tested of course 😉
|
@DeepDiver1975 should setupServerSide() be a part of the app or core? Also ready() |
seems specific to the encryption implementation as it creates the keys |
the same I guess |
|
that might be better suited in core - as the keystore implementation know about the location of that folder: https://github.com/owncloud/core/blob/master/apps/files_encryption/lib/util.php#L156 |
|
what i thought but wanted a second opinion. Thanks, boy this util class is a mess. |
|
i thought that was the case but i assumed there was a reason it was in the code.... What i get for assuming... |
dependencies in info.xml are relative new (since 8.0) - that's why 😉 |
b82f07b to
54a3bdf
Compare
|
A new inspection was created. |
|
The inspection completed: 32 new issues, 273 updated code elements |
|
yes. awesome work guys :-) |
|
A new inspection was created. |
…stored in cache table
|
A new inspection was created. |
|
🎉 🍺 🙌 |
|
👍 |
|
@DeepDiver1975 missing migrator shouldn't we wait for that? |
we do this isolated in order to get going with other open prs |
|
👍 migration will come in a seperate pull request later today |
There was a problem hiding this comment.
There was a problem hiding this comment.
You know us crazy Americans and our crazy date formats....
There was a problem hiding this comment.
This feels totally wrong :(
Returns boolean, string and can throw errors 🙈 🙉 🙊
|
file headers will be fixed with the license script .. pr is #15441 |





Depends on #14376
Very much in development. Please point out any missed opportunities to use new methods/interfaces @schiesbn
TODOs:
To Test:
Broken scenarios: