Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vault: return more descriptive error for K/V v2 backend
This commit modifies the Hashicorp Vault backend such that it returns a more descriptive error when trying to create a key on the unsupported v2 backend. The K/V v1 and v2 backends have different APIs for accessing keys. For example, you access a secret using the `<engine>/<path>` API on v1. The v2 backend uses the `<engine>/data/<path>` API. However, the Vault SDK does not return an error when trying to access a v2 backend with a v1 client. Instead, it returns a secret object that contains no data but an API warning. Therefore, we check whether the returned secret contains any data, and if not, don't return `kes.ErrKeyExists` but send a more descriptive error event.
- Loading branch information