[pass][new feature] item information

Lucas Hoffmann l-m-h at web.de
Sat Dec 31 11:26:09 CET 2016


Quoting Vahid Ma'ani (2016-12-31 06:41:39)
> My name is vahid (vahit is my nickname), i'm a gnu/linux sysadmin and i
> use pass to save my service and server's login information. But some times
> i forget which service is on which server, for this reason i develop new
> version of pass.

I think you might be able to do the same with `pass grep`.  So it might
not really be necessary to add a new feature.

One of my files in .password-store might look like this:
> secret-password
> site: www.example.com
> login: foo.bar.example.com/login.php
> user: Lucas42
> info: foobar
> somemoreinfo: bla bla

Now I can `pass grep foobar` or `pass grep bla` or whatever I remember
from that file and pass will find the file for me.

> In this version a new option is added which can be used to add description
> for each items, it helps use to find the needed item in future usage
> easily. The information of each item is stored in text file which name is
> info.txt and stored in the same path. A function, which name is
> cmd_search, is added to the pass. The function search for the user
> received phrase through all info.txt files which exits in
> ".password-store" path, then by using cmd_find function, the intended
> items will be listed.

The advantage of my solution above is that all additional info is also
encrypted.  If you want the password of the matching entries to be
displayed directly you might need some manual scripting because the
`pass grep` command is not very scriptable.  But something like this
might do it:

pass grep foo | \
  sed -r -e '/:$/!d' \
         -e "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?m//g" \
	 -e 's/:$//' | \
  while read line; do
    if [ -e "${PASSWORD_STORE_DIR:-~/.password-store}/$line.gpg" ]; then
      echo
      pass show "$line"
    fi
  done

Cheers
Lucas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: signature
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20161231/296c727c/attachment-0001.asc>


More information about the Password-Store mailing list