Make it easier to merge configuration into config at runtime
See original GitHub issueContext
Related #13952
We’re experimenting with different ways to satisfy security requirements for one of our clients, where they’re not allowed to use environment variables to store secrets. We tried a bunch of different approaches; one of them is to load secrets before reading configs and merging them into configuration. This proved surprisingly difficult. We tried to modify main()
in packages/backend/src/index.ts
to read secrets before calling loadBackendConfig,
but we couldn’t figure out the right way to load those values into the config object.
Feature Suggestion
Provide an API to merge or derive a config object by merging a POJO into a config.
Possible Implementation
Something like this would be great,
const static = await loadBackendConfig({
argv: process.argv,
logger,
});
const config = static.merge({
backend: {
database: {
password: await readFromSecretStore('db_password')
}
}
})
Is this possible?
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Merging runtime-created section config with system config
The sample code goes on to merge the created configuration info with an empty DictionaryConfigurationSource. I, however, need to merge it with the...
Read more >[RFC] Better way to override Backstage's configuration from a ...
Need A way to dynamically override the configuration of Backstage ... config would be merged into a singe config if it was simple...
Read more >Configuring Services Using Configuration Files - WCF
Behavior merge works in the IIS hosting environment, in which Web.config files merge hierarchically with the root Web.config file and machine.
Read more >Elixir 1.9 Configuration Merging - Stratus3D
Config.Reader recursively merges the configurations in order until they are all combined. The first config call defines the base configuration.
Read more >Providing environment specific configuration for JavaScript ...
Using React, we want to minify and combine all of our application files into a single JavaScript file to optimize the run-time experience....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have recently also seen companies frown upon secrets in configs via environment variables - they are so peculiar about their own secret managers, and want to use that only. So +1 to updating configs during runtime or #13952. 😃
@shailendra-ahir-cbre There’s a “Subscribe” button in the right sidebar for that purpose.