macropin / django-registration

Django-registration (redux) provides user registration functionality for Django websites.
http://django-registration-redux.readthedocs.org
Other
975 stars 350 forks source link

Updated to use SHA256 instead of SHA1 #362

Closed jialutu closed 5 years ago

jialutu commented 5 years ago

Updated activation_key to use SHA256 from SHA1.

While SHA512 is faster for 64bit systems, I've ultimately decided on SHA256 due to it creating 64 characters as opposed to SHA512 creating 128 characters.

coveralls commented 5 years ago

Coverage Status

Coverage decreased (-0.07%) to 97.231% when pulling f58c9719abbe57108d449605385e16d320b6cd13 on jialutu:master into 5bef8b8c99b887a92c0442f0d903b465fe85f238 on macropin:master.

jialutu commented 5 years ago

Sorry for the delay. The tests have been added. I've also corrected the test_activation_key_backwards_compatibility tests that I've changed in my previous commits.

joshblum commented 5 years ago

Thanks!

JElchison commented 4 years ago

Thanks for a great plugin! I've used this for years in production with very little maintenance required.

Is there a suggested upgrade path from v2.6 to v2.7? Inclusion of this PR breaks my website with MySQL database error:

DataError at /accounts/register/
(1406, "Data too long for column 'activation_key' at row 1")

I know that activation_key max_length increased from 40 to 64. It seems like a Django migration should have taken care of this for me, and perhaps I've somehow missed that.

Any tips? Thanks!

joshblum commented 4 years ago

@JElchison thank you! Have you run the migration in https://github.com/jialutu/django-registration/blob/master/registration/migrations/0005_activation_key_sha256.py?

JElchison commented 4 years ago

@joshblum Firstly, thanks for your speedy reply. And sorry for my delayed response. I had a medical emergency last week, and am just getting back on my feet.

Secondly, my apologies for the noise. I identified a mistake in my control logic that runs Django migrations. The mistake is completely mine.

Best wishes, and thanks (again) for a great plugin!

joshblum commented 4 years ago

@JElchison no problem, glad you're doing better