mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 02:57:02 +08:00
feat: add env variable for enable key manager service (#5442)
Co-authored-by: dracarys18 <karthikey.hegde@juspay.in>
This commit is contained in:
@ -8936,6 +8936,7 @@ impl Default for super::settings::ApiKeys {
|
||||
impl Default for super::settings::KeyManagerConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
enabled: None,
|
||||
url: String::from("localhost:5000"),
|
||||
#[cfg(feature = "keymanager_mtls")]
|
||||
ca: String::default().into(),
|
||||
|
||||
@ -210,6 +210,7 @@ pub struct KvConfig {
|
||||
|
||||
#[derive(Debug, Deserialize, Clone)]
|
||||
pub struct KeyManagerConfig {
|
||||
pub enabled: Option<bool>,
|
||||
pub url: String,
|
||||
#[cfg(feature = "keymanager_mtls")]
|
||||
pub cert: Secret<String>,
|
||||
|
||||
@ -772,7 +772,7 @@ pub async fn merchant_account_transfer_keys(
|
||||
payload: web::Json<api_models::admin::MerchantKeyTransferRequest>,
|
||||
) -> HttpResponse {
|
||||
let flow = Flow::ConfigKeyFetch;
|
||||
api::server_wrap(
|
||||
Box::pin(api::server_wrap(
|
||||
flow,
|
||||
state,
|
||||
&req,
|
||||
@ -780,7 +780,7 @@ pub async fn merchant_account_transfer_keys(
|
||||
|state, _, req, _| transfer_key_store_to_key_manager(state, req),
|
||||
&auth::AdminApiAuth,
|
||||
api_locking::LockAction::NotApplicable,
|
||||
)
|
||||
))
|
||||
.await
|
||||
}
|
||||
|
||||
|
||||
@ -8,6 +8,7 @@ impl From<&crate::SessionState> for KeyManagerState {
|
||||
fn from(state: &crate::SessionState) -> Self {
|
||||
let conf = state.conf.key_manager.get_inner();
|
||||
Self {
|
||||
enabled: conf.enabled,
|
||||
url: conf.url.clone(),
|
||||
client_idle_timeout: state.conf.proxy.idle_pool_connection_timeout,
|
||||
#[cfg(feature = "keymanager_mtls")]
|
||||
|
||||
Reference in New Issue
Block a user