Skip to main content

migrate_custom_api_keys_to_keyring

Function migrate_custom_api_keys_to_keyring 

Source
pub fn migrate_custom_api_keys_to_keyring(
    custom_api_keys: &BTreeMap<String, String>,
    mode: AuthCredentialsStoreMode,
) -> Result<BTreeMap<String, bool>>
Expand description

Migrate plain-text API keys from config to secure storage.

This function reads API keys from the provided BTreeMap and stores them securely using the specified storage mode. After migration, the keys should be removed from the config file.

§Arguments

  • custom_api_keys - Map of provider names to API keys (from config)
  • mode - The storage mode to use

§Returns

A map of providers that were successfully migrated (for tracking purposes)