summaryrefslogtreecommitdiff
path: root/paste/auth/basic.py
diff options
context:
space:
mode:
authorcce <devnull@localhost>2006-02-24 06:24:10 +0000
committercce <devnull@localhost>2006-02-24 06:24:10 +0000
commit3ece86d36d841c3d5023f7bab029c0b2b235e7e7 (patch)
tree1244c60800daaf2b9d42d6960195909ff84f571f /paste/auth/basic.py
parent29dda90805f7eb854bf0b9557a3d6f300e41fad3 (diff)
downloadpaste-3ece86d36d841c3d5023f7bab029c0b2b235e7e7.tar.gz
This updates the paste.auth.* modules to include
environ in the authentication callback functions. - auth.basic was modified to have a callback of authfunc(environ, username, password) - auth.digest was modified in a similar manner, authfunc(environ, realm, password) - auth.digest's digest_password also had it's arguments reversed to be consistent with the corresponding authfunc(); if you're going to break -- let's fix two things at once! - auth.form has a change similar to auth.basic These changes were suggested via Matthew Scott on the paste mailing list; only that I put the environ first to be consistent with other WSGI functions.
Diffstat (limited to 'paste/auth/basic.py')
-rw-r--r--paste/auth/basic.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/paste/auth/basic.py b/paste/auth/basic.py
index 0f7f72c..8f0ecab 100644
--- a/paste/auth/basic.py
+++ b/paste/auth/basic.py
@@ -14,7 +14,7 @@ use ``digest`` authentication.
>>> from paste.httpserver import serve
>>> # from paste.auth.basic import AuthBasicHandler
>>> realm = 'Test Realm'
->>> def authfunc(username, password):
+>>> def authfunc(environ, username, password):
... return username == password
>>> serve(AuthBasicHandler(dump_environ, realm, authfunc))
serving on...
@@ -46,7 +46,7 @@ class AuthBasicAuthenticator:
return self.build_authentication()
auth = auth.strip().decode('base64')
username, password = auth.split(':',1)
- if self.authfunc(username, password):
+ if self.authfunc(environ, username, password):
return username
return self.build_authentication()
@@ -74,9 +74,9 @@ class AuthBasicHandler:
``authfunc``
This is a mandatory user-defined function which takes a
- ``username`` and ``password`` for its first and second
- arguments respectively. It should return ``True`` if
- the user is authenticated.
+ ``environ``, ``username`` and ``password`` for its first
+ three arguments. It should return ``True`` if the user is
+ authenticated.
"""
def __init__(self, application, realm, authfunc):