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