1.1 --- a/WebStack/Helpers/Auth.py Sat May 29 23:55:48 2004 +0000
1.2 +++ b/WebStack/Helpers/Auth.py Sun May 30 14:40:18 2004 +0000
1.3 @@ -5,6 +5,7 @@
1.4 """
1.5
1.6 import base64
1.7 +import md5
1.8
1.9 class UserInfo:
1.10
1.11 @@ -33,4 +34,13 @@
1.12
1.13 self.username, self.password = None, None
1.14
1.15 +def get_token(plaintext, secret_key):
1.16 +
1.17 + """
1.18 + Return a string containing an authentication token made from the given
1.19 + 'plaintext' and 'secret_key'.
1.20 + """
1.21 +
1.22 + return plaintext + ":" + md5.md5(plaintext + secret_key).hexdigest()
1.23 +
1.24 # vim: tabstop=4 expandtab shiftwidth=4