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

Json secrets not being displayed on UI when a value is null #26709

Closed
CodeLover254 opened this issue Apr 30, 2024 · 2 comments
Closed

Json secrets not being displayed on UI when a value is null #26709

CodeLover254 opened this issue Apr 30, 2024 · 2 comments
Labels
reproduced This issue has been reproduced by a Vault engineer ticketed ui

Comments

@CodeLover254
Copy link

Describe the bug
On Vault 1.16.2 display of json secrets breaks when a value in the json object is null. On inspection of the console, I realized that the javascript code was failing with the error. Uncaught (in promise) TypeError: Cannot convert undefined or null to object
at Function.keys ()

To Reproduce
Steps to reproduce the behavior:

  1. Create a kv secret engine then press the add secret button.
  2. Toggle the json switch to on, give your secret a name and inside the text area add the following json
{
   "key":null,
}
  1. Click the save button. The secret should be saved but cannot be displayed on the //details?version=1 page as long as the json switch is toggled to on.

Expected behavior
The json content should display in the details page regardless of a value in the json being null.

Environment:

  • Vault Server Version (retrieve with vault status): 1.16.2
  • Vault CLI Version (retrieve with vault version): Vault v1.16.2 (c6e4c2d)
  • Server Operating System/Architecture: Ubuntu 20.04 arm64

Vault server configuration file(s):

ui = true
disable_mlock = true

storage "raft" {
  path = "/opt/vault/data"
  node_id="node1"
}

api_addr = "http://127.0.0.1:8200"
cluster_addr="https://127.0.0.1:8201"

listener "tcp" {
  address = "127.0.0.1:8200"
  tls_disable = 1
}
@timonych
Copy link

timonych commented May 1, 2024

Also reproduced on 1.16.1

@Monkeychip
Copy link
Contributor

Fixed per the linked prs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reproduced This issue has been reproduced by a Vault engineer ticketed ui
Projects
None yet
Development

No branches or pull requests

5 participants