AppConfigSecurityExt

Trait AppConfigSecurityExt 

Source
pub trait AppConfigSecurityExt: Sized {
Show 15 methods // Required methods fn load() -> Self; fn load_async() -> impl Future<Output = Self> + Send; fn save_to_path(&self, path: impl AsRef<Path>) -> Result<()>; fn save(&self) -> Result<()>; fn save_async(&self) -> impl Future<Output = Result<()>> + Send; fn save_to_path_async( &self, path: impl AsRef<Path> + Send, ) -> impl Future<Output = Result<()>> + Send; fn load_with_env() -> Self; fn load_with_env_async() -> impl Future<Output = Self> + Send; fn sanitize_secrets(&mut self); fn api_key_keychain_status() -> Vec<(&'static str, bool)>; fn has_plaintext_secrets(&self) -> bool; fn hydrate_secrets_sync(&mut self) -> Result<()>; fn hydrate_secrets(&mut self) -> impl Future<Output = Result<()>> + Send; fn migrate_secrets_sync(&self) -> Result<bool>; fn migrate_secrets(&self) -> impl Future<Output = Result<bool>> + Send;
}
Expand description

Extension trait adding security-dependent methods to AppConfig.

Import this trait (or use crate::config::*) to access load(), save(), keychain hydration, and secret migration methods on AppConfig.

Required Methods§

Source

fn load() -> Self

Load configuration from disk, falling back to defaults if missing (sync).

Source

fn load_async() -> impl Future<Output = Self> + Send

Load configuration from disk asynchronously.

Source

fn save_to_path(&self, path: impl AsRef<Path>) -> Result<()>

Save configuration to disk at an explicit path.

Source

fn save(&self) -> Result<()>

Save configuration to disk (sync).

Source

fn save_async(&self) -> impl Future<Output = Result<()>> + Send

Save configuration to disk asynchronously.

Source

fn save_to_path_async( &self, path: impl AsRef<Path> + Send, ) -> impl Future<Output = Result<()>> + Send

Save configuration to disk at an explicit path (async).

Source

fn load_with_env() -> Self

Load configuration with environment variable overrides applied.

Source

fn load_with_env_async() -> impl Future<Output = Self> + Send

Load configuration asynchronously with environment variable overrides.

Source

fn sanitize_secrets(&mut self)

Clear secrets from the struct (used before saving to disk).

Source

fn api_key_keychain_status() -> Vec<(&'static str, bool)>

Check which API key providers have secrets stored in the OS keychain.

Source

fn has_plaintext_secrets(&self) -> bool

Returns true if the config struct currently contains any plaintext secrets.

Source

fn hydrate_secrets_sync(&mut self) -> Result<()>

Load secrets from keystore into the struct (sync).

Source

fn hydrate_secrets(&mut self) -> impl Future<Output = Result<()>> + Send

Async version of hydrate secrets.

Source

fn migrate_secrets_sync(&self) -> Result<bool>

Move secrets from the struct (if present) to the keychain (sync).

Source

fn migrate_secrets(&self) -> impl Future<Output = Result<bool>> + Send

Async version of migrate secrets.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§