vault
vault copied to clipboard
Json secrets not being displayed on UI when a value is null
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:
- Create a kv secret engine then press the add secret button.
- Toggle the json switch to on, give your secret a name and inside the text area add the following json
{
"key":null,
}
- 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 (c6e4c2d4dc3b0d57791881b087c026e2f75a87cb) - 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
}
Also reproduced on 1.16.1
Fixed per the linked prs.