Module description
The Sodium module provides the ability to perform symmetric encryption and decryption of data using the Sodium (libsodium) software library. It leverages the Encrypt module's API, along with the Halite PHP library. An example of another Drupal module that integrates with Encrypt to perform cryptographic operations is Real AES. However, I'm not aware of any other module that supports libsodium.
The project is located here: https://www.drupal.org/sandbox/rlhawk/2692273
Clone the project with this command:
git clone --branch 8.x-1.x https://git.drupal.org/sandbox/rlhawk/2692273.git sodium
There are quite a lot of requirements for this module, but the instructions to install them are on the project page and are fairly straightforward. Directions for creating a key, creating an encryption profile, and testing encryption and decryption are all available on the project page.
Project application reviews
https://www.drupal.org/node/2690547#comment-11005259
https://www.drupal.org/node/2654460#comment-11006849
https://www.drupal.org/node/2651096#comment-11006987
https://www.drupal.org/node/2634052#comment-11027811
https://www.drupal.org/node/2682735#comment-11027149
https://www.drupal.org/node/2618932#comment-11026971
Comments
Comment #2
rlhawkFixed the git clone URL in the issue summary for non-maintainer users, before the PA robot did it.
Comment #3
bigmonmulgrew commentedManual Review
This review uses the Project Application Review Template.
Comment #4
rlhawkThis module is mostly a wrapper around the Halite PHP library, which contains the actual integration with Libsodium. As a maintainer of the Encrypt module, I want to be able to provide strong recommendations for which encryption methods to use. Currently, the best option is Real AES, also a wrapper around a PHP library (Defuse PHP Encryption), which does not yet support streaming encryption, but Libsodium does. This is important for file encryption. I am also a maintainer of Encrypted Files and I'd like to port that functionality to Drupal 8, but with proper streaming encryption.
Once Encrypt is able to handle streaming encryption, this module (Sodium) would be extended to take advantage of it. Other functionality, such as public key encryption, hashing, key generation, and advanced features of Libsodium could also be added, once there's a means of taking advantage of them.
Comment #5
bigmonmulgrew commentedI don't think its officially in the guidelines but I did see a discussion leaning towards granting the permission to promote based of contributions outside the module in the application.
The idea being that a short module is insufficient to show you know the drupal coding style etc well but if you can show you know it in other ways then the permission to promote can be granted.
It might be worth linking a couple of your commits from those projects so even though this project is insufficent to grant you the ability to promote it sounds like you do have the experience necessary.
Comment #6
bigmonmulgrew commentedJust took a look at your profile. I am impressed by the number of commits. I really hope you do know what your doing or theres gonna be a lot of dodgey encryption modules out there.
Maybe you should ask the co-maintainers of those projects to swing by and offer their opinion on you rcompetence with drupal coding.
Comment #7
rlhawkOK, will do.
There was a security advisory on Encrypt last year (https://www.drupal.org/node/2618362), but that was on code that was written before I became a maintainer. I did the majority of the work to fix it though. :-)
Comment #8
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxrlhawk2692273git
We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #9
rlhawkI altered the code to make the robot happy.
Comment #10
rlhawkComment #11
gregglesI'll say that in the past few years rlhawk and I have worked on several issues and he's provided quite a lot of high quality code and reasonable perspectives.
One thought about the length/function number requirement, perhaps you could create some automated tests for this code? That would help to satisfy the letter of the rule and also improve the project.
In general review of the module, I'm not sure it makes sense to catch exceptions and turn them into messages. The code calling this method may want to display its own appropriate message or do something else that makes sense in the context (e.g. drush_log or retry encrypting/decrypting in a different way). Perhaps a more complete solution would be for the encrypt.module to define a set of Exceptions that can be thrown from the encrypt/decrypt methods. Then the responsibility of this Sodium encryption module would be to map the HaliteAlerts into the appropriate encrypt.module exceptions?
Comment #12
rlhawkGreg - Thanks for the feedback. Yes, I definitely want to improve exception handling in Key and Encrypt. In the meantime, your point is well taken and perhaps I should take a cue from Real AES in the way it handles exceptions from the library. I will also add tests to the module.
Comment #13
rlhawkOne thing I noticed is that in the sidebar of the project page, the Issue queue heading reads "Issues for Halite". "Halite" is what I originally called this module before changing it to "Sodium". I'm not sure what needs to be done to fix that.
Comment #14
rlhawkI've added tests for encryption and decryption using Sodium and now the PA robot is even happier.
http://pareview.sh/pareview/httpgitdrupalorgsandboxrlhawk2692273git
Comment #15
th_tushar commentedHi @rlhawk,
Comment #16
greggles@rlhawk in #14 thanks for adding the tests. Perhaps while this is getting reviewed you'll find more time to add some more structure around exceptions?
@th_tushar - thanks for reviewing the project. I used the sloccount tool and it finds 110 lines of php code, so nearly at the 120 limit. A simple grep for function declarations finds 6. As the discussion you linked shows the "120 lines/5 functions" is a guideline and the history of contributions should be factored in for those cases. If you look at rlhawk's profile you can see he's done a ton of other work which I think justifies granting git vetted user status rather than doing the single project promotion.
Comment #17
th_tushar commentedOk. Removing the Single project promote tag. :-)
Comment #18
rlhawk@greggles: Yep, I've already started improving exceptions in Key with #2693145: Add "set key value" functionality to Key entity.
Comment #19
bigmonmulgrew commented@th_tushar Considering though that we are vetting the individual for git vetted status surely its reasonable to go outside one project in some cases. In this case checking rlhawk's profile shows the project he has contributed to the most as Key. Hes also the largest commiter of that project in terms of number of commits by a considerable margin
@rlhawk I've seen plenty of debate regarding giving git vetted status to people who show they understand the Drupal way of doing things but only have a short module to submit. Its up to yo uhow much hassle you want to go through. You could go for single project promotion or you could hope that the first git overlord to look into the issue decides your other work is good enough to grant you access.
Assuming you did want to go argue for git vetted status based on your other projects I'd start by doing an automated review of the Key module and sort the issues there. I've just done one and Key is far from best practice.
http://pareview.sh/pareview/httpgitdrupalorgprojectkeygit
Either way why not take this as an opportunity to do some sprinng cleaning and go fix the automated test errors on Key. Too many modules let the standards slip once they are released.
@greggles While I've seen people on both sides of the debate and much debate on it, personally I feel any user has commited to Drupal in such a huge way deserves git vetted status, assuming their code is up to scratch.
Comment #20
rlhawk@bigmonmulgrew - That makes sense, thanks. I'll do some spring cleaning on the Key module and write tests.
Comment #21
rlhawkI've updated Key 7.x-3.x to address all of the coding standards issues:
http://pareview.sh/pareview/httpgitdrupalorgprojectkeygit
I also created tests for Key's administrative functionality.
That module accurately reflects my coding ability and Drupal knowledge.
Comment #22
rlhawkIn the Sodium module, I've added some requirement checks, to prevent installation if the various external dependencies (PHP version, Libsodium PHP extension, and Halite PHP library) aren't met.
Comment #23
rlhawkComment #24
rlhawkComment #25
klausiLooks good to me after a manual review. Since greggles is another git admin and has also reviewed this already I think we can approve this right now.
Thanks for your contribution, Rick!
I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
Comment #27
avpaderno