1 #!/usr/bin/env python 2 3 """ 4 Webware context for the Simple application (post Webware 0.8.1). 5 """ 6 7 from WebStack.Adapters.Webware import deploy 8 from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator 9 from WebStack.Resources.Login import LoginResource, LoginAuthenticator 10 from WebStack.Resources.ResourceMap import MapResource 11 from Simple import SimpleResource 12 13 # NOTE: Initialising a shared resource. 14 15 resource = MapResource({ 16 "simple" : 17 LoginRedirectResource( 18 login_url="http://localhost:9080/simplewithlogin/login", 19 app_url="http://localhost:9080", 20 resource=SimpleResource(), 21 authenticator=LoginRedirectAuthenticator(secret_key="horses"), 22 anonymous_parameter_name="anonymous", 23 logout_parameter_name="logout" 24 ), 25 "login" : 26 LoginResource( 27 LoginAuthenticator( 28 secret_key="horses", 29 credentials=( 30 ("badger", "abc"), 31 ("vole", "xyz"), 32 ) 33 ) 34 ) 35 }) 36 37 urlParser = deploy(resource, handle_errors=0) 38 39 # vim: tabstop=4 expandtab shiftwidth=4