Repository navigation
stratify 0.3.0
First public release. Continues the unpublished configkit under a name that is
available on crates.io and describes the crate rather than padding it.
Added
- Azure App Configuration source, behind the
azurefeature. The caller supplies
the credential rather than the crate choosing one, so a service can use a managed
identity in Azure and a developer credential locally. That keepsazure_identity
out of this crate's dependency tree and lets the source be tested against a fake.
Supports@nextLinkpagination, an optional label filter, and theDatabase:Host
key convention. ConfigBuilder::azurefor the same, in the fluent style.#![forbid(unsafe_code)].
Changed
- Breaking:
Source::loadis nowasync. Implementations declare
#[async_trait], andConfigBuilder::buildandConfigStore::refreshare
awaited. Network-backed sources should not block a runtime thread, and the
synchronous trait left no way to use an async SDK without blocking inside a
runtime, which panics. - Replaced
serde_yamlwithserde_norway.serde_yamlis officially deprecated
and should not be a dependency of a published crate. toml0.8 to 1.- Key nesting is shared between the environment and Azure sources rather than
duplicated in each.
Migration from configkit 0.2
-let store = ConfigBuilder::default().json("base.json", 100).build()?;
+let store = ConfigBuilder::default().json("base.json", 100).build().await?;For a custom source, add the attribute and the keyword:
+#[async_trait::async_trait]
impl Source for MySource {
- fn load(&self) -> Result<Value, ConfigError> { ... }
+ async fn load(&self) -> Result<Value, ConfigError> { ... }
}