webpy/webpy — pull request #285 by PetrHoracek (2014-04-07 17:16:11+00:00)
Title: Auth module for webpy

Hello, I created module which handles authorization and authentication in webpy applications. Could you consider it as a part of the framework? I think that this is an important and handy feature.

Module itself is really easy to use. It uses SHA256 and Bcrypt crypting algorithms as default, but there is no problem to extend it. It also contains unit test and documentation, where you can learn more about it.

This is my first real contribution to open-source project, I'll accept all critics about the code, semantics etc.

Basic example (no all functions):

db = web.database(...)
session = web.session.Session(...)
auth = web.auth.Auth(session, db, lgn_pg='/login')

auth.login(usr, passwd)

@auth.role('admin')
def GET(self):
return render.text("Admin's page")

auth.logout()