# HG changeset patch # User paulb # Date 1085851636 0 # Node ID bdeff9537ada1615b93f9caa7ab3198fbeed0e7e # Parent 12735bb3eedf68bbfdd6ad0cc5c37cc0e1491d6f [project @ 2004-05-29 17:27:16 by paulb] Moved the login credentials to the initialisation program. Provided anonymous entry to the "guarded" simple application. diff -r 12735bb3eedf -r bdeff9537ada examples/BaseHTTPRequestHandler/LoginApp.py --- a/examples/BaseHTTPRequestHandler/LoginApp.py Sat May 29 17:25:44 2004 +0000 +++ b/examples/BaseHTTPRequestHandler/LoginApp.py Sat May 29 17:27:16 2004 +0000 @@ -7,10 +7,19 @@ # Special magic incantation. handler = BaseHTTPRequestHandler.HandlerFactory( - LoginResource(LoginAuthenticator("horses")) + LoginResource( + LoginAuthenticator( + secret_key="horses", + credentials=( + ("badger", "abc"), + ("vole", "xyz"), + ) + ) + ) ) address = ("", 8081) server = BaseHTTPServer.HTTPServer(address, handler) +print "Serving..." server.serve_forever() # vim: tabstop=4 expandtab shiftwidth=4 diff -r 12735bb3eedf -r bdeff9537ada examples/BaseHTTPRequestHandler/SimpleWithLogin.py --- a/examples/BaseHTTPRequestHandler/SimpleWithLogin.py Sat May 29 17:25:44 2004 +0000 +++ b/examples/BaseHTTPRequestHandler/SimpleWithLogin.py Sat May 29 17:27:16 2004 +0000 @@ -9,14 +9,16 @@ handler = BaseHTTPRequestHandler.HandlerFactory( LoginRedirectResource( - "http://localhost:8081", - "http://localhost:8080", - SimpleResource(), - LoginRedirectAuthenticator("horses") + login_url="http://localhost:8081", + app_url="http://localhost:8080", + resource=SimpleResource(), + authenticator=LoginRedirectAuthenticator(secret_key="horses"), + anonymous_parameter_name="anonymous" ) ) address = ("", 8080) server = BaseHTTPServer.HTTPServer(address, handler) +print "Serving..." server.serve_forever() # vim: tabstop=4 expandtab shiftwidth=4