mattydebie / bitwarden-rofi

Wrapper for Bitwarden https://github.com/bitwarden/cli and Rofi
GNU General Public License v3.0
351 stars 57 forks source link

Add caching of items to reduce loading time #61

Closed moukle closed 1 year ago

moukle commented 3 years ago

Adresses issue #51: went from ~1.09sto ~0.31s for me.

Some comments:

mattydebie commented 3 years ago

This is looking good! I have one question however, why did you decide to move the cache file from ~/.cache to /tmp?

moukle commented 3 years ago

Glad you like!

I moved to /tmp/ in order to make the encrypted logins more temporary. Once you logout of bwmenu, the BW_HASH is unusable for bwmenu itself. But with access to the logins.gpg would still yield great danger. This is not solved, by moving to /tmp but a little better. Ideally the logins.gpg should be safely shred after logout?

I'm not sure if this is really an issue. If an attacker has access to the BW_HASH, he prolly has already serious control.


Edit: My first approach was to only store the item names without the passwords. Then I would load the item names and load_items() & in subshell. However I didn't find a satisfying solution to access the items again in the original shell, without some FIFO or such. Thus I opted for the login.gpg. It could be solved with more powerful threading options, which bash doesn't offer I think.

jakobkukla commented 3 years ago

Is there anything preventing you from merging this? I tested it out and the improvement in loading times is great :)

moukle commented 3 years ago

Sorry, did some Git wobbling :grin:

AlecsFerra commented 3 years ago

Bump

mattydebie commented 1 year ago

Thanks again! This is an awesome improvement to the speed. merge in 61a9e68