Jason Long
My "auth http" patch that allows rewriting usernames.
For MoinMoin 1.5.8.
diff -ru ../moin-1.5.8-orig/MoinMoin/auth.py ./MoinMoin/auth.py
--- ../moin-1.5.8-orig/MoinMoin/auth.py 2007-02-07 09:31:27.000000000 -0500
+++ ./MoinMoin/auth.py 2007-06-19 09:52:23.000000000 -0400
@@ -183,6 +183,8 @@
auth_type = env.get('AUTH_TYPE','')
if auth_type in ['Basic', 'Digest', 'NTLM', 'Negotiate',]:
username = env.get('REMOTE_USER', '').decode(config.charset)
+ if request.cfg.auth_http_usermap.get(username):
+ username = request.cfg.auth_http_usermap.get(username)
if auth_type in ('NTLM', 'Negotiate',):
# converting to standard case so the user can even enter wrong
case
# (added since windows does not distinguish between e.g.
diff -ru ../moin-1.5.8-orig/MoinMoin/multiconfig.py ./MoinMoin/multiconfig.py
--- ../moin-1.5.8-orig/MoinMoin/multiconfig.py 2007-05-12 15:19:57.000000000 -0
400
+++ ./MoinMoin/multiconfig.py 2007-06-19 09:50:20.000000000 -0400
@@ -182,6 +182,7 @@
allow_xslt = 0
attachments = None # {'dir': path, 'url': url-prefix}
auth = [authmodule.moin_cookie]
+ auth_http_usermap = {}
backup_compression = 'gz'
backup_users = []To use this, add something like this to your wikiconfig.py file:
from MoinMoin.auth import http
auth = [http]
auth_http_usermap = {
'asmith': 'AgentSmith',
'rroger': 'RoyRoger',
'jlong': 'JasonLong',
}Now when I HTTP-authenticate as jlong, the wiki will know me as JasonLong.
