aboutsummaryrefslogtreecommitdiff
path: root/src/config.rs
Commit message (Collapse)AuthorAge
* Add --usb-path option to select deviceRobin Krahl2020-09-09
| | | | | | | | | | | | | This patch adds the --usb-path option as an additional way to filter the Nitrokey device to connect to. While the serial number is a better identifier in theory, the Nitrokey Storage devices do not send their serial number in the USB device descriptor. Having the --usb-path options allows users to select one of multiple Nitrokey Storage devices. While we could directly call the nitrokey::Manager::connect_path function with the specified path, we integrate the --usb-path option into the existing find_device function for consistent error messages and to avoid having to duplicate the --model and --serial-number checks.
* Add --serial-number optionRobin Krahl2020-09-07
| | | | | | | | This patch adds the --serial-number option that allows the user to filter the attached Nitrokey devices by serial number. As the Nitrokey Storage does not include its serial number in the USB device descriptor and as we don't want to connect to it just to query the serial number, this option only works for Nitrokey Storage devices.
* Adjust copyright & license specification to comply with REUSE 3.0Daniel Mueller2020-09-02
| | | | | | | | With this change we switch to using a REUSE compliant way of specifying the copyright & license of the program. To be fully in conformance we also add additional license specifications for the remaining files in the project. Lastly, a new CI pipeline rule takes care of verifying compliance on an ongoing basis.
* Adjust copyright string to refer to The Nitrocli DevelopersDaniel Mueller2020-09-01
| | | | | This change adjusts the copyright header in all files to no longer mention individuals but refer to The Nitrocli Developers in general.
* Add --no-cache option to bypass PIN cacheRobin Krahl2020-09-05
| | | | | | | | This patch adds a new --no-cache option that corresponds to the NITROCLI_NO_CACHE environment variable and the no_cache configuration. This makes the user interface more consistent as all configuration items are now backed by both an environment variable and a command-line option.
* Use standard configuration file locationsRobin Krahl2020-09-05
| | | | | | | | | This patch uses the directories crate to query the appropriate path for the configuration files. For Linux, paths according to the XDG Base Directory Specification are used. Note that directories does not yet support the XDG_CONFIG_DIRS variable for system-wide configuration files. Therefore we only use a user configuration file.
* Use envy to parse environment variables for ConfigRobin Krahl2020-09-05
| | | | | | | | This patch uses the envy crate to parse the environment. A variable NITROCLI_KEY can be used to overwrite the configuration for *key*. This has the side effect that the NITROCLI_NO_CACHE variable is evaluated as a boolean variable (instead of only checking whether it is set). We also accept two new variables, NITROCLI_MODEL and NITROCLI_VERBOSITY.
* Implement configuration handlingRobin Krahl2020-09-05
This patch implements basic configuration handling that reads a configuration file and stores the parsed data in the ExecCtx and RunCtx structs. It supports three configuration items: - model (previously only --model) - no_cache (previously only NITROCLI_NO_CACHE) - verbosity (previously only --verbose)