Ignore:
Timestamp:
Oct 28, 2008, 8:00:22 PM (16 years ago)
Author:
broder
Message:

In the web interface, get the VNC auth token over remctl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-web/code/main.py

    r1318 r1391  
    246246    machine = validation.Validate(username, state, machine_id=fields.getfirst('machine_id')).machine
    247247
    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')
    260249    host = controls.listHost(machine)
    261250    if host:
Note: See TracChangeset for help on using the changeset viewer.