getfrompass
A thin wrapper around the Pass password manager for Rust programs.
Secrets returned by read functions are wrapped in Zeroizing and zeroed from memory when dropped.
Installation
cargo add getfrompass
Requirements
Pass and GnuPG must be installed and Pass must be initialised with your GPG key.
sudo apt-get install -y pass gnupg
pass init your_gpg_key_id
Usage
Reading a secret
use try_get_from_pass;
Returns Option<Zeroizing<String>>. Zeroizing<String> behaves like String in most contexts via Deref, so existing code rarely needs changes. If you need an explicit type annotation, add zeroize as a dependency (cargo add zeroize).
If you'd rather panic on a missing key, get_from_pass does that.
Storing a known value
use store_in_pass;
To overwrite an existing entry, use force_store_in_pass.
Generating a random password
use insert_to_pass;
Deleting an entry
use remove_from_pass;
This deletes without confirmation.