1 #!/usr/bin/env python 2 3 """ 4 Webware plug-in code. 5 """ 6 7 __version__ = "0.1" 8 9 from WebStack.Adapters.Webware import WebStackServletFactory 10 from WebStack.Resources.Login import LoginResource, LoginAuthenticator 11 12 # NOTE: Initialising a shared resource. 13 14 resource = LoginResource( 15 LoginAuthenticator( 16 secret_key="horses", 17 credentials=( 18 ("badger", "abc"), 19 ("vole", "xyz"), 20 ) 21 ) 22 ) 23 24 def InstallInWebKit(appServer): 25 global resource 26 app = appServer.application() 27 28 # NOTE: Allow .login files only. Really, we'd like any kind of file, but 29 # NOTE: that would severely undermine the servlet factory concept. 30 31 app.addServletFactory(WebStackServletFactory(app, resource, [".login"])) 32 33 # vim: tabstop=4 expandtab shiftwidth=4