- Timestamp:
- Oct 28, 2008, 8:00:22 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/invirt-web/code/main.py
r1318 r1391 246 246 machine = validation.Validate(username, state, machine_id=fields.getfirst('machine_id')).machine 247 247 248 TOKEN_KEY = "0M6W0U1IXexThi5idy8mnkqPKEq1LtEnlK/pZSn0cDrN" 249 250 data = {} 251 data["user"] = username 252 data["machine"] = machine.name 253 data["expires"] = time.time()+(5*60) 254 pickled_data = cPickle.dumps(data) 255 m = hmac.new(TOKEN_KEY, digestmod=sha) 256 m.update(pickled_data) 257 token = {'data': pickled_data, 'digest': m.digest()} 258 token = cPickle.dumps(token) 259 token = base64.urlsafe_b64encode(token) 248 token = remctl('control', machine.name, 'vnctoken') 260 249 host = controls.listHost(machine) 261 250 if host:
Note: See TracChangeset
for help on using the changeset viewer.