Database Authentication

Authenticating users from a database is as simple as providing a reference to enamel.authentication.DatabaseAuthenticator? for the authenticator variable in an Enamel instance.

class DbAuthApp(enamel.Enamel):
    indexPage = Index
    loginPage = pages.Login
    storage = SQLStorage('sqlite:///test.db')
    anonymousAccess = True
    authenticator = authentication.DatabaseAuthenticator

    server = servers.TwistedWeb
    port = 8080

The storage attribute should be an implementation of storage.IStorage and have a method of authenticateUser which returns something on valid authentication or None/False. A loginPage and indexPage are also required.