I've already modified my in-house SQLObject provider to have greater
control over the names of fields - I.e. if you want to use EMail as the
userId...

Also changed was the default encryption behavior, which includes a
rot13 tester, and encryption aliases ("sha1" vs. "sha", etc.).

>def rot13(text):
>       table = string.maketrans(
>               'nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM',
>               'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')
>       return string.translate(text, table)
>
>
>               algorithm= get("identity.soprovider.password_encryption", "md5")
>               if algorithm == "md5":
>                       self.encrypt_password = lambda pw: 
> md5.new(pw).hexdigest()
>               elif algorithm in ("sha1", "sha"):
>                       self.encrypt_password = lambda pw: 
> sha.new(pw).hexdigest()
>               elif algorithm in ("plain", "none", "None"):
>                       self.encrypt_password = lambda pw: pw
>               elif algorithm in ("rot13", "caesar"):
>                       self.encrypt_password = lambda pw: rot13(pw)
>               else:
>                       raise identity.IdentityConfigurationException("Unknown 
> password encryption algorithm: %s" % algorithm)

I'll finish it up today and post it up under several new tickets.

Reply via email to