Hi,
I am trying to use AuthKit and Roundup issue tracker (http://
roundup.sourceforge.net/) together. It almost work, but I am getting
an exception from Roundup wsgi handler:
Exception happened during processing of request from ('127.0.0.1',
56941)
Traceback (most recent call last):
File "/opt/local/lib/python2.5/site-packages/Paste-1.6.1dev_r7262-
py2.5.egg/paste/httpserver.py", line 1056, in
process_request_in_thread
self.finish_request(request, client_address)
File "/opt/local/lib/python2.5/SocketServer.py", line 254, in
finish_request
self.RequestHandlerClass(request, client_address, self)
File "/opt/local/lib/python2.5/SocketServer.py", line 522, in
__init__
self.handle()
File "/opt/local/lib/python2.5/site-packages/Paste-1.6.1dev_r7262-
py2.5.egg/paste/httpserver.py", line 432, in handle
BaseHTTPRequestHandler.handle(self)
File "/opt/local/lib/python2.5/BaseHTTPServer.py", line 316, in
handle
self.handle_one_request()
File "/opt/local/lib/python2.5/site-packages/Paste-1.6.1dev_r7262-
py2.5.egg/paste/httpserver.py", line 427, in handle_one_request
self.wsgi_execute()
File "/opt/local/lib/python2.5/site-packages/Paste-1.6.1dev_r7262-
py2.5.egg/paste/httpserver.py", line 287, in wsgi_execute
self.wsgi_start_response)
File "/opt/local/lib/python2.5/site-packages/Paste-1.6.1dev_r7262-
py2.5.egg/paste/urlmap.py", line 202, in __call__
return app(environ, start_response)
File "/opt/local/lib/python2.5/site-packages/AuthKit-0.4.1dev_r147-
py2.5.egg/authkit/authenticate/__init__.py", line 324, in __call__
return
self.app(environ, start_response)
File "/opt/local/lib/python2.5/site-packages/AuthKit-0.4.1dev_r147-
py2.5.egg/authkit/authenticate/basic.py", line 126, in __call__
return self.application(environ, start_response)
File "/opt/local/lib/python2.5/site-packages/AuthKit-0.4.1dev_r147-
py2.5.egg/authkit/authenticate/multi.py", line 62, in __call__
app_iter = app(environ, start_response)
File "/opt/local/lib/python2.5/site-packages/AuthKit-0.4.1dev_r147-
py2.5.egg/authkit/authenticate/multi.py", line 32, in app
return self.default(environ, find)
File "/opt/local/lib/python2.5/site-packages/AuthKit-0.4.1dev_r147-
py2.5.egg/authkit/authenticate/__init__.py", line 314, in __call__
return
self.app(environ, start_response)
File "/opt/local/lib/python2.5/site-packages/Paste-1.6.1dev_r7262-
py2.5.egg/paste/httpexceptions.py", line 632, in __call__
return self.application(environ, start_response)
File "/opt/local/lib/python2.5/site-packages/AuthKit-0.4.1dev_r147-
py2.5.egg/authkit/authorize/wsgi_adaptors.py", line 101, in __call__
return self.permission.check(
self.app, environ, start_response)
File "/opt/local/lib/python2.5/site-packages/AuthKit-0.4.1dev_r147-
py2.5.egg/authkit/permissions.py", line 305, in check
return app(environ, start_response)
File "/opt/local/lib/python2.5/site-packages/roundup/cgi/
wsgi_handler.py", line 57, in __call__
client.main()
File "/opt/local/lib/python2.5/site-packages/roundup/cgi/client.py",
line 252, in main
self.inner_main()
File "/opt/local/lib/python2.5/site-packages/roundup/cgi/client.py",
line 381, in inner_main
self.write_html(cgitb.html(i18n=self.translator))
File "/opt/local/lib/python2.5/site-packages/roundup/cgi/client.py",
line 934, in write_html
self._socket_op(self.request.wfile.write, content)
File "/opt/local/lib/python2.5/site-packages/roundup/cgi/client.py",
line 899, in _socket_op
call(*args, **kwargs)
File "/opt/local/lib/python2.5/site-packages/roundup/cgi/
wsgi_handler.py", line 21, in write
f = self.request.get_wfile()
File "/opt/local/lib/python2.5/site-packages/roundup/cgi/
wsgi_handler.py", line 73, in get_wfile
raise ValueError, 'start_response() not called'
ValueError: start_response() not called
The source code of Roundup wsgi adaptor can be found here:
http://roundup.cvs.sourceforge.net/roundup/roundup/roundup/cgi/wsgi_handler.py?view=markup
My wsgi application script looks like this:
========8<==========
import os
from roundup.cgi.wsgi_handler import RequestDispatcher
import authkit.authenticate
import authkit.authorize
from authkit.permissions import ValidAuthKitUser
def make_app(global_conf, full_stack=True, **app_conf):
permission = ValidAuthKitUser()
tracker_home = os.path.dirname(os.path.abspath(__file__))
app = RequestDispatcher(tracker_home)
app = authkit.authorize.middleware(app, permission)
app = authkit.authenticate.middleware(app, app_conf)
return app
========8<==========
My Paste configuration file:
========8<==========
[composite:main]
use = egg:Paste#urlmap
/ = site
/tickets = tickets
[app:tickets]
use = egg:myticketsapp
authkit.setup.enable = true
authkit.setup.method = basic
authkit.basic.authenticate.user.data = ksenia:secret
authkit.basic.realm = Tickets
[app:site]
# pylons application setup...
========8<==========
Am I doing something wrong? What could be the problem?
Thanks!
Ksenia.