Expand description
Generic credential storage with OS keyring and file-based backends.
This module provides a unified interface for storing sensitive credentials securely using the OS keyring (macOS Keychain, Windows Credential Manager, Linux Secret Service) with fallback to AES-256-GCM encrypted files.
§Usage
use vtcode_config::auth::credentials::{CredentialStorage, AuthCredentialsStoreMode};
// Store a credential using the default mode (keyring)
let storage = CredentialStorage::new("my_app", "api_key");
storage.store("secret_api_key")?;
// Retrieve the credential
if let Some(value) = storage.load()? {
println!("Found credential: {}", value);
}
// Delete the credential
storage.clear()?;Structs§
- Credential
Storage - Generic credential storage interface.
- Custom
ApiKey Storage - Custom API Key storage for provider-specific keys.
Enums§
- Auth
Credentials Store Mode - Preferred storage backend for credentials.
Functions§
- clear_
custom_ api_ keys - Clear all custom API keys from secure storage.
- load_
custom_ api_ keys - Load all custom API keys from secure storage.
- migrate_
custom_ api_ keys_ to_ keyring - Migrate plain-text API keys from config to secure storage.