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(router): enforce JWT profile scope for acquirer writes (#15093)
Ayush Ananda359b3015524
diff --git a/crates/router/src/routes/profile_acquirer.rs b/crates/router/src/routes/profile_acquirer.rsindex 23bebe5403..2a2d5f0690 100644--- a/crates/router/src/routes/profile_acquirer.rs+++ b/crates/router/src/routes/profile_acquirer.rs@@ -17,6 +17,7 @@ pub async fn create_profile_acquirer() -> HttpResponse {let flow = Flow::ProfileAcquirerCreate;let payload = json_payload.into_inner();+ let profile_id = payload.profile_id.clone();Box::pin(api::server_wrap(flow,@@ -35,8 +36,9 @@ pub async fn create_profile_acquirer(allow_connected_scope_operation: true,allow_platform_self_operation: false,}),- &auth::JWTAuth {- permission: Permission::ProfileAccountWrite,+ &auth::JWTAuthProfileFromRoute {+ profile_id,+ required_permission: Permission::ProfileAccountWrite,allow_connected: true,allow_platform: false,},@@ -81,8 +83,9 @@ pub async fn profile_acquirer_update(allow_connected_scope_operation: true,allow_platform_self_operation: false,}),- &auth::JWTAuth {- permission: Permission::ProfileAccountWrite,+ &auth::JWTAuthProfileFromRoute {+ profile_id: profile_id.clone(),+ required_permission: Permission::ProfileAccountWrite,allow_connected: true,allow_platform: false,},