Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

chore: make kms decryption optional if partial auth not enabled (#5779)

Nishant Joshiaaeb1925767b
diff --git a/crates/router/src/configs/secrets_transformers.rs b/crates/router/src/configs/secrets_transformers.rs
index 4a39f58ebe..ce9c030333 100644
--- a/crates/router/src/configs/secrets_transformers.rs
+++ b/crates/router/src/configs/secrets_transformers.rs
@@ -115,16 +115,22 @@ impl SecretsHandler for settings::ApiKeys {
let expiry_reminder_days = api_keys.expiry_reminder_days.clone();
#[cfg(feature = "partial-auth")]
- let checksum_auth_context = secret_management_client
- .get_secret(api_keys.checksum_auth_context.clone())
- .await?;
- #[cfg(feature = "partial-auth")]
- let checksum_auth_key = secret_management_client
- .get_secret(api_keys.checksum_auth_key.clone())
- .await?;
+ let enable_partial_auth = api_keys.enable_partial_auth;
#[cfg(feature = "partial-auth")]
- let enable_partial_auth = api_keys.enable_partial_auth;
+ let (checksum_auth_context, checksum_auth_key) = {
+ if enable_partial_auth {
+ let checksum_auth_context = secret_management_client
+ .get_secret(api_keys.checksum_auth_context.clone())
+ .await?;
+ let checksum_auth_key = secret_management_client
+ .get_secret(api_keys.checksum_auth_key.clone())
+ .await?;
+ (checksum_auth_context, checksum_auth_key)
+ } else {
+ (String::new().into(), String::new().into())
+ }
+ };
Ok(value.transition_state(|_| Self {
hash_key,