diff MoinMoin/config/multiconfig.py @ 2009:1b14cc05a54a

refactor authentication and split out session handling
author Johannes Berg <johannes AT sipsolutions DOT net>
date Fri, 20 Apr 2007 15:35:14 +0200
parents efafd0dd3ff8
children 1b0629547090
line wrap: on
line diff
--- a/MoinMoin/config/multiconfig.py	Fri Apr 20 15:34:50 2007 +0200
+++ b/MoinMoin/config/multiconfig.py	Fri Apr 20 15:35:14 2007 +0200
@@ -14,6 +14,7 @@
 
 from MoinMoin import config, error, util, wikiutil
 import MoinMoin.auth as authmodule
+from MoinMoin import session
 from MoinMoin.packages import packLine
 from MoinMoin.security import AccessControlList
 
@@ -138,6 +139,25 @@
     'err': err,
 }
         raise error.ConfigurationError(msg)
+
+    # postprocess configuration
+    # 'setuid' special auth method auth method can log out
+    cfg.auth_can_logout = ['setuid']
+    cfg.auth_login_inputs = []
+    found_names = []
+    for auth in cfg.auth:
+        if not auth.name:
+            raise error.ConfigurationError("Auth methods must have a name.")
+        if auth.name in found_names:
+            raise error.ConfigurationError("Auth method names must be unique.")
+        found_names.append(auth.name)
+        if auth.logout_possible and auth.name:
+            cfg.auth_can_logout.append(auth.name)
+        for input in auth.login_inputs:
+            if not input in cfg.auth_login_inputs:
+                cfg.auth_login_inputs.append(input)
+    cfg.auth_have_login = len(cfg.auth_login_inputs) > 0
+
     return cfg
 
 
@@ -197,7 +217,8 @@
     allow_xslt = False
     antispam_master_url = "http://moinmaster.wikiwikiweb.de:8000/?action=xmlrpc2"
     attachments = None # {'dir': path, 'url': url-prefix}
-    auth = [authmodule.moin_login, authmodule.moin_session, ]
+    auth = [authmodule.MoinLogin()]
+    session_handler = session.DefaultSessionHandler()
 
     backup_compression = 'gz'
     backup_users = []
@@ -403,7 +424,6 @@
     shared_intermap = None # can be string or list of strings (filenames)
     show_hosts = True
     show_interwiki = False
-    show_login = True
     show_names = True
     show_section_numbers = 0
     show_timings = False