Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
fix(authentication): added webhook ip verification support for netcetera (#15083)
Sahkal Poddar12fbd8e09fc4
diff --git a/crates/hyperswitch_connectors/src/connectors/netcetera.rs b/crates/hyperswitch_connectors/src/connectors/netcetera.rsindex dfb312e27f..b7287f525e 100644--- a/crates/hyperswitch_connectors/src/connectors/netcetera.rs+++ b/crates/hyperswitch_connectors/src/connectors/netcetera.rs@@ -479,6 +479,10 @@ static NETCETERA_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo {};impl ConnectorSpecifications for Netcetera {+ fn is_webhook_ip_verification_required(&self) -> bool {+ true+ }+fn get_connector_about(&self) -> Option<&'static ConnectorInfo> {Some(&NETCETERA_CONNECTOR_INFO)}diff --git a/crates/router/src/core/webhooks/source_verification.rs b/crates/router/src/core/webhooks/source_verification.rsindex 13aceac4cc..2bcebf8972 100644--- a/crates/router/src/core/webhooks/source_verification.rs+++ b/crates/router/src/core/webhooks/source_verification.rs@@ -249,6 +249,7 @@ impl<'a> IncomingWebhookVerifier<'a> {mod tests {use actix_web::http::header::{HeaderMap, HeaderName, HeaderValue};use external_services::superposition::Config;+ use hyperswitch_interfaces::api::ConnectorSpecifications;use super::{IncomingWebhookVerifier, NetworkVerification, VerificationStatus};use crate::{@@ -297,6 +298,17 @@ mod tests {assert!(!IncomingWebhookMtlsVerificationEnabled::default_value());}+ #[test]+ fn requires_ip_verification_only_for_opted_in_connectors() {+ for (name, required) in [("envoy", true), ("netcetera", true), ("stripe", false)] {+ assert_eq!(+ connector(name).is_webhook_ip_verification_required(),+ required,+ "{name}"+ );+ }+ }+#[test]fn resolves_source_verification_from_all_network_checks() {use VerificationStatus::{NotRequired, RequiredButDisabled, Verified};