[pass] [PATCH] Added functionality to retrieve username from a password file and copy to clipboard.

ged at qube.io ged at qube.io
Tue Oct 9 19:37:37 CEST 2012


On Tue, Oct 09, 2012 at 11:45:11AM +0200, Jason A. Donenfeld wrote:
> On Sun, Oct 7, 2012 at 9:35 PM, ged <ged at qube.io> wrote:
> > This requires a multiline password file with a line for the user as follows:
> >
> > user: FredFlintstone
> >
> > Case is ignored. Field seperator is ": " and everything after the field seperator is treated as the username.
> >
> 
> Hi Ged,
> 
> Generally, we're trying to keep pass schema-less, per the discussion
> here [1]. First we start with --username, then we add --email, and
> then we add --website, and before you know it, we're totally out of
> control.
> 
> I could imagine a more general key-value system, deliminated by the
> colon, but you already get key-value via the directory structure /
> file name correspondence.
> 
> I think what I'd suggest for this patch is to just use a bash function
> if you want that functionality.
> 
> passuser() { pass "$@" | grep "User:" | cut -d : -f 2 | xclip...
> 
> Either that, or use the directory structure key-value system suggested in [1].
> 
> Jason
> 
> 
> [1] http://zx2c4.com/projects/password-store/#organization


Hi Jason,

I understand your schema-less approach but doesn't that have the potential to 
restrict the power of the script?  At the moment the only thing that 
your script does with the information stored in the encrytped file is to either
a) display the entire file or b) copy the first line to the clipboard.  

Is it necessarily a bad thing to be able to extract a username, email address or 
web site from the password store?  It would require a schema of some type 
which is of course a form of complication.  Possibly you could support a small set 
of simple schemas (for example "no-schema", "multiline", "folder" and "multiline
key/value") with the user specifying in a config file which schema to use? 

Nice script by the way. I had been thinking along similar lines but hadn't got 
round to writing any actual code.  I have it running successfully on Debian and 
OX X (Mountain Lion) systems.  

Ged



More information about the Password-Store mailing list