fix(router): feature gate openssl deps for basilisk feature (#536)

This commit is contained in:
Sampras Lopes
2023-02-11 14:10:58 +05:30
committed by GitHub
parent 1ba6b8c9f8
commit e4956820fd
4 changed files with 18 additions and 10 deletions

View File

@ -8,16 +8,16 @@ use router_env::{instrument, tracing};
#[cfg(not(feature = "basilisk"))]
use crate::types::storage;
use crate::{
core::{
errors::{self, CustomResult, RouterResult},
payment_methods::transformers as payment_methods,
},
logger, routes, services,
core::errors::{self, CustomResult, RouterResult},
logger, routes,
types::api,
utils::{self, BytesExt, StringExt},
utils::{self, StringExt},
};
#[cfg(feature = "basilisk")]
use crate::{core::payment_methods::transformers as payment_methods, services, utils::BytesExt};
#[cfg(feature = "basilisk")]
const VAULT_SERVICE_NAME: &str = "CARD";
#[cfg(feature = "basilisk")]
const VAULT_VERSION: &str = "0";
pub struct SupplementaryVaultData {
@ -381,6 +381,7 @@ impl Vault {
}
//------------------------------------------------TokenizeService------------------------------------------------
#[cfg(feature = "basilisk")]
pub async fn create_tokenize(
state: &routes::AppState,
value1: String,
@ -444,6 +445,7 @@ pub async fn create_tokenize(
}
}
#[cfg(feature = "basilisk")]
pub async fn get_tokenized_data(
state: &routes::AppState,
lookup_key: &str,
@ -500,6 +502,7 @@ pub async fn get_tokenized_data(
}
}
#[cfg(feature = "basilisk")]
pub async fn delete_tokenized_data(
state: &routes::AppState,
lookup_key: &str,

View File

@ -1,11 +1,14 @@
pub mod api;
pub mod authentication;
#[cfg(feature = "basilisk")]
pub mod encryption;
pub mod logger;
use std::sync::Arc;
pub use self::{api::*, encryption::*};
pub use self::api::*;
#[cfg(feature = "basilisk")]
pub use self::encryption::*;
use crate::connection::{diesel_make_pg_pool, PgPool};
#[derive(Clone)]

View File

@ -1,6 +1,7 @@
use std::{num::Wrapping, str};
use error_stack::{report, IntoReport, ResultExt};
#[cfg(feature = "basilisk")]
use josekit::jwe;
use rand;
use ring::{aead::*, error::Unspecified};
@ -175,6 +176,7 @@ pub fn get_key_id(keys: &Jwekey) -> &str {
}
}
#[cfg(feature = "basilisk")]
pub async fn encrypt_jwe(
keys: &Jwekey,
msg: &str,