Nitrokey / pynitrokey

Python client for Nitrokey devices
Apache License 2.0
103 stars 28 forks source link

Use config field availability information from the sdk #577

Closed sosthene-nitrokey closed 1 month ago

sosthene-nitrokey commented 1 month ago

In set-config, get the type of the and metadata for the fields, including information regarding the need for power-cycle and validation of accepted values.

Depends on:

Checklist

Make sure to run make check and make fix before creating a PR, otherwise the CI will fail.

Test Environment and Execution

Relevant Output Example

python nitropy.py nk3 set-config piv.disabled False
Command line tool to interact with Nitrokey devices 0.6.0
Critical error:
Unknown config value. Expected Bool, got `False`. Unknown config values can only be set if the --force/-f flag is set.  Aborting.
python nitropy.py nk3 set-config unknown-value False
Command line tool to interact with Nitrokey devices 0.6.0
Changing configuration values can have unexpected side effects, including data loss.
This should only be used for development and testing.
Critical error:
Unknown config values can only be set if the --force/-f flag is set.  Aborting.