Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gopass insert secret/that/exists key=value wants to overwrite password instead of just adding new key/value pair #1013

Closed
espoelstra opened this issue Dec 12, 2018 · 6 comments
Labels
documentation feature Enhancements and new features help-wanted
Milestone

Comments

@espoelstra
Copy link

Summary

When initially creating a secret with gopass generate secret/path/site username=someuser I properly get prompted for password parameters. When attempting to add a new key=value with gopass insert secret/path/site totp=totp://some/url/for/totp it wants to overwrite the password, not simply add the key/value pair. If I had instead done gopass generate secret/path/site newkey=newvalue I would expect it to keep the existing keys around (PATCH in REST-like terms instead of a REPLACE).

I see in #503 and #192 there was some work around the Yaml parsing, one added the --- separator that no longer appears to exist or be required? Not sure if any of those caused this weird behavior.

Expected behavior

I would expect to be able to add or replace key=value information via gopass insert or gopass generate (if I'm intentionally replacing a password AND maybe updating a "PIN" or something) without having to gopass edit secret/path/site and mess with the entry in a text editor.

Environment

  • OS: Mac OS X High Sierra
  • OS version: Darwin MN-C02VT1MAHTD8 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64 i386 MacBookPro14,3 Darwin
  • gopass Version: 1.8.2
  • Installation method: brew bottle
@dominikschulz dominikschulz added feature Enhancements and new features documentation labels Dec 22, 2018
@dominikschulz
Copy link
Member

dominikschulz commented Dec 22, 2018

You can update K/V entries using gopass entry key where you will be asked for the new value or gopass generate entry key where only the value of this key will be updated.

We can certainly consider adding this, if someone wants to work on it.

Edit: Actually key=value is supported for additional metadata.

@dominikschulz dominikschulz added this to the 1.x.x milestone Dec 22, 2018
@stale
Copy link

stale bot commented Mar 22, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 22, 2019
@stale stale bot closed this as completed Apr 21, 2019
@shibumi
Copy link
Contributor

shibumi commented Jul 21, 2019

@dominikschulz can you further explain what you mean with Edit: Actually key=value is supported for additional metadata? I want to add additional metadata to the key file without changing the password everytime. Any Idea?

EDIT: Ok seems like gopass insert <entry> <key> works, but it will have a prompt. Would be nice If I could pipe the new value into gopass.

@carnager
Copy link

carnager commented Jul 21, 2019

Want to add to this too. While it is possible to add stuff via stdin with echo "\nfoo: bar" | gopass insert -a entry I wouldn't consider this a nice solution since one has to take care of the yaml syntax manually.

@shibumi
Copy link
Contributor

shibumi commented Jul 21, 2019

Ok, the following works:

printf "test" | gopass insert <entry> <key>

@carnager
Copy link

Ok, the following works:

printf "test" | gopass insert <entry> <key>

Ah yes, that's actually kind of good enough 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation feature Enhancements and new features help-wanted
Projects
None yet
Development

No branches or pull requests

4 participants