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

Exclude stderr from parsing on decryption success #647

Merged
merged 1 commit into from
Nov 29, 2019
Merged

Conversation

KnVerey
Copy link
Contributor

@KnVerey KnVerey commented Nov 28, 2019

What are you trying to accomplish with this PR?

Fixes #643. The underlying problem seems to be that we're reading stdout and stderr together. There are cases when successful ejson decryption returns both a warning (on stderr) and the result (on stdout), so unsurprisingly the combination of the two cannot be parsed. The reason we were doing this is because older versions of ejson printed many (all?) errors to stdout. Shopify/ejson#44 fixed this in version 1.2, but I'd prefer to continue supporting ejson 1.0, to avoid subjecting ruby consumers to dependency conflicts.

How is this accomplished?
Read stdout and stderr separately, but if decryption failed, manually check stdout for the error message to accommodate older ejson versions.

What could go wrong?
If ever ejson exits non-zero yet prints something decrypted to either stream, we'll also print it. This would not be new, however, and I've never heard a report of it happening.

lib/krane/ejson_secret_provisioner.rb Outdated Show resolved Hide resolved
@KnVerey KnVerey merged commit c39adf5 into master Nov 29, 2019
@KnVerey KnVerey deleted the ejson_stdout branch November 29, 2019 18:45
@RyanBrushett RyanBrushett temporarily deployed to rubygems December 12, 2019 21:05 Inactive
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

Successfully merging this pull request may close these issues.

secrets decrypting only works if krane is installed via bundler
4 participants