pub struct EnvVarStore { /* private fields */ }Expand description
Environment-variable-backed credential store.
Resolves secrets by name through std::env::var (or an injected
reader, for testing). Used as the CI / Docker fallback when the OS
keychain is unavailable.
Implementations§
Source§impl EnvVarStore
impl EnvVarStore
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new environment variable store with default settings.
Uses DEVBOY_ prefix and enables fallback to unprefixed variables.
Sourcepub fn with_prefix(prefix: impl Into<String>) -> Self
pub fn with_prefix(prefix: impl Into<String>) -> Self
Sourcepub fn without_fallback(self) -> Self
pub fn without_fallback(self) -> Self
Disable fallback to unprefixed environment variables.
When disabled, only {PREFIX}_{KEY} format is checked.
Trait Implementations§
Source§impl CredentialStore for EnvVarStore
impl CredentialStore for EnvVarStore
Source§fn store(&self, _key: &str, _value: &SecretString) -> Result<()>
fn store(&self, _key: &str, _value: &SecretString) -> Result<()>
Store a credential securely. Read more
Source§fn get(&self, key: &str) -> Result<Option<SecretString>>
fn get(&self, key: &str) -> Result<Option<SecretString>>
Retrieve a stored credential. Read more
Source§fn is_writable(&self) -> bool
fn is_writable(&self) -> bool
Check if this store supports write operations. Read more
Source§fn is_available(&self) -> bool
fn is_available(&self) -> bool
Check if this credential store is available and functional. Read more
Source§impl Debug for EnvVarStore
impl Debug for EnvVarStore
Auto Trait Implementations§
impl Freeze for EnvVarStore
impl RefUnwindSafe for EnvVarStore
impl Send for EnvVarStore
impl Sync for EnvVarStore
impl Unpin for EnvVarStore
impl UnsafeUnpin for EnvVarStore
impl UnwindSafe for EnvVarStore
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