kms
kms copied to clipboard
Erroneous ID/Tag parsing
This holds for all actions:
- The current implemented introduces an undocumented behavior when both
--idand--tagare passed. Using an enum could solve the problem:
struct AddAttributeAction {
access_policy: String,
handle: KeyHandle,
}
enum KeyHandle {
Id(String),
Tags(Vec<String>),
}
- The parsing of tags may be checked against the empty vector. It is not clear for me how the current implementation behaves when passed
--tagwith an empty string. My guess would be an "UnknownKeyId" error returned from a call to the KMS. This corner case could be checked locally instead.
Originally posted by @tbrezot in https://github.com/Cosmian/kms/pull/179#discussion_r1511330237