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 show -o shows unexpected warning #1961

Closed
mcnesium opened this issue Jul 8, 2021 · 3 comments · Fixed by #2245
Closed

gopass show -o shows unexpected warning #1961

mcnesium opened this issue Jul 8, 2021 · 3 comments · Fixed by #2245
Labels
ux User experience / User Interface related
Milestone

Comments

@mcnesium
Copy link

mcnesium commented Jul 8, 2021

gopass still shows warnings, when passing the -o flag to gopass show:

correct and expected behavior:

gopass some/thing
⚠ some/thing is a secret and a folder. Use 'gopass show some/thing' to display the secret and 'gopass list some/thing' to show the content of the folder
Secret: some/thing

612709qBg2rCkQckzy9pxwRNz80tglG

imho unnecessary but i guess acceptable behavior:

gopass show some/thing
⚠ some/thing is a secret and a folder. Use 'gopass show some/thing' to display the secret and 'gopass list some/thing' to show the content of the folder
Secret: some/thing

612709qBg2rCkQckzy9pxwRNz80tglG

note: the warning does not appear when using gopass list. intended behavior?

gopass list some/thing
some/thing/
├── api_key
└── api_secret

unexpected behavior:

gopass show -o some/thing
⚠ some/thing is a secret and a folder. Use 'gopass show some/thing' to display the secret and 'gopass list some/thing' to show the content of the folder
612709qBg2rCkQckzy9pxwRNz80tglG

gopass help show | grep -- -o
   --password, -o             Display only the password. Takes precedence over all other flags. (default: false)

This gopass is installed from Manjaro community repo:

gopass --version
gopass 1.12.6 (2021-05-11 15:27:04) go1.16.4 linux amd64
@AnomalRoil AnomalRoil added the ux User experience / User Interface related label Jul 9, 2021
@AnomalRoil AnomalRoil added this to the 1.13.0 milestone Jul 9, 2021
@roalcantara
Copy link

roalcantara commented Sep 28, 2021

Same here!

Summary

What is the proper approach to store "nested secrets"?

Steps To Reproduce

Given the following environment

$ gopass --version
  gopass 1.12.8 (2021-08-28 17:36:37) go1.17 darwin amd64

$ gopass-jsonapi --version
  gopass-jsonapi version 1.11.1

And I have stored a password

$ gopass insert leaf.jp/naruto
  Enter password for leaf.jp/naruto: *****
  Confirmg password for leaf.jp/naruto: *****

And I also have stored a memorable pin into the same secret

$ gopass generate --clip --generator memorable leaf.jp/naruto/pin 6

When I show the entry I then receive the following warning

$ gopass show -n leaf.jp/naruto
  ⚠ leaf.jp/naruto is a secret and a folder. Use 'gopass show leaf.jp/naruto' to display the secret and 'gopass list leaf.jp/naruto' to show the content of the folder

  Secret: leaf.jp/naruto

And when I reveal the password then I receive the same warning

$ gopass -o leaf.jp/naruto
  ⚠ leaf.jp/naruto is a secret and a folder. Use 'gopass show leaf.jp/naruto' to display the secret and 'gopass list leaf.jp/naruto' to show the content of the folder

  dattebayo

But I can reveal the memorable pin with no issues

$ gopass -o leaf.jp/naruto/pin
  oro!!!

Also, Gopass Bridge seems to only recognize the deepest secret 😓

Screen Shot 2021-09-28 at 1 47 02 AM

Environment

$ uname -a
  Darwin Rogerios-MBP 20.6.0 Darwin Kernel Version 20.6.0

$ brew install gopass
$ brew install gopass-jsonapi

Additional context

I wasn't able to find any hints on the docs so far. :(

Excellent job, btw! I wish I could build something 10% as cool as this! 🤩

@AnomalRoil AnomalRoil modified the milestones: 1.13.0, 1.14.0 Feb 28, 2022
@AnomalRoil
Copy link
Member

@roalcantara The proper way to store a "pin" in an entry is to rely on key-values:

$ gopass generate --clip --generator memorable leaf.jp/naruto 20

$ gopass generate --clip --generator memorable leaf.jp/naruto pin 6

$ gopass show -f leaf.jp/naruto
Secret: leaf.jp/naruto

hollow5deliver5shoe2
pin: extra4

$ gopass show -f leaf.jp/naruto pin
Secret: leaf.jp/naruto
Key: pin

extra4

Notice the way I use a space to add a key to an entry:

gopass generate --clip --generator memorable leaf.jp/naruto pin 6

This adds a key "pin" to the entry "leaf.jp/naruto", whereas what you are doing is creating a new entry "leaf.jp/naruto/pin" in the folder "leaf.jp/naruto" while there already is an existing entry "leaf.jp/naruto" as well.
See maybe also the documentation:

This should works as expected in theory with the bridge and everything.

@mcnesium I can still reprodruce the issue with -o showing the warning, will look into that.

@dominikschulz dominikschulz modified the milestones: 1.14.0, 1.x.x Mar 12, 2022
AnomalRoil added a commit that referenced this issue May 30, 2022
RELEASE_NOTES=[BUGFIX] Removing shadowing warning when using -o/--password

Fixes #1961

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>
AnomalRoil added a commit that referenced this issue May 30, 2022
RELEASE_NOTES=[BUGFIX] Removing shadowing warning when using -o/--password

Fixing linter too

Fixes #1961

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>
dominikschulz pushed a commit that referenced this issue May 31, 2022
RELEASE_NOTES=[BUGFIX] Removing shadowing warning when using -o/--password

Fixing linter too

Fixes #1961

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>
@mcnesium
Copy link
Author

Thanks for fixing 👍

kpitt pushed a commit to kpitt/gopass that referenced this issue Jul 21, 2022
RELEASE_NOTES=[BUGFIX] Removing shadowing warning when using -o/--password

Fixing linter too

Fixes gopasspw#1961

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ux User experience / User Interface related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants