Repository navigation
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #32.
get_available_public_key_devices()now builds the device list shown in the UI fromlibwebauthn::available_transports(), the same sourcestart_discovery()already uses. Before, USB was hard-coded and hybrid and NFC were checked separately.devices_for_transports) with unit tests.hybrid::is_available()and theHybridentry ofavailable_transports()both come fromble::is_available().Tested with
meson test --interactive(5/5 OK) andcargo 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.