pub struct CredentialStore { /* private fields */ }Expand description
Credential store abstraction
Implementations§
Source§impl CredentialStore
impl CredentialStore
Sourcepub fn store_credential(&self, key: &str, value: &str) -> Result<String>
pub fn store_credential(&self, key: &str, value: &str) -> Result<String>
Store a credential value
Sourcepub fn get_credential(
&self,
value: &str,
env_var: Option<&str>,
) -> Result<String>
pub fn get_credential( &self, value: &str, env_var: Option<&str>, ) -> Result<String>
Retrieve a credential value
Resolution order:
- Check environment variable (if env_var provided)
- If value starts with “keyring:”, retrieve from keyring
- Otherwise, return the value as-is (plaintext)
Sourcepub fn delete_credential(&self, key: &str) -> Result<()>
pub fn delete_credential(&self, key: &str) -> Result<()>
Delete a credential from storage
Sourcepub fn is_keyring_reference(value: &str) -> bool
pub fn is_keyring_reference(value: &str) -> bool
Check if a value is a keyring reference
Sourcepub fn storage_backend(&self) -> &str
pub fn storage_backend(&self) -> &str
Get the current storage backend