foundertherapy / django-cryptographic-fields

A set of fields that wrap standard Django fields with encryption provided by the python cryptography library.
MIT License
29 stars 34 forks source link

remove unneeded new length calculation #18

Closed GhalebKhaled closed 8 years ago

GhalebKhaled commented 8 years ago

What I've done here is to remove the mapping from original to actual low level length. Current status:

  1. All fields mapped to text type field so no database validation is required against max length.
  2. As I can see in django.db.model.fields.Field, themax_length only used as validator which result in comparing users value against the encrypted new size which is incorrect.

Solution:

I just removed the max_length so all comparison now happening actual max_length against users actual value which is the correct behavior as I see it.

@danaspiegel @waseem-omar Can you guys review this and let me know what do you think?

GhalebKhaled commented 8 years ago

(1) CRYPTO/53 - Built in validator do not use actual length for max-length validation [Week34]