mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 18:17:13 +08:00 
			
		
		
		
	refactor(euclid): check the authenticity of profile_id being used (#5647)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
		| @ -1368,6 +1368,38 @@ impl GetProfileId for diesel_models::Refund { | ||||
|     } | ||||
| } | ||||
|  | ||||
| #[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "routing_v2")))] | ||||
| impl GetProfileId for api_models::routing::RoutingConfigRequest { | ||||
|     fn get_profile_id(&self) -> Option<&common_utils::id_type::ProfileId> { | ||||
|         self.profile_id.as_ref() | ||||
|     } | ||||
| } | ||||
|  | ||||
| #[cfg(all(feature = "v2", feature = "routing_v2"))] | ||||
| impl GetProfileId for api_models::routing::RoutingConfigRequest { | ||||
|     fn get_profile_id(&self) -> Option<&common_utils::id_type::ProfileId> { | ||||
|         Some(&self.profile_id) | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl GetProfileId for api_models::routing::RoutingRetrieveLinkQuery { | ||||
|     fn get_profile_id(&self) -> Option<&common_utils::id_type::ProfileId> { | ||||
|         self.profile_id.as_ref() | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl GetProfileId for diesel_models::routing_algorithm::RoutingProfileMetadata { | ||||
|     fn get_profile_id(&self) -> Option<&common_utils::id_type::ProfileId> { | ||||
|         Some(&self.profile_id) | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl GetProfileId for domain::BusinessProfile { | ||||
|     fn get_profile_id(&self) -> Option<&common_utils::id_type::ProfileId> { | ||||
|         Some(self.get_id()) | ||||
|     } | ||||
| } | ||||
|  | ||||
| #[cfg(feature = "payouts")] | ||||
| impl GetProfileId for storage::Payouts { | ||||
|     fn get_profile_id(&self) -> Option<&common_utils::id_type::ProfileId> { | ||||
| @ -1381,12 +1413,6 @@ impl<T, F> GetProfileId for (storage::Payouts, T, F) { | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl GetProfileId for domain::BusinessProfile { | ||||
|     fn get_profile_id(&self) -> Option<&common_utils::id_type::ProfileId> { | ||||
|         Some(self.get_id()) | ||||
|     } | ||||
| } | ||||
|  | ||||
| /// Filter Objects based on profile ids | ||||
| pub(super) fn filter_objects_based_on_profile_id_list<T: GetProfileId>( | ||||
|     profile_id_list_auth_layer: Option<Vec<common_utils::id_type::ProfileId>>, | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Prajjwal Kumar
					Prajjwal Kumar