refactor: kms decrypt analytics config (#3984)

This commit is contained in:
Chethan Rao
2024-03-06 18:11:17 +05:30
committed by GitHub
parent 34c1b905b1
commit cfade55e69
6 changed files with 66 additions and 5 deletions

View File

@ -233,6 +233,13 @@ pub(crate) async fn fetch_raw_secrets(
.await
.expect("Failed to decrypt master database configuration");
#[cfg(feature = "olap")]
#[allow(clippy::expect_used)]
let analytics =
analytics::AnalyticsConfig::convert_to_raw_secret(conf.analytics, secret_management_client)
.await
.expect("Failed to decrypt analytics configuration");
#[cfg(feature = "olap")]
#[allow(clippy::expect_used)]
let replica_database =
@ -342,7 +349,7 @@ pub(crate) async fn fetch_raw_secrets(
temp_locker_enable_config: conf.temp_locker_enable_config,
payment_link: conf.payment_link,
#[cfg(feature = "olap")]
analytics: conf.analytics,
analytics,
#[cfg(feature = "kv_store")]
kv_config: conf.kv_config,
#[cfg(feature = "frm")]

View File

@ -105,7 +105,7 @@ pub struct Settings<S: SecretState> {
pub temp_locker_enable_config: TempLockerEnableConfig,
pub payment_link: PaymentLink,
#[cfg(feature = "olap")]
pub analytics: AnalyticsConfig,
pub analytics: SecretStateContainer<AnalyticsConfig, S>,
#[cfg(feature = "kv_store")]
pub kv_config: KvConfig,
#[cfg(feature = "frm")]

View File

@ -200,7 +200,8 @@ impl AppState {
};
#[cfg(feature = "olap")]
let pool = crate::analytics::AnalyticsProvider::from_conf(&conf.analytics).await;
let pool =
crate::analytics::AnalyticsProvider::from_conf(conf.analytics.get_inner()).await;
#[cfg(feature = "email")]
let email_client = Arc::new(create_email_client(&conf).await);