mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-23 09:56:23 +03:00
support yk preview
This commit is contained in:
parent
e8bbd37ac0
commit
67b9c1e70b
@ -10,8 +10,7 @@ from base64 import b32encode, b64decode
|
||||
from binascii import a2b_hex, b2a_hex
|
||||
|
||||
from ykman.descriptor import get_descriptors
|
||||
from ykman.util import (
|
||||
CAPABILITY, TRANSPORT, parse_b32_key)
|
||||
from ykman.util import (TRANSPORT, parse_b32_key)
|
||||
from ykman.driver_otp import YkpersError
|
||||
from ykman.driver_ccid import APDUError
|
||||
from ykman.oath import (ALGO, OATH_TYPE, OathController, CredentialData,
|
||||
@ -137,9 +136,10 @@ class Controller(object):
|
||||
'name': dev.device_name,
|
||||
'version': version,
|
||||
'serial': dev.serial or '',
|
||||
'enabled': [c.name for c in CAPABILITY if c & dev.enabled],
|
||||
'connections': [
|
||||
t.name for t in TRANSPORT if t & dev.capabilities]
|
||||
'usb_interfaces_supported': [
|
||||
t.name for t in TRANSPORT
|
||||
if t & dev.config.usb_supported],
|
||||
'usb_interfaces_enabled': str(dev.mode).split('+')
|
||||
}
|
||||
|
||||
return self._dev_info
|
||||
|
@ -12,16 +12,16 @@ Python {
|
||||
property string name
|
||||
property var version
|
||||
property string oathId
|
||||
property var connections: []
|
||||
property var supportedUsbInterfaces: []
|
||||
property var enabledUsbInterfaces: []
|
||||
property var entries: null
|
||||
property int nextRefresh: 0
|
||||
property var enabled: null
|
||||
property bool yubikeyModuleLoaded: false
|
||||
property bool yubikeyReady: false
|
||||
property bool yubikeyBusy: false
|
||||
property var queue: []
|
||||
readonly property bool hasOTP: enabled.indexOf('OTP') !== -1
|
||||
readonly property bool hasCCID: enabled.indexOf('CCID') !== -1
|
||||
readonly property bool hasOTP: enabledUsbInterfaces.indexOf('OTP') !== -1
|
||||
readonly property bool hasCCID: enabledUsbInterfaces.indexOf('CCID') !== -1
|
||||
property bool validated
|
||||
property bool slot1inUse
|
||||
property bool slot2inUse
|
||||
@ -101,11 +101,10 @@ Python {
|
||||
do_call('yubikey.controller.refresh', [slotMode],
|
||||
function (dev) {
|
||||
var usable = dev && dev.usable
|
||||
|
||||
name = usable ? dev.name : ''
|
||||
version = usable ? dev.version : null
|
||||
enabled = usable ? dev.enabled : []
|
||||
connections = usable ? dev.connections : (dev ? dev.transports : [])
|
||||
enabledUsbInterfaces = usable ? dev.usb_interfaces_enabled : []
|
||||
supportedUsbInterfaces = usable ? dev.usb_interfaces_supported : []
|
||||
hasDevice = !!usable
|
||||
})
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user