Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PasswordField ideas #534

Closed
mkosler opened this issue Jul 9, 2012 · 3 comments
Closed

PasswordField ideas #534

mkosler opened this issue Jul 9, 2012 · 3 comments

Comments

@mkosler
Copy link

mkosler commented Jul 9, 2012

So I am newish to Python, Mongoengine, and web development in general, so if this can already be done rather easily, then I'd appreciate the help.

Like most, I have a User model with username and password fields, currently both StringFields. I want to salt/hash my passwords as they go in the database, and as far as I can tell, the only way I can do that currently is by calling some function in the controller portion of my web app to hash/salt my password before it gets put into the database. Which can work fine as long as I remember to do so.

But if I want to access my DB via the shell, and add in a few test Users, or perform some administrative work on that end? If I try to use User.create(), I will likely forget to add the hashing to the password, and then I'll likely need to go back in and change that later.

It would be nice if there was a PasswordField(), or at least parameter on StringField where I can provide a setter function for that field, so I know for certain every time that the field will be hashed/salted.

@dillongreen
Copy link

There's no PasswordField (yet) but if you're interested in some code take a look at the mongoengine rework of django-registration https://github.com/lig/django-registration-me/blob/master/registration/documents.py (see the salt part in create_user()).

@noQ
Copy link

noQ commented Jul 18, 2012

Hi,

Please, check "PasswordField and IpAddressField"

@rozza
Copy link

rozza commented Jul 25, 2012

See: #542

@rozza rozza closed this as completed Jul 25, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants