keepassxreboot / keepassxc

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

Cross-Reference short-hand for Additional Attributes #9152

Open tkapias opened 1 year ago

tkapias commented 1 year ago

Summary

Currently the Cross-Reference short-hand syntax does not provide a way search an entry by UUID and to select its Additional Attribute by name.

Current documentation: Entry Cross-Reference.

Examples

I propose to add one more field in the short-hand to allow searching for a title in the Additional Attributes. Example: {REF:O:addattribute1@I:033054D445C648C59092CC1D661B1B71}

It would return the content of the Additional Attribute.

Example of documentation updated:

#Entry Cross-Reference

- A reference to another entry’s field is possible using the short-hand syntax: `{REF:<FIELD>:<SEARCH_TITLE>@<SEARCH_IN>:<SEARCH_TEXT>}`

- `<FIELD>` and `<SEARCH_IN>` can be one of following:

    * T - Title

    * U - Username

    * P - Password

    * A - URL

    * N - Notes

    * I - UUID (found on entry properties page)

    * O - Custom Attribute (SEARCH_IN and SEARCH_TITLE only)

## Examples:
`{REF:U@I:033054D445C648C59092CC1D661B1B71}`
`{REF:O:addattribute1@I:033054D445C648C59092CC1D661B1B71}`
`{REF:P@T:Other Entry}`
`{REF:A@O:Attribute 1}`

Context

I use Python-Keyring to fetch passwords or tokens from the command line or from some scripts through the Secret Service Agent. And I link the Secret Service entries to the original entry with Cross-References. Sometimes I have multiple tokens for a user inside the same entry. I would like to Cross-Reference the Additional Attributes for those.

droidmonkey commented 1 year ago

This syntax is provided by KeePass original

tkapias commented 1 year ago

How ?

tkapias commented 1 year ago

More specifically, how do I cross-reference the additional attribute of an entry by the UID of the entry and the title of the additional attribute?

solifice commented 1 year ago

More specifically, how do I cross-reference the additional attribute of an entry by the UID of the entry and the title of the additional attribute?

This is the limitation from Keepass side, You can't retrieve the data of additional attributes from an entry. You can only retrieve the standard ones only that is Title, Username, Password, URL, UUID and Notes.

I also need this feature badly too but sadly, its not there. As far as I know there is issue raised in Keepass sourceforge site and its open from 5 to 6 years.

droidmonkey commented 1 year ago

I'm willing to implement your proposal but it won't work in other apps like KeePassDX, Strongbox, or KeePass original. If that is OK with you than it really doesn't matter. Another problem with custom attributes is that their name can, and do, contain colons... this will pose a parsing problem and limitation on use.

tkapias commented 1 year ago

Thank you @droidmonkey !

Although I use KeepassDX on Android, my use which is to reference tokens for the secret agent does not apply on Android. And Keepass original, it's only interesting for its multiple extensions but not native on Linux so I'll never come back to it.

I think many KeepassXC users are in my case.

Concerning the parsing there can be other limits if you do it like my model since the text string to search is before the @ and the title of an attribute can contain it too. But you can indicate naming constraints for the attributes for those who want to use this feature.

The absence of the feature bothers me more than this kind of constraints.

solifice commented 1 year ago

I'm willing to implement your proposal but it won't work in other apps like KeePassDX, Strongbox, or KeePass original. If that is OK with you than it really doesn't matter. Another problem with custom attributes is that their name can, and do, contain colons... this will pose a parsing problem and limitation on use.

Thanks @droidmonkey if you can provide this feature for XC that will be very helpful for me. I think if this feature comes in XC. I can raise ticket for this in KeepassDX Repo.

MaxBQb commented 3 months ago

@droidmonkey, Any updates?

droidmonkey commented 3 months ago

This isn't high on the list tbh. References in KeePassXC were coded very... interestingly... from way back when. I would want to add this capability with a general rewrite to that code handling.