-
-
Notifications
You must be signed in to change notification settings - Fork 501
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-summon-provider outputs first line only #1652
Comments
Was it working before? I mean: putting a multiline text like the SSH key into an environment variable? Because, if
This is correctly multiline, while if I do
Then |
I guess @ckolumbus could help more than me here, as I am yet to use Summon. |
@OJFord I was going after the original
This lead me to the implementation of treating the first line as secret. And as @AnomalRoil do you have some exact details on how the 'secret' part is defined (differently) in |
@marco-m What you write is true (without some change to shell options), but seems unrelated to the reproduction steps I listed? @ckolumbus That is indeed 'one approach', though you could interpret that format itself (and I'm sure some tooling does) as being the first however many lines before one that matches
If you have a multiline secret, the scheme you describe makes it unrepresentable, which seems unfortunate. I do understand that you're trying to avoid a similar/opposite problem for people that use that multiple key/value pairs, key-less password on first line format though. Hmm. Maybe I start to realise why gopass introduced mime types! (Though I've had to disable it for now for not dissimilar reasons.) Personally I think the |
@OJFord I implemented the With this in mind I would not follow all So in order to provided a solution, IMHO we would need to answer the two questions
Any input on these? |
Exactly :-) This is what I meant :-) |
It seems that env var can work with multi-line variables: Now, I guess we should try to play with multi-line and Go's https://golang.org/pkg/os/#Setenv I took a look and the current code seems to just do:
So this become now a matter of "does gopass support multi-line key-value strings" and I don't think we do (yet?). Regarding your question, " do you have some exact details on how the 'secret' part is defined (differently) in gopass?", I'm afraid I'm not sure what it is you're asking. I would need to double check what happens is we don't have a Password key in the entry and mime is set to false... I'm not sure this is handled in a special way currently, so it might be an empty value. |
Ah, gotcha now, sorry marco-m. Well, actually the simplest way it works and comes in to play is with summon's temporary files - don't quote this syntax but off the top of my head Which is actually what I was trying to do here, (just simplified the reproduction for the issue) but the contents of the (plaintext) file was just the first line of the secret. |
I refreshed my knowledge of summon (I was a bit rusty) and I have to admit that @OJFord is spot on 100%. As @OJFord writes, summon can also take a secret from gopass and generate a temporary file. This is a very valid use case for SSH private keys (which are multilines). Currently, also the temporary file contains only the first line, so making gopass as summon provider only half-working. |
@marco-m full ack, also read the docs for summon and the original pass. To me, env vars were the main use case and I did not consider the One solution could be to control the single vs. multi line issue with an environment variable and also handle the AFAIK we cannot give command line parameters to summon providers to control this. I have to check. |
Another solution (which I personally would prefer) would be to treat everything "raw", as discussed in #1602. |
From https://cyberark.github.io/summon/#providers
So a summon secret is a raw sequence of bytes, no interpretation (which in my opinion is the right approach :-). Providers accept no flags. |
So, Mime is now out of the equation and parsing is disabled on input and can easily be disabled on output. What needs to be done here? |
This commit removes the binaries that were migrated to their dedicated git repos. Fixes gopasspw#1673 Fixes gopasspw#1649 Fixes gopasspw#1652 Fixes gopasspw#1631 Fixes gopasspw#1165 Fixes gopasspw#1711 Fixes gopasspw#1670 Fixes gopasspw#1639 Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
This commit removes the binaries that were migrated to their dedicated git repos. Fixes gopasspw#1673 Fixes gopasspw#1649 Fixes gopasspw#1652 Fixes gopasspw#1631 Fixes gopasspw#1165 Fixes gopasspw#1711 Fixes gopasspw#1670 Fixes gopasspw#1639 RELEASE_NOTES=[CLEANUP] Remove migrated binaries Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
This commit removes the binaries that were migrated to their dedicated git repos. Fixes gopasspw#1673 Fixes gopasspw#1649 Fixes gopasspw#1652 Fixes gopasspw#1631 Fixes gopasspw#1165 Fixes gopasspw#1711 Fixes gopasspw#1670 Fixes gopasspw#1639 RELEASE_NOTES=[CLEANUP] Remove migrated binaries Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
Summary
I wasn't aware until #1627 that I should be using
gopass-summon-provider
rather thangopass
directly withsummon
. Having resolved that, the output changed from multiline (preceded by the deprecation warning mentioned in that issue, that surely should be sent to stderr instead of stdout, and it wouldn't have been an issue anyway?) to first line only.Steps To Reproduce
echo -e '1\n2' | pass insert -m repro
summon --yaml='REPRO: !var repro' sh -c 'echo $REPRO'
Expected behavior
Well, this is debatable I suppose. I noticed it because I tried to use if for an SSH key, and I only got the '----BEGIN...' line.
I expected all of it.
Environment
community/gopass
Additional context
The text was updated successfully, but these errors were encountered: