Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VAULT-1324] Fix the CLI failing to return wrapping information for KV PUT and PATCH operations when format is set to 'table' #22818

Merged
merged 5 commits into from Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog/22818.txt
@@ -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
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 != nil && secret.WrapInfo != nil && secret.WrapInfo.TTL != 0 {
kubawi marked this conversation as resolved.
Show resolved Hide resolved
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
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 != nil && secret.WrapInfo != nil && secret.WrapInfo.TTL != 0 {
kubawi marked this conversation as resolved.
Show resolved Hide resolved
return OutputSecret(c.UI, secret)
}

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