mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
feat: add resources and granular permission groups for reconciliation (#6591)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -446,3 +446,20 @@ pub enum StripeChargeType {
|
||||
pub fn convert_frm_connector(connector_name: &str) -> Option<FrmConnectors> {
|
||||
FrmConnectors::from_str(connector_name).ok()
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, serde::Serialize, Hash)]
|
||||
pub enum ReconPermissionScope {
|
||||
#[serde(rename = "R")]
|
||||
Read = 0,
|
||||
#[serde(rename = "RW")]
|
||||
Write = 1,
|
||||
}
|
||||
|
||||
impl From<PermissionScope> for ReconPermissionScope {
|
||||
fn from(scope: PermissionScope) -> Self {
|
||||
match scope {
|
||||
PermissionScope::Read => Self::Read,
|
||||
PermissionScope::Write => Self::Write,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
use common_utils::events::{ApiEventMetric, ApiEventsType};
|
||||
use masking::PeekInterface;
|
||||
|
||||
use crate::recon::{ReconStatusResponse, ReconTokenResponse, ReconUpdateMerchantRequest};
|
||||
use crate::recon::{
|
||||
ReconStatusResponse, ReconTokenResponse, ReconUpdateMerchantRequest, VerifyTokenResponse,
|
||||
};
|
||||
|
||||
impl ApiEventMetric for ReconUpdateMerchantRequest {
|
||||
fn get_api_event_type(&self) -> Option<ApiEventsType> {
|
||||
@ -19,3 +22,11 @@ impl ApiEventMetric for ReconStatusResponse {
|
||||
Some(ApiEventsType::Recon)
|
||||
}
|
||||
}
|
||||
|
||||
impl ApiEventMetric for VerifyTokenResponse {
|
||||
fn get_api_event_type(&self) -> Option<ApiEventsType> {
|
||||
Some(ApiEventsType::User {
|
||||
user_id: self.user_email.peek().to_string(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,11 +1,7 @@
|
||||
use common_utils::events::{ApiEventMetric, ApiEventsType};
|
||||
#[cfg(feature = "recon")]
|
||||
use masking::PeekInterface;
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
use crate::user::sample_data::SampleDataRequest;
|
||||
#[cfg(feature = "recon")]
|
||||
use crate::user::VerifyTokenResponse;
|
||||
use crate::user::{
|
||||
dashboard_metadata::{
|
||||
GetMetaDataRequest, GetMetaDataResponse, GetMultipleMetaDataPayload, SetMetaDataRequest,
|
||||
@ -23,15 +19,6 @@ use crate::user::{
|
||||
VerifyTotpRequest,
|
||||
};
|
||||
|
||||
#[cfg(feature = "recon")]
|
||||
impl ApiEventMetric for VerifyTokenResponse {
|
||||
fn get_api_event_type(&self) -> Option<ApiEventsType> {
|
||||
Some(ApiEventsType::User {
|
||||
user_id: self.user_email.peek().to_string(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
common_utils::impl_api_event_type!(
|
||||
Miscellaneous,
|
||||
(
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
use common_utils::pii;
|
||||
use common_utils::{id_type, pii};
|
||||
use masking::Secret;
|
||||
|
||||
use crate::enums;
|
||||
@ -18,3 +18,11 @@ pub struct ReconTokenResponse {
|
||||
pub struct ReconStatusResponse {
|
||||
pub recon_status: enums::ReconStatus,
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize, Debug)]
|
||||
pub struct VerifyTokenResponse {
|
||||
pub merchant_id: id_type::MerchantId,
|
||||
pub user_email: pii::Email,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub acl: Option<String>,
|
||||
}
|
||||
|
||||
@ -167,13 +167,6 @@ pub struct SendVerifyEmailRequest {
|
||||
pub email: pii::Email,
|
||||
}
|
||||
|
||||
#[cfg(feature = "recon")]
|
||||
#[derive(serde::Serialize, Debug)]
|
||||
pub struct VerifyTokenResponse {
|
||||
pub merchant_id: id_type::MerchantId,
|
||||
pub user_email: pii::Email,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Deserialize, serde::Serialize)]
|
||||
pub struct UpdateUserAccountDetailsRequest {
|
||||
pub name: Option<Secret<String>>,
|
||||
|
||||
Reference in New Issue
Block a user