summaryrefslogtreecommitdiff
path: root/wsgitools/digest.py
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2008-03-27 14:40:50 +0100
committerHelmut Grohne <helmut@subdivi.de>2008-03-27 14:40:50 +0100
commit5ddc8460de1d3bf1ea41eb4fdc7079d15dcf6837 (patch)
treeca9f7a53eda8596b9f9d83e836ec110a10af2467 /wsgitools/digest.py
parentc44530be1a4028ecf62b13dc24b847442114b2ec (diff)
downloadwsgitools-5ddc8460de1d3bf1ea41eb4fdc7079d15dcf6837.tar.gz
epydoc update
Diffstat (limited to 'wsgitools/digest.py')
-rwxr-xr-xwsgitools/digest.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/wsgitools/digest.py b/wsgitools/digest.py
index 19fb975..28fb9c7 100755
--- a/wsgitools/digest.py
+++ b/wsgitools/digest.py
@@ -50,7 +50,9 @@ class AuthTokenGenerator:
self.getpass = getpass
def __call__(self, username, algo="md5"):
"""Generates an authentification token from a username.
- @type username: str"""
+ @type username: str
+ @rtype: str
+ """
assert algo.lower() in ["md5", "md5-sess"]
password = self.getpass(username)
if password is None:
@@ -161,7 +163,10 @@ class AuthDigestMiddleware:
return self.app(environ, modified_start_response)
def auth_response(self, credentials, reqmethod):
- """internal method generating authentication tokens"""
+ """internal method generating authentication tokens
+ @raise KeyError:
+ @raise ValueError:
+ """
username = credentials["username"]
algo = credentials["algorithm"]
uri = credentials["uri"]
@@ -191,7 +196,10 @@ class AuthDigestMiddleware:
self.nonces.pop(0)
def is_nonce(self, credentials):
- """internal method checking whether a nonce might be from this server"""
+ """internal method checking whether a nonce might be from this server
+ @raise KeyError:
+ @raise ValueError:
+ """
nonce = credentials["nonce"] # raises KeyError
# raises ValueError
nonce_time, nonce_value, nonce_hash = nonce.split(':')
@@ -200,7 +208,10 @@ class AuthDigestMiddleware:
return nonce_hash == token
def check_nonce(self, credentials):
- """internal method checking nonce validity"""
+ """internal method checking nonce validity
+ @raise KeyError:
+ @raise ValueError:
+ """
nonce = credentials["nonce"]
# raises ValueError
nonce_time, nonce_value, nonce_hash = nonce.split(':')