keyring-rs icon indicating copy to clipboard operation
keyring-rs copied to clipboard

Entry listing and searching

Open soywod opened this issue 10 months ago • 11 comments

First of all, thank you for this great crate!

Context

I am working on Pimalaya, a project that tries to improve open-source tools related to Personal Information Management. I try to design a lib built at the top of you keyring crate that would be a bit higher level (including caching with keyutils, prompt for passwords etc). I also plan to develop a CLI at top of my lib.

Issue

Your crate seems to be focused on Entry, which means you expose a get set and delete. But for the CLI I also need to list and search entries, is it sth you plan to expose as well? I can propose a draft if you are interested in.

soywod avatar Aug 16 '23 07:08 soywod

Hi Clément. This is an intriguing idea. Are you proposing to build search support into all of the underlying keystore implementations so that you can surface some sort of entry search? I would certainly be interested in seeing a PR for that!

brotskydotcom avatar Aug 19 '23 21:08 brotskydotcom

Are you proposing to build search support into all of the underlying keystore implementations so that you can surface some sort of entry search?

It does not mean to be complicated, just string matching could be enough. The list is more important, as it allows lib consumers to build their own search. My point was more to know if it fits your crate scope? If so then I can propose a PR for listing, then let's see for the search.

soywod avatar Aug 20 '23 05:08 soywod

Sorry for the late reply. I'd be very interested in seeing a PR that covers a listing in all platforms. I have consistently resisted the idea of adding any feature that only works on some platforms.

brotskydotcom avatar Aug 26 '23 16:08 brotskydotcom

I'd be very interested in seeing a PR that covers a listing in all platforms.

Alright then, I come back to you whenever I have something. It may be in few weeks, maybe months.

soywod avatar Aug 26 '23 20:08 soywod

I'd be very interested in seeing a PR that covers a listing in all platforms. Alright then, I come back to you whenever I have something. It may be in few weeks, maybe months.

Is there any progress to this? I would really want to use it!

Buckram123 avatar Feb 01 '24 15:02 Buckram123

Is there any progress to this? I would really want to use it!

I had no occasion to work on this yet, plans slightly changed from my side. I still keep the feature in mind If I find the time one day!

soywod avatar Feb 01 '24 21:02 soywod

I was also interested in this for a sort of passwordless login code format I had for an API of mine. I just wanted to check if the credential made by the app to store the login code existed. I have a working version to list target names in Windows, but want to make sure that's the goal of this before I try to make it work on other platforms. It's just a vector of strings that can be iterated to match a target name given by the client.

wiimmers avatar Apr 07 '24 05:04 wiimmers

It doesn't sound like you need any new features in the crate in order to do what you want. If you can iterate the possible credential names, then you can use the crate to check if a credential with that name exists, and get its password.

brotskydotcom avatar Apr 07 '24 21:04 brotskydotcom

Yes! I implemented, into the crate, a function called targets into the Entry struct. Then pointed to a default credential retriever function outside of the struct that points to the platform specific modules credential retriever (in my case, only Windows so far) and returns a list of all the targets in the store. I could be mistaken, but is this the feature looking to be added? Or is it a list of the whole entry; target, password, etc. and then a search function that we want? Thanks 👍🏻

wiimmers avatar Apr 07 '24 23:04 wiimmers

I think the feature that @soywod proposed was meant to be more of a general search feature, where one might (for example) be able to iterate over all entries currently in the store. There is no one currently working on this, as far as I know.

brotskydotcom avatar Apr 09 '24 20:04 brotskydotcom

Search feature #169 I've started a pull request for this feature, details can be found in the PR.

wiimmers avatar May 01 '24 15:05 wiimmers