pub struct KeychainConfig {
pub backend: Option<String>,
pub file_path: Option<PathBuf>,
pub passphrase: Option<String>,
}Expand description
Keychain backend configuration, typically sourced from environment variables.
Use KeychainConfig::from_env() at process boundaries (CLI entry point, FFI
call sites) and then thread the value through the call graph.
Debug output redacts the passphrase field to prevent accidental log leakage.
Fields§
§backend: Option<String>Override for the keychain backend (AUTHS_KEYCHAIN_BACKEND).
Supported values: "file", "memory".
file_path: Option<PathBuf>Override for the encrypted-file storage path (AUTHS_KEYCHAIN_FILE).
passphrase: Option<String>Passphrase for the encrypted-file backend (AUTHS_PASSPHRASE).
Implementations§
Source§impl KeychainConfig
impl KeychainConfig
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Build a KeychainConfig from the process environment.
Reads AUTHS_KEYCHAIN_BACKEND, AUTHS_KEYCHAIN_FILE, and AUTHS_PASSPHRASE.
Call once at the process/FFI boundary; pass the result into subsystems.
Usage:
ⓘ
let config = KeychainConfig::from_env();
let keychain = get_platform_keychain_with_config(&EnvironmentConfig { keychain: config, ..Default::default() })?;Trait Implementations§
Source§impl Clone for KeychainConfig
impl Clone for KeychainConfig
Source§fn clone(&self) -> KeychainConfig
fn clone(&self) -> KeychainConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KeychainConfig
impl Debug for KeychainConfig
Source§impl Default for KeychainConfig
impl Default for KeychainConfig
Source§fn default() -> KeychainConfig
fn default() -> KeychainConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for KeychainConfig
impl RefUnwindSafe for KeychainConfig
impl Send for KeychainConfig
impl Sync for KeychainConfig
impl Unpin for KeychainConfig
impl UnsafeUnpin for KeychainConfig
impl UnwindSafe for KeychainConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more