diff --git a/alpha/lib/model/Partner.php b/alpha/lib/model/Partner.php index 611ab03e55c..6feced0d500 100644 --- a/alpha/lib/model/Partner.php +++ b/alpha/lib/model/Partner.php @@ -1869,6 +1869,16 @@ public function validateApiAccessControl() if (kIpAddressUtils::isInternalIp()) return true; + // Check if the requested IP address is in the allowed list of IPs for this partner (if such list exists) + $allowedIps = kConf::get('internal_partner_access_allowed_ips', kConfMapNames::SECURITY, null); + if ($allowedIps) + { + if (kIpAddressUtils::isIpInRanges(infraRequestUtils::getRemoteAddress(), $allowedIps)) + { + return true; + } + } + if ($this->getEnforceHttpsApi() && infraRequestUtils::getProtocol() != infraRequestUtils::PROTOCOL_HTTPS) { KalturaLog::err('Action was accessed over HTTP while the partner is configured for HTTPS access only');