Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions alpha/lib/model/Partner.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down