mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 19:42:27 +08:00
feat(payout_link): secure payout links using server side validations and client side headers (#5219)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
use std::fmt::Display;
|
||||
use std::{collections::HashSet, fmt::Display};
|
||||
|
||||
use common_utils::{
|
||||
events::{ApiEventMetric, ApiEventsType},
|
||||
@ -59,7 +59,13 @@ pub struct PaymentLinkStatusData {
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
pub enum GenericLinks {
|
||||
pub struct GenericLinks {
|
||||
pub allowed_domains: HashSet<String>,
|
||||
pub data: GenericLinksData,
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
pub enum GenericLinksData {
|
||||
ExpiredLink(GenericExpiredLinkData),
|
||||
PaymentMethodCollect(GenericLinkFormData),
|
||||
PayoutLink(GenericLinkFormData),
|
||||
@ -67,12 +73,12 @@ pub enum GenericLinks {
|
||||
PaymentMethodCollectStatus(GenericLinkStatusData),
|
||||
}
|
||||
|
||||
impl Display for GenericLinks {
|
||||
impl Display for GenericLinksData {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(
|
||||
f,
|
||||
"{}",
|
||||
match self {
|
||||
match *self {
|
||||
Self::ExpiredLink(_) => "ExpiredLink",
|
||||
Self::PaymentMethodCollect(_) => "PaymentMethodCollect",
|
||||
Self::PayoutLink(_) => "PayoutLink",
|
||||
|
||||
Reference in New Issue
Block a user