This is how auth_user.password is defined internally:

https://github.com/web2py/web2py/blob/master/gluon/tools.py#L1753

is_crypted = CRYPT(key=settings.hmac_key, min_length=settings.
password_min_length)
Field(passfield, 'password', length=512,readable=False, label=self.messages.
label_password,
requires=[is_crypted]),




so, yeah, you need to add CRYPT validator by yourself.

Marin


On Wed, Mar 26, 2014 at 1:14 PM, Encompass solutions <encomp...@gmail.com>wrote:

> How do I do this?
> And is this how it is don't in db.auth_user?  Cause it's rather confusing
> that it doesn't do this automatically.
> BR,
> Jason Brower
>
>
> On Sunday, March 23, 2014 2:24:24 PM UTC+2, Anthony wrote:
>>
>> By default, I think password fields only get an IS_LENGTH validator, so
>> you'll have to set the CRYPT validator explicitly.
>>
>> Anthony
>>
>> On Tuesday, March 18, 2014 1:04:54 PM UTC-4, Encompass solutions wrote:
>>
>>> I am trying to create a model with an encrypted key so it's harder for
>>> someone to maliciously screw over my customers.
>>> I have the following snippet.
>>>     Field('public_gram', 'boolean', default=False),
>>>     Field('tag_name', 'list:string'),
>>>     Field('deletion_key', 'password')
>>>     )
>>> You can see there the "deletion_key" is a feild type "password" which I
>>> understand is hashed out so you can't get the original code.  However, when
>>> I try to print it I get this...
>>> test
>>> CRYPT()(gram_details.deletion_key)
>>> (<gluon.validators.LazyCrypt object at 0x7f56b8305c10>, None)
>>> CRYPT()(gram_details.deletion_key) == gram_details.deletion_key
>>> False
>>> Where "test" is print gram_details.deletion_key
>>> If this is the case then my password is not very cryptic.
>>> Am I doing something wrong?
>>> BR,
>>> Jason Brower
>>>
>>>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to