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:
Sandeep Kumar
2024-09-03 15:53:04 +05:30
committed by GitHub
parent 98cfc13f53
commit 8ed942c6cd
63 changed files with 2884 additions and 1531 deletions

View File

@ -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},

View 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>,
},
}