vault icon indicating copy to clipboard operation
vault copied to clipboard

Secret Copy JSON button does not copy to clipboard

Open cpotteck opened this issue 5 months ago • 1 comments

Describe the bug A clear and concise description of what the bug is.

Attempting to copy a kv v2 secret JSON using Copy > Copy JSON does not copy to clipboard

To Reproduce Steps to reproduce the behavior:

  1.  docker run -it --rm -p 8200:8200 hashicorp/vault:1.21
    
  2. Open http://localhost:8200/, log in with root token
  3. Create a secret in the default kv v2 engine http://localhost:8200/ui/vault/secrets/secret/kv/create, e.g. with key: "foo", value: "bar"
  4. Open secret details tab, e.g. http://localhost:8200/ui/vault/secrets/secret/kv/test/details
  5. Clip on "Copy" dropdown > "Copy JSON"
  6. A green toast with "Success" "JSON Copied!" appears on the bottom right
  7. Secret is not copied to clipboard (trying to paste shows that nothing is in the clipboard)

Expected behavior

Note that the alternative method to copy the secret JSON works as expected to copy to clipboard:

  1. Toggle JSON view on secret details tab
  2. Click on clipboard icon in JSON view

The expected behavior happens when running with the latest 1.20.x release:

  1.  docker run -it --rm -p 8200:8200 hashicorp/vault:1.20
    
  2. Open http://localhost:8200/, log in with root token
  3. Create a secret in the default kv v2 engine http://localhost:8200/ui/vault/secrets/secret/kv/create, e.g. with key: "foo", value: "bar"
  4. Open secret details tab, e.g. http://localhost:8200/ui/vault/secrets/secret/kv/test/details
  5. Clip on "Copy" dropdown > "Copy JSON"
  6. A green toast with "Success JSON Copied!" appears on the bottom right
  7. Secret is actually copied to clipboard

Environment:

  • Vault Server Version (retrieve with vault status): 1.21.1
  • Vault CLI Version (retrieve with vault version): v1.20.4
  • Server Operating System/Architecture: Reproduced on Mac M1, MacOS 15, Edge browser

Vault server configuration file(s):

This is reproducible with hashicorp/vault:1.21 without additional configuration.

Additional context N/A

cpotteck avatar Nov 24 '25 21:11 cpotteck

  • Clip on "Copy" dropdown > "Copy JSON"
  • A green toast with "Success" "JSON Copied!" appears on the bottom right
  • Secret is not copied to clipboard (trying to paste shows that nothing is in the clipboard)

I have the exact same problem! Clicking on the copy icon IN the json viewer copies the text, but not using the dropdown copy menu.

harryheck avatar Nov 27 '25 12:11 harryheck