Skip to content

Commit

Permalink
Merge 3130e8b into backport/kubawi-peteski22/VAULT-1324/fix-control-g…
Browse files Browse the repository at this point in the history
…roup-wrapping/constantly-many-newt
  • Loading branch information
hc-github-team-secure-vault-core committed Sep 7, 2023
2 parents 4d4aac7 + 3130e8b commit 31cdef3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelog/22818.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
cli: Fix the CLI failing to return wrapping information for KV PUT and PATCH operations when format is set to `table`.
```
5 changes: 5 additions & 0 deletions command/kv_patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@ func (c *KVPatchCommand) Run(args []string) int {
return PrintRawField(c.UI, secret, c.flagField)
}

// If the secret is wrapped, return the wrapped response.
if secret.WrapInfo != nil && secret.WrapInfo.TTL != 0 {
return OutputSecret(c.UI, secret)
}

if Format(c.UI) == "table" {
outputPath(c.UI, fullPath, "Secret Path")
metadata := secret.Data
Expand Down
5 changes: 5 additions & 0 deletions command/kv_put.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ func (c *KVPutCommand) Run(args []string) int {
return PrintRawField(c.UI, secret, c.flagField)
}

// If the secret is wrapped, return the wrapped response.
if secret.WrapInfo != nil && secret.WrapInfo.TTL != 0 {
return OutputSecret(c.UI, secret)
}

if Format(c.UI) == "table" {
outputPath(c.UI, fullPath, "Secret Path")
metadata := secret.Data
Expand Down

0 comments on commit 31cdef3

Please sign in to comment.