Skip to content

daemon: Offer devices based on libwebauthn's available transports - #253

Open
kpanuragh wants to merge 1 commit into
linux-credentials:mainfrom
kpanuragh:available-transports-ui
Open

kpanuragh wants to merge 1 commit into
linux-credentials:mainfrom
kpanuragh:available-transports-ui

Conversation

@kpanuragh

Copy link
Copy Markdown

Refs #32.

get_available_public_key_devices() now builds the device list shown in the UI from libwebauthn::available_transports(), the same source start_discovery() already uses. Before, USB was hard-coded and hybrid and NFC were checked separately.

  • The mapping is a small pure function (devices_for_transports) with unit tests.
  • Device IDs stay the same per transport ("0" USB, "1" hybrid QR, "2" NFC).
  • No change in what's offered today: in libwebauthn 0.11, hybrid::is_available() and the Hybrid entry of available_transports() both come from ble::is_available().

Tested with meson test --interactive (5/5 OK) and cargo clippy.

One question I didn't want to change silently: the device list offers NFC when a reader is present, but NFC discovery in start_discovery() is commented out (the SoloKey framing issue in the TODO). So choosing NFC in the UI currently can't find a device. Should NFC be left out of the list until discovery is re-enabled? Happy to add that here or in a follow-up.

Build the list of devices offered to the user from
libwebauthn::available_transports(), the same source start_discovery()
already uses, instead of hard-coding USB and checking hybrid and NFC
separately. The device selection and discovery can then no longer
disagree, and a transport libwebauthn reports in the future only needs
a mapping entry.

The mapping is a pure function with tests. Device IDs stay the same per
transport ("0" USB, "1" hybrid QR, "2" NFC). In libwebauthn 0.11,
hybrid::is_available() and the Hybrid entry of available_transports()
both come from ble::is_available(), so the offered devices don't change.

Refs linux-credentials#32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant