Commits

Lynn Rees committed 00e2594

[svn]

  • Participants
  • Parent commits 1fe6081
  • Branches wsgiauth

Comments (0)

Files changed (4)

File trunk/wsgiauth/ip.py

 
     def __init__(self, app, authfunc, **kw):
         self.app, 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/openID.py

 import sys
 from Cookie import SimpleCookie
 try:
-    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 http://www.openidenabled.com/
 '''
     sys.exit(1)
-from oid.store import filestore
-from oid.consumer import consumer
-from oid.oidutil import appendArgs
-from oid.cryptutil import randomString
+from openid.store import filestore
+from openid.consumer import consumer
+from openid.oidutil import appendArgs
+from openid.cryptutil import randomString
 from yadis.discover import DiscoveryFailure
 from urljr.fetchers import HTTPFetchingError
 from wsgiauth.util import geturl, getpath, Redirect, Response

File trunk/wsgiauth/url.py

         
     def generate(self, env):
         '''Embeds authentication token in query component.'''
-        token = '='.join([self.name, 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.name, self._gettoken(env)])
 
     def initial(self, environ, start_response):
         # Embed auth token

File trunk/wsgiauth/util.py

     _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.