Changeset 1965 for trunk/packages/invirt-vnc-server/invirt-vnc-authtoken
- Timestamp:
- Jan 8, 2009, 4:19:47 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/invirt-vnc-server/invirt-vnc-authtoken
r1389 r1965 9 9 import base64 10 10 from invirt.vnc import getTokenKey 11 from invirt.config import structs as config 11 12 12 13 def getAuthToken(username, machine, lifetime=5*60): … … 15 16 data['machine'] = machine 16 17 data['expires'] = time.time() + lifetime 18 data['connect_host'] = config.web.hostname 19 try: 20 data['connect_port'] = 10003 + [h.hostname for h in 21 config.hosts].index(os.uname()[1]) 22 except: 23 data['connect_port'] = 5900 17 24 pickled_data = cPickle.dumps(data) 18 25 m = hmac.new(getTokenKey(), digestmod=sha)
Note: See TracChangeset
for help on using the changeset viewer.