Skip to content

Conversation

@lklivingstone
Copy link

@lklivingstone lklivingstone commented Dec 17, 2025

Description

What does this PR do?

This PR fixes issues in the KV version diff view where multiline and long secret values were not rendered correctly.

  • Secret values containing literal \n sequences were displayed as plain text instead of line breaks.
  • Long or multiline values could overflow the diff container, causing horizontal scrolling and truncated content.

These issues made it difficult to inspect secrets with multiline values (e.g. certificates, keys, or formatted text).

Approach

  • Normalize secret data before diffing so literal \n sequences are converted into actual line breaks.
  • Adjust rendering of nested <pre> elements generated by jsondiffpatch so:
    • The outer <pre> allows wrapping and constrains layout width.
    • Inner <pre> elements preserve formatting while safely wrapping long lines.

This ensures multiline secrets render correctly without expanding the layout horizontally.

Closes #31676

TODO only if you're a HashiCorp employee

  • Backport Labels: If this fix needs to be backported, use the appropriate backport/ label that matches the desired release branch.
    • LTS: If this fixes a critical security vulnerability or severity 1 bug, it will also need to be backported to the current LTS versions of Vault. To ensure this, use all available enterprise labels.
  • Jira: If this change has an associated Jira, it's referenced either in the PR description, commit message, or branch name.
  • RFC: If this change has an associated RFC, please link it in the description.

PCI review checklist

  • I have documented a clear reason for, and description of, the change I am making.
  • If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.
  • If applicable, I've documented the impact of any changes to security controls.

Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.

@lklivingstone lklivingstone requested review from a team as code owners December 17, 2025 16:13
@lklivingstone lklivingstone requested a review from abbyck December 17, 2025 16:14
@vercel
Copy link

vercel bot commented Dec 17, 2025

@lklivingstone is attempting to deploy a commit to the HashiCorp Team on Vercel.

A member of the Team first needs to authorize it.

@hashicorp-cla-app
Copy link

hashicorp-cla-app bot commented Dec 17, 2025

CLA assistant check
All committers have signed the CLA.

@hashicorp-cla-app
Copy link

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

@lklivingstone
Copy link
Author

I’ve kept restoreMultiline function local to this file (outside the component class) since it’s only used here and doesn’t depend on component state.
Please advise if this should live in a shared helper instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI Rendering Issue in Version Diff for multiline secrets

1 participant