mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
feat(analytics): refactor and introduce analytics APIs to accommodate OrgLevel, MerchantLevel and ProfileLevel authentication (#5729)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Sampras Lopes <sampras.lopes@juspay.in>
This commit is contained in:
@ -1,6 +1,9 @@
|
||||
//! Types that can be used in other crates
|
||||
pub mod keymanager;
|
||||
|
||||
/// Enum for Authentication Level
|
||||
pub mod authentication;
|
||||
|
||||
use std::{
|
||||
fmt::Display,
|
||||
ops::{Add, Sub},
|
||||
|
||||
37
crates/common_utils/src/types/authentication.rs
Normal file
37
crates/common_utils/src/types/authentication.rs
Normal file
@ -0,0 +1,37 @@
|
||||
use crate::id_type;
|
||||
|
||||
/// Enum for different levels of authentication
|
||||
#[derive(
|
||||
Clone,
|
||||
Debug,
|
||||
Hash,
|
||||
Eq,
|
||||
PartialEq,
|
||||
serde::Deserialize,
|
||||
serde::Serialize,
|
||||
strum::Display,
|
||||
strum::EnumString,
|
||||
)]
|
||||
pub enum AuthInfo {
|
||||
/// OrgLevel: Authentication at the organization level
|
||||
OrgLevel {
|
||||
/// org_id: OrganizationId
|
||||
org_id: id_type::OrganizationId,
|
||||
},
|
||||
/// MerchantLevel: Authentication at the merchant level
|
||||
MerchantLevel {
|
||||
/// org_id: OrganizationId
|
||||
org_id: id_type::OrganizationId,
|
||||
/// merchant_ids: Vec<MerchantId>
|
||||
merchant_ids: Vec<id_type::MerchantId>,
|
||||
},
|
||||
/// ProfileLevel: Authentication at the profile level
|
||||
ProfileLevel {
|
||||
/// org_id: OrganizationId
|
||||
org_id: id_type::OrganizationId,
|
||||
/// merchant_id: MerchantId
|
||||
merchant_id: id_type::MerchantId,
|
||||
/// profile_ids: Vec<ProfileId>
|
||||
profile_ids: Vec<id_type::ProfileId>,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user