Nitrokey / pynitrokey

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

secrets: Make _semver_equal_or_newer public #407

Open robin-nitrokey opened 1 year ago

robin-nitrokey commented 1 year ago

As a library user, I’d like SecretsApp,_semver_equal_or_newer to be part of the public API so that I can use it to ensure a minimum version not only based on a specific feature.

szszszsz commented 1 year ago

I do not see the purpose here. Can you elaborate on the use case?

I think further clients should not try to embed any knowledge regarding version and features relation, and instead it should be kept in the library directly communicating with the device.

robin-nitrokey commented 1 year ago

For nitrokey-app, I want to enforce the policy to support only the latest version, at least until the API has stabilized. In the last releases, there were many subtle changes that are difficult to map to features, e. g. PIN requirements, touch requirement, list response, etc. Similar changes in the near future could be:

We could add a feature flag for all of these and check all, but I think this is just an unnecessarily complex workaround for a version check. A version check would also represent the fact that we currently only test against a specific version. In my opinion, feature flags are more suitable for enabling and disabling larger groups of functionality like PWS support.