feat: Add support to parse a SecretStore as a struct using the config crate
Description of change
The config crate is pretty standard nowadays on the Rust community to parse configuration files to a Rust type.
I didn't want to fetch one by one the secrets from the SecretStore manually since the config crate does that automatically and I figured out a way to pass the contents of the SecretStore as an Environment source to the ConfigBuilder as explained here.
How has this been tested? (if applicable)
I use this implementation locally on my production software.
I wanted to implement the From crate for any T that implement DeserializeOwned but Rust doesn't allow to implement a foreign trait to a foreign type so I guess I should create some sort of wrapper around T
Probably a proper thing to do could be to implement Deserialize on the SecretsStore to a NewType SecretsConfig that contains T
Thanks for the suggestion! We will consider adding support for more opinionated ways of secrets/env loading like this one in a future update. In that case it can probably be built in without a feature flag. Will leave this PR open to keep the idea alive. More discussions can be found in #1571.