kms icon indicating copy to clipboard operation
kms copied to clipboard

Erroneous ID/Tag parsing

Open tbrezot opened this issue 1 year ago • 0 comments

          This holds for all actions:
  • The current implemented introduces an undocumented behavior when both --id and --tag are 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 --tag with 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

tbrezot avatar Mar 05 '24 14:03 tbrezot