project-callisto / callisto-core

Report intake, escrow, matching and secure delivery code for Callisto, an online reporting system for sexual assault.
https://www.projectcallisto.org
GNU Affero General Public License v3.0
137 stars 54 forks source link

[don't merge until end of Summer Maintenance] Encrypt user data at signup. #455

Closed gaylatea closed 5 years ago

gaylatea commented 5 years ago

Summary

This diff updates the signup process to encrypt user information as it comes in.

Test Plan

User created by this signup process, note no plaintext username / email: Screen Shot 2019-07-17 at 2 17 44 PM

Account information, note the auto-created encryption + indexes: Screen Shot 2019-07-17 at 2 18 38 PM

Potential Concerns

A two-stage commit is used here, to create the user object in Django, and then update them with the correct parameters and delete unsafe data. This might present a problem if the encryption process is halted halfway through, since unsafe data will be present, but that's a small enough risk that I'm comfortable leaving this as is for now.