Lynn Rees  committed 00e2594


  • Participants
  • Parent commits 1fe6081
  • Branches wsgiauth

Comments (0)

Files changed (4)

File trunk/wsgiauth/

     def __init__(self, app, authfunc, **kw):, self.authfunc = app, authfunc
-        self.response = kw.get('response', Forbidden)
+        self.response = kw.get('response', Forbidden())
     def __call__(self, environ, start_response):
         ipaddr = environ.get('REMOTE_ADDR')

File trunk/wsgiauth/

 import sys
 from Cookie import SimpleCookie
-    import openid as oid
+    import openid
 except ImportError:
     print >> sys.stderr, '''Failed to import the OpenID library.
 In order to use this example, you must either install the library
 distribution or
-from import filestore
-from oid.consumer import consumer
-from oid.oidutil import appendArgs
-from oid.cryptutil import randomString
+from import filestore
+from openid.consumer import consumer
+from openid.oidutil import appendArgs
+from openid.cryptutil import randomString
 from import DiscoveryFailure
 from urljr.fetchers import HTTPFetchingError
 from wsgiauth.util import geturl, getpath, Redirect, Response

File trunk/wsgiauth/

     def generate(self, env):
         '''Embeds authentication token in query component.'''
-        token = '='.join([, self._gettoken(env)])
-        if env.get('QUERY_STRING') == '':
-            env['QUERY_STRING'] = token
-        else:
-            env['QUERY_STRING'] = '&'.join([env['QUERY_STRING'], token])
+        env['QUERY_STRING'] = '='.join([, self._gettoken(env)])
     def initial(self, environ, start_response):
         # Embed auth token

File trunk/wsgiauth/

     _status = '403 Forbidden'
     _ctype = 'text/plain'
-    def __call__(self, start_response):
+    def __call__(self, environ, start_response):
         start_response(self.status, self.headers)
         return self.response(self.message or geturl(environ))
-class NotFound(Forbidden):
-    '''WSGI application for 404 errors.'''
-    _template = 'This server could not find resource %s.'
-    _status = '404 Not Found'
 def extract(environ, empty=False, err=False):
     '''Extracts strings in form data and returns a dict.