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

Argument order for --decrypt #598

Open
heydonovan opened this issue Dec 20, 2019 · 4 comments
Open

Argument order for --decrypt #598

heydonovan opened this issue Dec 20, 2019 · 4 comments

Comments

@heydonovan
Copy link

It took me a while to figure this out, but should argument order matter here? 🤔

$ sops -d secrets.yaml
envSecrets:
    deploy-key: 12345

$ sops -d secrets.yaml --extract '["envSecrets"]["deploy-key"]'
envSecrets:
    deploy-key: 12345

$ sops -d --extract '["envSecrets"]["deploy-key"]' secrets.yaml
12345
@autrilla
Copy link
Contributor

autrilla commented Dec 20, 2019 via email

@patricknelson
Copy link

I think this should be detected and fail in case any parameters are passed after the file name.

The reason why: I was also stuck on this for a bit until I realized my parameter order was incorrect. I found this issue since I accidentally used the same order as @heydonovan sops -d secrets.yaml --extract '["envSecrets"]["deploy-key"]'. Since it didn't fail, it took too long assuming maybe my --extract syntax was invalid. Only once you fix the order to sops -d --extract '["envSecrets"]["deploy-key"]' secrets.yaml will it begin to only only extract the specified key, but also notify that the key is valid or not.

Should we open a new issue? Is that a bug or considered expected behavior?

@autrilla
Copy link
Contributor

It's the same issue. It's considered a bug, and we definitely will welcome PRs that fix it, but it's a tricky one, since it'll affect lots of things and therefore will require some evidence that nothing was broken because of it.

@felixfontein felixfontein changed the title Argument order for --extract Argument order for --decrypt Aug 23, 2023
@felixfontein
Copy link
Contributor

#1342 improves the situation by at least warning when this happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants