mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 09:07:09 +08:00
refactor: kms decrypt analytics config (#3984)
This commit is contained in:
@ -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")]
|
||||
|
||||
@ -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")]
|
||||
|
||||
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user