Skip to content

Commit

Permalink
[VAULT-1324] Fix the CLI failing to return wrapping information for K…
Browse files Browse the repository at this point in the history
…V PUT and PATCH operations when format is set to 'table' (#22818)
  • Loading branch information
kubawi committed Sep 7, 2023
1 parent db66213 commit 3130e8b
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 @@ -264,6 +264,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 @@ -219,6 +219,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 3130e8b

Please sign in to comment.