mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-31 01:57:45 +08:00
refactor(core): inclusion of locker to store fingerprints (#3630)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Narayan Bhat <narayan.bhat@juspay.in>
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
use common_enums::enums;
|
||||
use common_utils::events::ApiEventMetric;
|
||||
use masking::StrongSecret;
|
||||
use utoipa::ToSchema;
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)]
|
||||
@ -10,6 +11,15 @@ pub enum BlocklistRequest {
|
||||
ExtendedCardBin(String),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)]
|
||||
pub struct GenerateFingerprintRequest {
|
||||
pub card: Card,
|
||||
pub hash_key: StrongSecret<String>,
|
||||
}
|
||||
#[derive(Debug, Clone, serde::Deserialize, serde::Serialize)]
|
||||
pub struct Card {
|
||||
pub card_number: StrongSecret<String>,
|
||||
}
|
||||
pub type AddToBlocklistRequest = BlocklistRequest;
|
||||
pub type DeleteFromBlocklistRequest = BlocklistRequest;
|
||||
|
||||
@ -22,6 +32,11 @@ pub struct BlocklistResponse {
|
||||
pub created_at: time::PrimitiveDateTime,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub struct GenerateFingerprintResponsePayload {
|
||||
pub card_fingerprint: String,
|
||||
}
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)]
|
||||
pub struct ToggleBlocklistResponse {
|
||||
pub blocklist_guard_status: String,
|
||||
@ -54,4 +69,7 @@ impl ApiEventMetric for BlocklistRequest {}
|
||||
impl ApiEventMetric for BlocklistResponse {}
|
||||
impl ApiEventMetric for ToggleBlocklistResponse {}
|
||||
impl ApiEventMetric for ListBlocklistQuery {}
|
||||
impl ApiEventMetric for GenerateFingerprintRequest {}
|
||||
impl ApiEventMetric for ToggleBlocklistQuery {}
|
||||
impl ApiEventMetric for GenerateFingerprintResponsePayload {}
|
||||
impl ApiEventMetric for Card {}
|
||||
|
||||
Reference in New Issue
Block a user