Skip to main content

Module credentials

Module credentials 

Source
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§

CredentialStorage
Generic credential storage interface.
CustomApiKeyStorage
Custom API Key storage for provider-specific keys.

Enums§

AuthCredentialsStoreMode
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.