From 5ddc8460de1d3bf1ea41eb4fdc7079d15dcf6837 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Thu, 27 Mar 2008 14:40:50 +0100 Subject: epydoc update --- wsgitools/digest.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'wsgitools/digest.py') 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(':') -- cgit v1.2.3