feat: encrypt PII fields before saving it in the database (#1043)

Co-authored-by: Nishant Joshi <nishant.joshi@juspay.in>
This commit is contained in:
Kartikeya Hegde
2023-05-30 13:43:17 +05:30
committed by GitHub
parent 77e60c82fa
commit fa392c40a8
107 changed files with 3818 additions and 1267 deletions

View File

@ -36,6 +36,24 @@ async fn main() -> ApplicationResult<()> {
let _guard = logger::setup(&conf.log);
#[cfg(feature = "pii-encryption-script")]
{
let store =
router::services::Store::new(&conf, false, tokio::sync::oneshot::channel().0).await;
// ^-------- KMS decryption of the master key is a fallible and the server will panic in
// the above mentioned line
router::scripts::pii_encryption::test_2_step_encryption(&store).await;
#[allow(clippy::expect_used)]
router::scripts::pii_encryption::encrypt_merchant_account_fields(&store)
.await
.expect("Failed while encrypting merchant account");
crate::logger::error!("Done with everything");
}
logger::info!("Application started [{:?}] [{:?}]", conf.server, conf.log);
#[allow(clippy::expect_used)]