summaryrefslogtreecommitdiff
path: root/cherrypy/lib/auth.py
diff options
context:
space:
mode:
authorGustavo Picon <tabo@tabo.pe>2014-01-12 20:04:16 -0500
committerGustavo Picon <tabo@tabo.pe>2014-01-12 20:04:16 -0500
commit89b473735d830a1eda091da5f726ea74a110f7ea (patch)
tree07c1716a9c20b3366ce70d1b8932a44eb69e8ea1 /cherrypy/lib/auth.py
parentebbf43f5ff35c39d5f936b47a5a68d54eaaf27cf (diff)
downloadcherrypy-git-89b473735d830a1eda091da5f726ea74a110f7ea.tar.gz
More PEP8 work.
Diffstat (limited to 'cherrypy/lib/auth.py')
-rw-r--r--cherrypy/lib/auth.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/cherrypy/lib/auth.py b/cherrypy/lib/auth.py
index 79ca83ee..71591aaa 100644
--- a/cherrypy/lib/auth.py
+++ b/cherrypy/lib/auth.py
@@ -3,7 +3,8 @@ from cherrypy.lib import httpauth
def check_auth(users, encrypt=None, realm=None):
- """If an authorization header contains credentials, return True, else False."""
+ """If an authorization header contains credentials, return True or False.
+ """
request = cherrypy.serving.request
if 'authorization' in request.headers:
# make sure the provided credentials are correctly set
@@ -53,7 +54,8 @@ def basic_auth(realm, users, encrypt=None, debug=False):
A string containing the authentication realm.
users
- A dict of the form: {username: password} or a callable returning a dict.
+ A dict of the form: {username: password} or a callable returning
+ a dict.
encrypt
callable used to encrypt the password returned from the user-agent.
@@ -79,7 +81,8 @@ def digest_auth(realm, users, debug=False):
realm
A string containing the authentication realm.
users
- A dict of the form: {username: password} or a callable returning a dict.
+ A dict of the form: {username: password} or a callable returning
+ a dict.
"""
if check_auth(users, realm=realm):
if debug: