1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 18:29:17 +02:00

VNC authentication works, although there is no UI for adding passwords

yet. Direct database manipulation is required for now.
This commit is contained in:
Simo Kinnunen 2015-10-13 03:14:18 +09:00
parent a902c66131
commit 5b5520b705
8 changed files with 332 additions and 32 deletions

View file

@ -124,12 +124,46 @@ module.exports = function(options) {
})
.catch(function(err) {
log.error(
'Unable to lookup user by fingerprint "%s"'
'Unable to lookup user by ADB fingerprint "%s"'
, message.fingerprint
, err.stack
)
})
})
.on(wire.JoinGroupByVncAuthResponseMessage, function(channel, message) {
dbapi.lookupUserByVncAuthResponse(message.response, message.serial)
.then(function(user) {
if (user) {
devDealer.send([
channel
, wireutil.envelope(new wire.AutoGroupMessage(
new wire.OwnerMessage(
user.email
, user.name
, user.group
)
, message.response
))
])
}
else if (message.currentGroup) {
appDealer.send([
message.currentGroup
, wireutil.envelope(new wire.JoinGroupByVncAuthResponseMessage(
message.serial
, message.response
))
])
}
})
.catch(function(err) {
log.error(
'Unable to lookup user by VNC auth response "%s"'
, message.response
, err.stack
)
})
})
.on(wire.JoinGroupMessage, function(channel, message, data) {
dbapi.setDeviceOwner(message.serial, message.owner)
appDealer.send([channel, data])