comparison rhodecode/lib/middleware/simplegit.py @ 1293:ae5b07e75ffd beta

fixed issue #181, and small fix in gitmiddleware
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 27 Apr 2011 01:27:39 +0200
parents d6524f3025e8
children b7563ad4e7ee
comparison
equal deleted inserted replaced
1292:c0335c1dee36 1293:ae5b07e75ffd
96 self.application = application 96 self.application = application
97 self.config = config 97 self.config = config
98 #authenticate this git request using 98 #authenticate this git request using
99 self.authenticate = AuthBasicAuthenticator('', authfunc) 99 self.authenticate = AuthBasicAuthenticator('', authfunc)
100 self.ipaddr = '0.0.0.0' 100 self.ipaddr = '0.0.0.0'
101 self.repository = None 101 self.repo_name = None
102 self.username = None 102 self.username = None
103 self.action = None 103 self.action = None
104 104
105 def __call__(self, environ, start_response): 105 def __call__(self, environ, start_response):
106 if not is_git(environ): 106 if not is_git(environ):
145 # DEFAULT PERM FAILED OR ANONYMOUS ACCESS IS DISABLED SO WE 145 # DEFAULT PERM FAILED OR ANONYMOUS ACCESS IS DISABLED SO WE
146 # NEED TO AUTHENTICATE AND ASK FOR AUTH USER PERMISSIONS 146 # NEED TO AUTHENTICATE AND ASK FOR AUTH USER PERMISSIONS
147 #============================================================== 147 #==============================================================
148 148
149 if not REMOTE_USER(environ): 149 if not REMOTE_USER(environ):
150 self.authenticate.realm = str( 150 self.authenticate.realm = self.config['rhodecode_realm'].\
151 self.config['rhodecode_realm']) 151 encode('utf8', 'replace')
152 result = self.authenticate(environ) 152 result = self.authenticate(environ)
153 if isinstance(result, str): 153 if isinstance(result, str):
154 AUTH_TYPE.update(environ, 'basic') 154 AUTH_TYPE.update(environ, 'basic')
155 REMOTE_USER.update(environ, result) 155 REMOTE_USER.update(environ, result)
156 else: 156 else: