vault-client
vault-client copied to clipboard
Refactor Key/Value logic into KvClient
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.
Looks like the tests are a bit flaky. I will fix them first.
@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"