keepassxreboot / keepassxc

KeePassXC is a cross-platform community-driven port of the Windows application “Keepass Password Safe”.
https://keepassxc.org/
Other
21.46k stars 1.48k forks source link

Placeholder not resolved in preview panel #10961

Closed agowa closed 1 month ago

agowa commented 5 months ago

Overview

Currently (2.7.9) KeepassXC doesn't resolve placeholders like {USERNAME} in the Preview panel. However it resolves them correctly when copying them.

Steps to Reproduce

  1. Create an entry with username "foo" and password "bar"
  2. Create a custom attribute named "foobar" and enter the value {USERNAME}
  3. Click on "View" and enable "Show Preview Panel"
  4. Switch to the "Advanced" tab in the preview panel and look at the "foobar" entry.

Expected Behavior

Either a) show the resolved value as the value of the entry in the preview panel b) Show both the placeholder and resolved value as the value in the preview panel like in the q'n'd mock-up below.

Actual Behavior

Shows the placeholder as if it was the value of the custom attribute.

Context

Q'n'D mockup of possible GUI for showing both the placeholder and it's resolved value (alternatively add the typical link symbol almost every OS has and show the placeholder itself on mouse over and the resolved value like a normal value). image

KeePassXC - Version 2.7.9 Revision: 8f6dd13

Qt 5.15.14 Debugging mode is disabled.

Operating system: Arch Linux CPU architecture: x86_64 Kernel: linux 6.9.5-arch1-1

Enabled extensions:

Cryptographic libraries:

Operating System: Linux Desktop Env: KDE Windowing System: Wayland

droidmonkey commented 5 months ago

The placeholder is actually {Username}

agowa commented 5 months ago

The original keepass documentation says {USERNAME} and it works for copying the value ;-)

~Am I really hitting all of the edge cases today? :D~

Edit: Also doesn't work in the preview pannel image

droidmonkey commented 5 months ago

Ah both {USERNAME} and {Username} work because they are special cases. Custom attributes referenced using the {S: prefix are case sensitive. Typically attribute placeholders are case sensitive.

There are two bugs here:

  1. Preview panel, advanced tab, doesn't show filled placeholders
  2. When double clicking and advanced attribute value in the preview panel, the copied value is also not filled in
www-wagner commented 5 months ago

Other types of placeholders has issues since 2.7.9 (Flatpak version) as well. I have some entries with the reference {REF:U@T:title}. Besides it isn't showing the resolved value in list and preview, not even copying and pasting is working as expected, where the placeholder itself is being copied.