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
Allow wallet passphrases to be environment variables #5879
Allow wallet passphrases to be environment variables #5879
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5879 +/- ##
==========================================
+ Coverage 59.97% 60.20% +0.22%
==========================================
Files 314 313 -1
Lines 26712 26493 -219
==========================================
- Hits 16021 15950 -71
+ Misses 8510 8380 -130
+ Partials 2181 2163 -18 |
validator/keymanager/wallet_test.go
Outdated
} | ||
}() | ||
|
||
if err := os.Setenv("NEITHER", "neither"); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you unset the environment variables after the test is done ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, added. Also altered the names to use a test-specific prefix to avoid any chance of clash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What type of PR is this?
Feature
What does this PR do? Why is it needed?
The wallet keymanager allows passphrases to be stored in a JSON file, however some configurations do better with sensitive data injected through environment variables. This PR attempts to interpolate passphrases starting with the '$' character as environment variables, allowing for this configuration without losing the use of the JSON file.