mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 20:23:43 +08:00
chore: make kms decryption optional if partial auth not enabled (#5779)
This commit is contained in:
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user