From 16aac23acf89e9d262acba71c286319791f774fe Mon Sep 17 00:00:00 2001 From: Chinmay Pai Date: Wed, 24 May 2023 11:22:46 +0530 Subject: [PATCH] chore: change WithMeta to ExcludeMeta for backwards compatibility (#220) Signed-off-by: Chinmay D. Pai --- providers/vault/vault.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/providers/vault/vault.go b/providers/vault/vault.go index 1e3528fd..202220aa 100644 --- a/providers/vault/vault.go +++ b/providers/vault/vault.go @@ -35,12 +35,12 @@ type Config struct { // Internal HTTP client timeout Timeout time.Duration - // WithMeta states whether the secret should be returned with its metadata. - // If WithMeta is true, the value for data `key` and the metadata `version` - // can be accessed as `k.String("data.key")` and `k.Int("metadata.version")`. - // When set to false, no metadata will be returned, and the data can be - // accessed as `k.String("key")`. - WithMeta bool + // ExcludeMeta states whether the secret should be returned with its metadata. + // If ExcludeMeta is true, no metadata will be returned, and the data can be + // accessed as `k.String("key")`. If set to false, the value for data `key` + // and the metadata `version` can be accessed as `k.String("data.key")` and + // `k.Int("metadata.version")`. + ExcludeMeta bool } type Vault struct { @@ -73,7 +73,7 @@ func (r *Vault) Read() (map[string]interface{}, error) { } s := secret.Data - if !r.cfg.WithMeta { + if r.cfg.ExcludeMeta { s = secret.Data["data"].(map[string]interface{}) }