fix: store and retrieve merchant secret from MCA table for webhooks source verification (#1331)

Co-authored-by: Sanchith Hegde <sanchith.hegde@juspay.in>
This commit is contained in:
Hrithikesh
2023-07-14 12:13:33 +05:30
committed by GitHub
parent ce1d205219
commit a6645bd354
39 changed files with 271 additions and 439 deletions

View File

@ -52,6 +52,7 @@ impl ConfigInterface for Store {
config.insert(&conn).await.map_err(Into::into).into_report()
}
//fetch directly from DB
async fn find_config_by_key(
&self,
key: &str,
@ -74,6 +75,8 @@ impl ConfigInterface for Store {
.map_err(Into::into)
.into_report()
}
//update in DB and remove in redis and cache
async fn update_config_cached(
&self,
key: &str,
@ -85,6 +88,7 @@ impl ConfigInterface for Store {
.await
}
//check in cache, then redis then finally DB, and on the way back populate redis and cache
async fn find_config_by_key_cached(
&self,
key: &str,

View File

@ -457,6 +457,7 @@ impl MerchantConnectorAccountInterface for MockDb {
business_sub_label: t.business_sub_label,
created_at: common_utils::date_time::now(),
modified_at: common_utils::date_time::now(),
connector_webhook_details: t.connector_webhook_details,
};
accounts.push(account.clone());
account
@ -618,6 +619,7 @@ mod merchant_connector_account_cache_tests {
business_sub_label: None,
created_at: date_time::now(),
modified_at: date_time::now(),
connector_webhook_details: None,
};
let key_store = db