refactor: rename kms feature flag to aws_kms (#3249)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Chethan Rao
2024-02-02 15:48:29 +05:30
committed by GitHub
parent d283053e5e
commit 91519d8462
40 changed files with 507 additions and 486 deletions

View File

@ -6,15 +6,15 @@
#[cfg(feature = "email")]
pub mod email;
#[cfg(feature = "kms")]
pub mod kms;
#[cfg(feature = "aws_kms")]
pub mod aws_kms;
pub mod file_storage;
#[cfg(feature = "hashicorp-vault")]
pub mod hashicorp_vault;
/// Crate specific constants
#[cfg(feature = "kms")]
#[cfg(feature = "aws_kms")]
pub mod consts {
/// General purpose base64 engine
pub(crate) const BASE64_ENGINE: base64::engine::GeneralPurpose =
@ -22,20 +22,20 @@ pub mod consts {
}
/// Metrics for interactions with external systems.
#[cfg(feature = "kms")]
#[cfg(feature = "aws_kms")]
pub mod metrics {
use router_env::{counter_metric, global_meter, histogram_metric, metrics_context};
metrics_context!(CONTEXT);
global_meter!(GLOBAL_METER, "EXTERNAL_SERVICES");
#[cfg(feature = "kms")]
#[cfg(feature = "aws_kms")]
counter_metric!(AWS_KMS_DECRYPTION_FAILURES, GLOBAL_METER); // No. of AWS KMS Decryption failures
#[cfg(feature = "kms")]
#[cfg(feature = "aws_kms")]
counter_metric!(AWS_KMS_ENCRYPTION_FAILURES, GLOBAL_METER); // No. of AWS KMS Encryption failures
#[cfg(feature = "kms")]
histogram_metric!(AWS_KMS_DECRYPT_TIME, GLOBAL_METER); // Histogram for KMS decryption time (in sec)
#[cfg(feature = "kms")]
histogram_metric!(AWS_KMS_ENCRYPT_TIME, GLOBAL_METER); // Histogram for KMS encryption time (in sec)
#[cfg(feature = "aws_kms")]
histogram_metric!(AWS_KMS_DECRYPT_TIME, GLOBAL_METER); // Histogram for AWS KMS decryption time (in sec)
#[cfg(feature = "aws_kms")]
histogram_metric!(AWS_KMS_ENCRYPT_TIME, GLOBAL_METER); // Histogram for AWS KMS encryption time (in sec)
}