Just a thought,
I think md5 has been broken. (and sha1?). Pycrypto now has sha256 which
can work as a drop in replacement for md5. (creates a 64-byte hash,
though, instead of 32).
It introduces another dependency, and there is the whole export crypto
problem (if it is still a problem), but I thought I'd mention it.
I could be wrong about all thins, but I am using sha256 in my TG
project, just in case.
Krys
Lethalman wrote:
>I hope you'll like my authorization model and the fix for JSON in Opera.
>
>This is an example on howto use the authorization:
>
>import turbogears
>
>class Root:
> authRootControl = turbogears.authorization.AuthMD5({'user':
>'anonymous'})
> authRoot =
>turbogears.authorization.Authentication(authRootControl.checkAuth,
>"Root")
> _authorization = authRoot
>
> authAdminControl = turbogears.authorization.AuthMD5({'admin': 'test'})
> authAdmin =
>turbogears.authorization.Authentication(authAdminControl.checkAuth,
>"Admin")
>
> @turbogears.expose()
> def index(self):
> return "You need to be authorized by authRoot"
>
> @turbogears.expose(auth=authAdmin)
> def admin(self):
> return "authRoot doesn't check for this because
>there's authAdmin instead"
>
>--
>www.italianpug.org - Italian Python User Group Founder
>
>