-
Notifications
You must be signed in to change notification settings - Fork 324
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
change private key loading logic #3621
Conversation
blockchain/config.go
Outdated
@@ -25,6 +26,7 @@ import ( | |||
type ( | |||
// Config is the config struct for blockchain package | |||
Config struct { | |||
producerPrivKeyLoader sync.Once |
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.
defined but not used?
also, this can be outside of the Config
struct?
Codecov Report
@@ Coverage Diff @@
## master #3621 +/- ##
==========================================
- Coverage 75.43% 74.39% -1.04%
==========================================
Files 247 260 +13
Lines 22845 23581 +736
==========================================
+ Hits 17233 17543 +310
- Misses 4685 5109 +424
- Partials 927 929 +2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
case "hashiCorpVault": | ||
cli, err := newVaultClient(&pc.VaultConfig) | ||
yaml, err := config.NewYAML(config.Expand(os.LookupEnv), config.File(cfg.ProducerPrivKey)) |
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.
nit: cfg.ProducerPrivKey
can be a private key text (hex-string) or a filename (like "/var/data/vault.config", which could be a little confusing
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
PrivateKeyConfigFile
andProducerPrivKey
PrivateKeyConfigFileMethod
to blockchain.Config and rename it toProducerPrivKeySchema
ProducerPrivKey
according toProducerPrivKeySchema
blockchain.SetProducerPrivKey
being called multiple times.Fixes #(issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: