comparison 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
comparison
equal deleted inserted replaced
2008:52c474b8c02f 2009:1b14cc05a54a
12 import sys 12 import sys
13 import time 13 import time
14 14
15 from MoinMoin import config, error, util, wikiutil 15 from MoinMoin import config, error, util, wikiutil
16 import MoinMoin.auth as authmodule 16 import MoinMoin.auth as authmodule
17 from MoinMoin import session
17 from MoinMoin.packages import packLine 18 from MoinMoin.packages import packLine
18 from MoinMoin.security import AccessControlList 19 from MoinMoin.security import AccessControlList
19 20
20 _url_re_cache = None 21 _url_re_cache = None
21 _farmconfig_mtime = None 22 _farmconfig_mtime = None
136 ''' % { 137 ''' % {
137 'name': name, 138 'name': name,
138 'err': err, 139 'err': err,
139 } 140 }
140 raise error.ConfigurationError(msg) 141 raise error.ConfigurationError(msg)
142
143 # postprocess configuration
144 # 'setuid' special auth method auth method can log out
145 cfg.auth_can_logout = ['setuid']
146 cfg.auth_login_inputs = []
147 found_names = []
148 for auth in cfg.auth:
149 if not auth.name:
150 raise error.ConfigurationError("Auth methods must have a name.")
151 if auth.name in found_names:
152 raise error.ConfigurationError("Auth method names must be unique.")
153 found_names.append(auth.name)
154 if auth.logout_possible and auth.name:
155 cfg.auth_can_logout.append(auth.name)
156 for input in auth.login_inputs:
157 if not input in cfg.auth_login_inputs:
158 cfg.auth_login_inputs.append(input)
159 cfg.auth_have_login = len(cfg.auth_login_inputs) > 0
160
141 return cfg 161 return cfg
142 162
143 163
144 def _getConfigName(url): 164 def _getConfigName(url):
145 """ Return config name for url or raise """ 165 """ Return config name for url or raise """
195 215
196 actions_excluded = [] # ['DeletePage', 'AttachFile', 'RenamePage', 'test', ] 216 actions_excluded = [] # ['DeletePage', 'AttachFile', 'RenamePage', 'test', ]
197 allow_xslt = False 217 allow_xslt = False
198 antispam_master_url = "http://moinmaster.wikiwikiweb.de:8000/?action=xmlrpc2" 218 antispam_master_url = "http://moinmaster.wikiwikiweb.de:8000/?action=xmlrpc2"
199 attachments = None # {'dir': path, 'url': url-prefix} 219 attachments = None # {'dir': path, 'url': url-prefix}
200 auth = [authmodule.moin_login, authmodule.moin_session, ] 220 auth = [authmodule.MoinLogin()]
221 session_handler = session.DefaultSessionHandler()
201 222
202 backup_compression = 'gz' 223 backup_compression = 'gz'
203 backup_users = [] 224 backup_users = []
204 backup_include = [] 225 backup_include = []
205 backup_exclude = [ 226 backup_exclude = [
401 ('JspWiki', 'http://www.jspwiki.org/SisterSites.jsp'), 422 ('JspWiki', 'http://www.jspwiki.org/SisterSites.jsp'),
402 ] # list of (sistersitename, sisterpagelistfetchurl) 423 ] # list of (sistersitename, sisterpagelistfetchurl)
403 shared_intermap = None # can be string or list of strings (filenames) 424 shared_intermap = None # can be string or list of strings (filenames)
404 show_hosts = True 425 show_hosts = True
405 show_interwiki = False 426 show_interwiki = False
406 show_login = True
407 show_names = True 427 show_names = True
408 show_section_numbers = 0 428 show_section_numbers = 0
409 show_timings = False 429 show_timings = False
410 show_version = False 430 show_version = False
411 siteid = 'default' 431 siteid = 'default'