vault-client icon indicating copy to clipboard operation
vault-client copied to clipboard

Refactor Key/Value logic into KvClient

Open winpat opened this issue 6 years ago • 2 comments

With the more recent Vault releases, a version 2 of the key/value backend has been introduced. This new version has a different URL scheme, which is not compatible with the old one. (This is due to the fact that secrets are versioned in v2.)

Since we don't want to encode the logic of different URL schemes in every command, we refactor this into a new KvClient abstraction. This not only simplifies the code of the commands but also makes the code better testable.

This MR will be the base to support multiple versions of the k/v backend in the future.

winpat avatar Feb 08 '19 16:02 winpat

Looks like the tests are a bit flaky. I will fix them first.

winpat avatar Apr 18 '19 16:04 winpat

@winpat This fail is still open, other than that the changes look sane.

--- FAIL: TestList/ListExistingSecretsRecursively (0.01s)
   list_test.go:88: Wrong exit code. errors: 
       Unkown error occured: [*errors.errorString] "Secret does not exist"

hairmare avatar Dec 12 '19 16:12 hairmare