1.1 --- a/examples/Webware/SimpleWithLoginApp/__init__.py Thu Sep 27 22:48:48 2007 +0000
1.2 +++ b/examples/Webware/SimpleWithLoginApp/__init__.py Thu Sep 27 22:49:16 2007 +0000
1.3 @@ -8,18 +8,33 @@
1.4
1.5 from WebStack.Adapters.Webware import WebStackServletFactory
1.6 from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator
1.7 +from WebStack.Resources.Login import LoginResource, LoginAuthenticator
1.8 +from WebStack.Resources.ResourceMap import MapResource
1.9 from Simple import SimpleResource
1.10
1.11 # NOTE: Initialising a shared resource.
1.12
1.13 -resource = LoginRedirectResource(
1.14 - login_url="http://localhost/webkit/app.login",
1.15 - app_url="http://localhost",
1.16 - resource=SimpleResource(),
1.17 - authenticator=LoginRedirectAuthenticator(secret_key="horses"),
1.18 - anonymous_parameter_name="anonymous",
1.19 - logout_parameter_name="logout"
1.20 -)
1.21 +resource = MapResource({
1.22 + "simple" :
1.23 + LoginRedirectResource(
1.24 + login_url="http://localhost/webkit/app.login",
1.25 + app_url="http://localhost",
1.26 + resource=SimpleResource(),
1.27 + authenticator=LoginRedirectAuthenticator(secret_key="horses"),
1.28 + anonymous_parameter_name="anonymous",
1.29 + logout_parameter_name="logout"
1.30 + ),
1.31 + "login" :
1.32 + LoginResource(
1.33 + LoginAuthenticator(
1.34 + secret_key="horses",
1.35 + credentials=(
1.36 + ("badger", "abc"),
1.37 + ("vole", "xyz"),
1.38 + )
1.39 + )
1.40 + )
1.41 + })
1.42
1.43 def InstallInWebKit(appServer):
1.44 global resource
2.1 --- a/examples/Webware/SimpleWithLoginContext/__init__.py Thu Sep 27 22:48:48 2007 +0000
2.2 +++ b/examples/Webware/SimpleWithLoginContext/__init__.py Thu Sep 27 22:49:16 2007 +0000
2.3 @@ -6,18 +6,34 @@
2.4
2.5 from WebStack.Adapters.Webware import deploy
2.6 from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator
2.7 +from WebStack.Resources.Login import LoginResource, LoginAuthenticator
2.8 +from WebStack.Resources.ResourceMap import MapResource
2.9 from Simple import SimpleResource
2.10
2.11 # NOTE: Initialising a shared resource.
2.12
2.13 -resource = LoginRedirectResource(
2.14 - login_url="http://localhost/webkitcvs/login",
2.15 - app_url="http://localhost",
2.16 - resource=SimpleResource(),
2.17 - authenticator=LoginRedirectAuthenticator(secret_key="horses"),
2.18 - anonymous_parameter_name="anonymous",
2.19 - logout_parameter_name="logout"
2.20 -)
2.21 +resource = MapResource({
2.22 + "simple" :
2.23 + LoginRedirectResource(
2.24 + login_url="http://localhost/webkitcvs/login",
2.25 + app_url="http://localhost",
2.26 + resource=SimpleResource(),
2.27 + authenticator=LoginRedirectAuthenticator(secret_key="horses"),
2.28 + anonymous_parameter_name="anonymous",
2.29 + logout_parameter_name="logout"
2.30 + ),
2.31 + "login" :
2.32 + LoginResource(
2.33 + LoginAuthenticator(
2.34 + secret_key="horses",
2.35 + credentials=(
2.36 + ("badger", "abc"),
2.37 + ("vole", "xyz"),
2.38 + )
2.39 + )
2.40 + )
2.41 + })
2.42 +
2.43 urlParser = deploy(resource, handle_errors=1)
2.44
2.45 # vim: tabstop=4 expandtab shiftwidth=4
3.1 --- a/examples/Zope/SimpleWithLoginProduct/__init__.py Thu Sep 27 22:48:48 2007 +0000
3.2 +++ b/examples/Zope/SimpleWithLoginProduct/__init__.py Thu Sep 27 22:49:16 2007 +0000
3.3 @@ -4,6 +4,8 @@
3.4
3.5 from Simple import SimpleResource
3.6 from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator
3.7 +from WebStack.Resources.Login import LoginResource, LoginAuthenticator
3.8 +from WebStack.Resources.ResourceMap import MapResource
3.9 from WebStack.Adapters.Zope import WebStackAdapterProduct
3.10 from Globals import InitializeClass
3.11
3.12 @@ -11,15 +13,28 @@
3.13 meta_type = "Simple with login product"
3.14 def __init__(self, id):
3.15 WebStackAdapterProduct.__init__(self, id,
3.16 - LoginRedirectResource(
3.17 - login_url="http://localhost:9080/tests/login",
3.18 - app_url="http://localhost:9080",
3.19 - resource=SimpleResource(),
3.20 - authenticator=LoginRedirectAuthenticator(secret_key="horses"),
3.21 - anonymous_parameter_name="anonymous",
3.22 - logout_parameter_name="logout"
3.23 + MapResource({
3.24 + "simple" :
3.25 + LoginRedirectResource(
3.26 + login_url="http://localhost:9080/tests/login",
3.27 + app_url="http://localhost:9080",
3.28 + resource=SimpleResource(),
3.29 + authenticator=LoginRedirectAuthenticator(secret_key="horses"),
3.30 + anonymous_parameter_name="anonymous",
3.31 + logout_parameter_name="logout"
3.32 + ),
3.33 + "login" :
3.34 + LoginResource(
3.35 + LoginAuthenticator(
3.36 + secret_key="horses",
3.37 + credentials=(
3.38 + ("badger", "abc"),
3.39 + ("vole", "xyz"),
3.40 + )
3.41 + )
3.42 + )
3.43 + })
3.44 )
3.45 - )
3.46
3.47 InitializeClass(SimpleWithLoginProduct)
3.48