paulb@55 | 1 | #!/usr/bin/env python |
paulb@55 | 2 | |
paulb@539 | 3 | # NOTE: Path manipulation may require manual customisation. |
paulb@55 | 4 | |
paulb@539 | 5 | import sys, os |
paulb@539 | 6 | sys.path.append(os.path.abspath(os.path.join(__file__, "../../../Common"))) |
paulb@55 | 7 | |
paulb@55 | 8 | from WebStack.Adapters import ModPython |
paulb@80 | 9 | from Auth import AuthResource, AuthAuthenticator |
paulb@55 | 10 | |
paulb@55 | 11 | # NOTE: Not sure if the resource should be maintained in a resource pool. |
paulb@55 | 12 | |
paulb@55 | 13 | resource = AuthResource() |
paulb@80 | 14 | authenticator = AuthAuthenticator() |
paulb@55 | 15 | |
paulb@55 | 16 | def handler(req): |
paulb@55 | 17 | global resource |
paulb@341 | 18 | return ModPython.respond(req, resource, handle_errors=0) |
paulb@80 | 19 | |
paulb@80 | 20 | def authenhandler(req): |
paulb@80 | 21 | global authenticator |
paulb@341 | 22 | return ModPython.authenticate(req, authenticator, handle_errors=0) |
paulb@55 | 23 | |
paulb@55 | 24 | # vim: tabstop=4 expandtab shiftwidth=4 |