Nitrokey / pynitrokey

Python client for Nitrokey devices
Apache License 2.0
98 stars 27 forks source link

nk3 set-config: Add support for opcard.use_se050_backend #488

Closed robin-nitrokey closed 9 months ago

robin-nitrokey commented 9 months ago

This patch refactors the set-config command:

  1. It checks whether the config option is supported by the device using the GET_CONFIG command before any other steps are performed.
  2. For known keys that trigger a reset, currently only opcard.use_se050_backend, a warning and a confirmation prompt are shown.
  3. Unknown keys are rejected unless --force is set, trigger a warning and require a confirmation prompt.
  4. It adds a --dry-run option to check the infos and prompts that are printed for a config change.
  5. It adds an automatic reboot if required.

Potential improvements:

daringer commented 9 months ago

lgtm! tested on v1.6-test-20231218 with nk3am: