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

Ability to reference another keepass entry's field (ie by uuid) #45

Open
fakuivan opened this issue Jun 6, 2018 · 3 comments
Open

Ability to reference another keepass entry's field (ie by uuid) #45

fakuivan opened this issue Jun 6, 2018 · 3 comments

Comments

@fakuivan
Copy link

fakuivan commented Jun 6, 2018

It'd be nice to have a field type for UUIDs, with an action that'd allow the user to pick an entry, and a disabled textbox showing the title of the entry the UUID points to.

@GraphiteWingedBird
Copy link

I'm not 100% sure I understand why you'd want the UUID field like this, but I think this is similar to an enhancement that I'd like to see. For me, I've just started storing my credit card details in the database using Custom Fields for card number, CVV, Expiration Date, etc. Since this data doesn't need a Username or Password, per se, I've been linking the Username, Password, and URL to an overall entry for my credentials at that specific bank. I.e. my Chase Sapphire entry's username is a reference back to my "Chase.com" entry, {REF:U@I:12345}. The password and URL are also passed by reference, just in case I decide to launch the URL and login in from the "Credit Card" entry instead of the main entry.

All of that said, KeePass has a great way of using the "Tools" button to create the reference syntax for an entry, but it is somewhat slow and repetitive and would be better if the Template could handle it. I'm envisioning something where you've got a new "Type" of template field for linked data and selecting it calls into the same pop-up box that using "Tools > Insert Field Reference" uses. Or - building on what you've described above, a UUID field type that allows you to choose a UUID for 'future links' and then defaulting logic within the template to swap out plaintext with the correct UUID when the entry is saved.

  1. Field type of UUID that launches an entry selection, and then displays the UUID's Title in a read-only once selected
  2. Other entries can use defaulting to reference the UUID once it is selected
  3. Awesomeness

As an example -
New Entry = Chase Sapphire Credit Card
Linked Entry = Chase Online Login
Linked Entry UUID = 12345

In my Template, I have Username, Password, and URL all listed, but the default values are Field References that use the selected UUID. In this case, 12345 - but since 12345 hasn't been selected when the New Entry was first created, we need a placeholder within the placeholder. Using the pictures below, prior to selecting a UUID in the new field type (that doesn't exist at the time of writing), my default values are simply:

  • {REF:U@I:{LinkedUUID}} for Username
  • {REF:P@I:{LinkedUUID}} for Password
  • {REF:A@I:{LinkedUUID}} for URL

Depending on how the functionality is implemented, {LinkedUUID} could be any "Field Name" that matched so that substitutions could be performed throughout the Template if a user wanted or needed.

See KeePass Field Refs for details on field references, but general format is - {REF:<WantedField>@<SearchIn>:<SearchValue>}

image

As I'm envisioning it, a trigger such as saving the entry would need to replace placeholders such as {LinkedUUID} with whatever value is in that field (e.g. 12345) so that the value stored in the true entry becomes {REF:U@I:12345} for the username, etc. There might be existing functionality in the XML Replacement that a coder could call into if needed, but I'm not a coder nor have I looked into that. It seems feasible that it could be hobbled together by an expert though.

@fakuivan
Copy link
Author

fakuivan commented Aug 21, 2021

@GraphiteWingedBird Thanks for expanding on this issue! What you described is exactly what I had in mind, a new field type that would prompt the user to select another entry on the database and then fill that field with the UUID of the selected entry.

@mitchcapper
Copy link
Owner

Sounds doable. I think I would do it like such:

A KeePass reference UUID Type in KPET
On the entry itself it would show the value when de-referenced in a grayed out textbox, and a button on the right that said "Sel" or something like that to allow you to re select what it was linked to. This would bring up the same UI dialog as keepass'es Tools -> insert field reference. Now I would normally just not re-invent the wheel and say always use the tools box to insert the reference, except it doesnt allow for custom fields for where to insert it. One limitation is you would not be able to select a custom field on a different entry that you are referencing, as the native KP UI picker doesn't have that capability.

I can't do the Open linked entry thing only because 1) it takes up valuable width 2) keepass isn't designed with the normal UI to have multiple entries opened at once. Yes there are plugins that can enable this, but I dont think I wold want to default the user into such ui.

Let me know thoughts.

@mitchcapper mitchcapper changed the title UUID Field Ability to reference another keepass entry's field (ie by uuid) Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants