From 015f23b9223014c942f3a951c1e9dca037932a2b Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Sat, 9 Nov 2024 12:51:41 +0000 Subject: [PATCH] feat: no longer using teh "hardcoded" api key --- src/common/wolves.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/common/wolves.rs b/src/common/wolves.rs index 7e29f1c..5a1e1b7 100644 --- a/src/common/wolves.rs +++ b/src/common/wolves.rs @@ -277,25 +277,24 @@ pub mod committees { }; let config = config_lock.read().await; - // TODO: proper api key management - let api_key = ""; // request data from wolves - for committee in get_committees(&config, api_key).await { - let tmp = Committees::from(committee); - add_committee(&db, &tmp).await; + for committee_wolves in get_committees(&config).await { + let committee = Committees::from(committee_wolves); + add_committee(&db, &committee).await; } } - async fn get_committees(config: &Config, wolves_api: &str) -> Vec { + async fn get_committees(config: &Config) -> Vec { if config.wolves_url.is_empty() { return vec![]; } // TODO: Change teh stored env value to teh base domain + // TODO: this address may change let url = format!("{}/get_cns", &config.wolves_url); // get wolves data - if let Ok(mut res) = surf::post(&url).header("X-AM-Identity", wolves_api).await { + if let Ok(mut res) = surf::post(&url).header("X-AM-Identity", &config.wolves_api).await { if let Ok(WolvesResult { success, result,