# HG changeset patch # User paulb # Date 1126028133 0 # Node ID 54c842b6ec5fcebc2341d9c425712e3ec16752fb # Parent 6ec2a89eb31a92dd017fa735ae5a8f6b9fbb7c94 [project @ 2005-09-06 17:35:29 by paulb] Made the BaseHTTPRequestHandler SimpleWithLogin application a complete example, not requiring a separate Login application. Updated the demonstration to include the SimpleWithLogin and Login examples. diff -r 6ec2a89eb31a -r 54c842b6ec5f README.txt --- a/README.txt Fri Aug 26 18:12:13 2005 +0000 +++ b/README.txt Tue Sep 06 17:35:33 2005 +0000 @@ -80,6 +80,10 @@ Added support for the repeated retrieval of sessions from the same WebStack session store, avoiding deadlocks. Fixed the calendar example, making it perform a proper function. +Made the BaseHTTPRequestHandler SimpleWithLogin application include the Login +application, since Konqueror (at least) does not share cookies across +different port numbers on the same host. +Added the SimpleWithLogin and Login applications to the demonstration. New in WebStack 0.10 (Changes since WebStack 0.9) ------------------------------------------------- diff -r 6ec2a89eb31a -r 54c842b6ec5f examples/BaseHTTPRequestHandler/DemoApp.py --- a/examples/BaseHTTPRequestHandler/DemoApp.py Fri Aug 26 18:12:13 2005 +0000 +++ b/examples/BaseHTTPRequestHandler/DemoApp.py Tue Sep 06 17:35:33 2005 +0000 @@ -9,6 +9,8 @@ from WebStack.Adapters.BaseHTTPRequestHandler import deploy from WebStack.Resources.ResourceMap import MapResource +from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator +from WebStack.Resources.Login import LoginResource, LoginAuthenticator # Here are all the test resources. @@ -40,6 +42,7 @@
  • Form tests
  • Session information
  • Simple test
  • +
  • Simple with login test
  • Unicode test
  • Very simple test
  • Calendar store example - requires a WebDAV-capable browser
    @@ -60,6 +63,25 @@ "form" : FormResource(), "sessions" : SessionsResource(), "simple" : SimpleResource(), + "simplewithlogin" : + LoginRedirectResource( + login_url="http://localhost:8080/login", + app_url="http://localhost:8080", + resource=SimpleResource(), + authenticator=LoginRedirectAuthenticator(secret_key="horses"), + anonymous_parameter_name="anonymous", + logout_parameter_name="logout" + ), + "login" : + LoginResource( + LoginAuthenticator( + secret_key="horses", + credentials=( + ("badger", "abc"), + ("vole", "xyz"), + ) + ) + ), "unicode" : UnicodeResource(), "verysimple" : VerySimpleResource(), "calendar" : CalendarResource(), diff -r 6ec2a89eb31a -r 54c842b6ec5f examples/BaseHTTPRequestHandler/SimpleWithLoginApp.py --- a/examples/BaseHTTPRequestHandler/SimpleWithLoginApp.py Fri Aug 26 18:12:13 2005 +0000 +++ b/examples/BaseHTTPRequestHandler/SimpleWithLoginApp.py Tue Sep 06 17:35:33 2005 +0000 @@ -2,18 +2,33 @@ from WebStack.Adapters.BaseHTTPRequestHandler import deploy from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator +from WebStack.Resources.Login import LoginResource, LoginAuthenticator +from WebStack.Resources.ResourceMap import MapResource from Simple import SimpleResource print "Serving..." deploy( - LoginRedirectResource( - login_url="http://localhost:8081", - app_url="http://localhost:8080", - resource=SimpleResource(), - authenticator=LoginRedirectAuthenticator(secret_key="horses"), - anonymous_parameter_name="anonymous", - logout_parameter_name="logout" - ), + MapResource({ + "simple" : + LoginRedirectResource( + login_url="http://localhost:8080/login", + app_url="http://localhost:8080", + resource=SimpleResource(), + authenticator=LoginRedirectAuthenticator(secret_key="horses"), + anonymous_parameter_name="anonymous", + logout_parameter_name="logout" + ), + "login" : + LoginResource( + LoginAuthenticator( + secret_key="horses", + credentials=( + ("badger", "abc"), + ("vole", "xyz"), + ) + ) + ) + }), handle_errors=1 )