-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dealing with multiple devices #99
Comments
Agreed. They all seems useful and are orthogonal to each other.
Hm. It's a tough one. I haven't looked at the changes to the API surface in detail (especially in I'd also want to avoid context sensitive behavior where things work fine if nothing is specified but only a single device is plugged in, and then suddenly the program errors out if another stick is present. Such behavior tends to lead to unexpected issues at some point. But I guess one could argue that we already have that (you expect the status command to show information about the plugged in Pro stick but once you plugin in a Storage device that shows up by default, for example). To completely avoid such cases (I guess), we would require one of My gut says that the vast majority of users wouldn't care one way or another, because they only have a single device (perhaps should be add telemetry reporting to get confirmation? :P). As such, I am tempted to say "let's just keep the existing behavior". But honestly, if you feel strongly about checking present devices upfront I am not opposed. |
It would call
Yes, that’s my point. And judging from the principle of least surprise, I think it makes more sense to do nothing if we don’t know which device the user wants to use than arbitrarily selecting one of them. If we want to enforce consistent behavior, we should execute the commands on all connected devices – but that just does not make sense for most of the commands.
Absolutely.
I agree.
It’s not that important to me either, it just feels problematic that executing a command on the wrong device could easily brick it, while asking the user to select a device won’t hurt them (and is very unlikely to bother them in the first place). |
Can we close this issue, @robinkrahl, or is there anything left to discuss here? |
As we now are able to detect multiple devices and select one of them to connect to, we should decide how to deal with multiple devices.
We already have the
--model
option and I think we should also have a--serial-number
option, maybe even a--usb-path
option, to select the Nitrokey device to connect to.But what should we do if there are multiple devices but the user did not select one of them (or the user selected a model and there are multiple devices of that model)? Currently we just use the first one returned by hidapi. This is the easiest solution, but it is also potentially dangerous. My suggestion is to abort if we have more than one eligible device, asking the user to select one of them. What do you think?
The text was updated successfully, but these errors were encountered: