use super::manager::ConfigManager;
pub fn resolve_api_key(explicit: Option<&str>, config_mgr: &ConfigManager) -> Option<String> {
if let Some(key) = explicit {
if !key.is_empty() {
return Some(key.to_string());
}
}
if let Ok(key) = std::env::var("ZILLIZ_API_KEY") {
if !key.is_empty() {
return Some(key);
}
}
config_mgr.get_credential("api_key")
}