defrex / django-encrypted-fields

This is a collection of Django Model Field classes that are encrypted using Keyczar.
MIT License
193 stars 60 forks source link

Extensions to django-encrypted-fields #1

Closed ebpmp closed 10 years ago

defrex commented 10 years ago

I'm not sure that the enforce_max_length option is needed. All the fields are treated like a TextField from Django's perspective. This should effectively disable the max_length argument.

Thoughts?

ebpmp commented 10 years ago

If you model a VARCHAR(255) and the encrypted data is longer than 255, then the data will be truncated. We learned this the hard way. It is the non-default option, so for Eventbrite compatibility, I would like to leave it in there and document the rationale why it is needed for others. Thanks for pulling and making those tweaks! We are working on integrating this into our system replacing our models with django-encrypted-fields. If any issues come up, I will let you know.

defrex commented 10 years ago

Django won't create the fields as VARCHAR, but I suppose if you have legacy fields it's a valid consideration.

ebpmp commented 10 years ago

Yeah, existing applications will almost certainly have some fixed length character fields that may need encryption. I think it's a good idea to leave it in. I am going to update the README.md file too with descriptions on the new options.