mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 12:15:40 +08:00
refactor(kms): share a KMS client for all KMS operations (#744)
This commit is contained in:
@ -55,9 +55,12 @@ where
|
||||
let api_key = api_keys::PlaintextApiKey::from(api_key);
|
||||
let hash_key = {
|
||||
let config = state.conf();
|
||||
api_keys::HASH_KEY
|
||||
.get_or_try_init(|| api_keys::get_hash_key(&config.api_keys))
|
||||
.await?
|
||||
api_keys::get_hash_key(
|
||||
&config.api_keys,
|
||||
#[cfg(feature = "kms")]
|
||||
&config.kms,
|
||||
)
|
||||
.await?
|
||||
};
|
||||
let hashed_api_key = api_key.keyed_hash(hash_key.peek());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user