Get username from a certain line number without a prefix
lelutin opened this issue · 2 comments
Hi there,
I tend to keep usernames as the only thing on a line (as though they were a password but on another line than the first one). this lets me use a feature in pass 1.7+ where I can get the contents of any line with "-cN".
because of this browserpass currently doesn't work for me.
I'm wondering if it could be possible to add a feature to browserpass to obtain the username as a certain (configured) line number without any prefix on the line. with this I could use this plugin and continue organising passwords as I currently do.
I dislike like this suggestion, because it complicates the UX in ways that can lead to troubling consequences. In particular, it increases the chance of a user misconfiguring it, and then having sensitive data submitted someplace where it has no business being (e.g. a password or a credit card number submitted into a username / name field, which then ends up in all sorts of logs). The risk profiles of browserpass and pass are not the same either.
My initial inclination is to refuse to implement this, in the interests of protecting users from human error.
@maximbaz - what do you think?
I agree, this is very prone to error, we won't be implementing this.
If it's any consolation, we'll have #289, in case your username is often identical for many entries.
Alternatively, I recommend converting the format of your pass entries to have user:
prefix and creating an extension for pass
that will copy username (read about PASSWORD_STORE_ENABLE_EXTENSIONS
in manual).
This would be my suggestion:
~/.password-store/.extensions/u.bash
:
#!/bin/bash
pass $1 | grep 'user:' | awk '{print $2 }' | xclip -selection clipboard
This allows to copy username by typing pass u github.com
, which is even shorter than typing pass -c2 github.com
😉