From da7964ce7cbdc0e28c4558caabcf36d384253ed1 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Thu, 28 Feb 2008 14:03:55 +0100 Subject: refactored docstrings for epydoc --- wsgitools/digest.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'wsgitools/digest.py') diff --git a/wsgitools/digest.py b/wsgitools/digest.py index a0eb973..7284c1c 100755 --- a/wsgitools/digest.py +++ b/wsgitools/digest.py @@ -38,14 +38,15 @@ class AuthTokenGenerator: interface consists of beeing callable with a username and having a realm attribute being a string.""" def __init__(self, realm, getpass): - """Realm is a string according to RFC2617. - The provided getpass function is called with a username and - password is expected as result. None may be used as an invalid - password.""" + """ + @param realm: is a string according to RFC2617. + @param getpass: this function is called with a username and password is + expected as result. None may be used as an invalid password.""" self.realm = realm self.getpass = getpass def __call__(self, username, algo="md5"): - """Generates an authentification token from a username.""" + """Generates an authentification token from a username. + @type username: str""" assert algo.lower() in ["md5", "md5-sess"] password = self.getpass(username) if password is None: @@ -58,15 +59,16 @@ class AuthDigestMiddleware: """Middleware partly implementing RFC2617. (md5-sess was omited)""" algorithms = {"md5": lambda data: md5.new(data).hexdigest()} def __init__(self, app, gentoken, maxage=300, maxuses=5): - """app is the wsgi application to be served with authentification. - gentoken has to have the same functionality and interface as the + """ + @param app: is the wsgi application to be served with authentification. + @param gentoken: has to have the same functionality and interface as the AuthTokenGenerator class. - maxage is the number of seconds a nonce may be valid. Choosing a large - value may result in more memory usage whereas a smaller value - results in more requests. Defaults to 5 minutes. - maxuses is the number of times a nonce may be used (with different nc - values). A value of 1 makes nonces usable exactly once - resulting in more requests. Defaults to 5. + @param maxage: is the number of seconds a nonce may be valid. Choosing a + large value may result in more memory usage whereas a smaller + value results in more requests. Defaults to 5 minutes. + @param maxuses: is the number of times a nonce may be used (with + different nc values). A value of 1 makes nonces usable exactly + once resulting in more requests. Defaults to 5. """ self.app = app self.gentoken = gentoken -- cgit v1.2.3