diff options
author | Helmut Grohne <helmut@subdivi.de> | 2008-02-28 14:03:55 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2008-02-28 14:03:55 +0100 |
commit | da7964ce7cbdc0e28c4558caabcf36d384253ed1 (patch) | |
tree | fcf9bc383e46bfd64eacc8ebbd5a6b357f3d6ce0 /wsgitools/digest.py | |
parent | aa85b52862c598afab383e777688feb9648cfbf0 (diff) | |
download | wsgitools-da7964ce7cbdc0e28c4558caabcf36d384253ed1.tar.gz |
refactored docstrings for epydoc
Diffstat (limited to 'wsgitools/digest.py')
-rwxr-xr-x | wsgitools/digest.py | 28 |
1 files changed, 15 insertions, 13 deletions
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 |