Skip to content

Commit

Permalink
chore: change WithMeta to ExcludeMeta for backwards compatibility (#220)
Browse files Browse the repository at this point in the history
Signed-off-by: Chinmay D. Pai <chinmay.pai@zerodha.com>
  • Loading branch information
Thunderbottom authored May 24, 2023
1 parent 9316ceb commit 16aac23
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions providers/vault/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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{})
}

Expand Down

0 comments on commit 16aac23

Please sign in to comment.