Compare commits

...

1 Commits

Author SHA1 Message Date
Benjamin DALSASS
79f10ab262 N°7924 - soap deprecated 2026-11-30 08:51:22 +01:00
3 changed files with 47 additions and 1 deletions

View File

@@ -1787,6 +1787,14 @@ class Config
'source_of_value' => '',
'show_in_conf_sample' => false,
],
'security.soap.enabled' => [
'type' => 'bool',
'description' => 'If true, enables the deprecated webservices/soapserver.php endpoint for existing integrations. This exposes the legacy SOAP interface; migrate to the REST/JSON API instead.',
'default' => false,
'value' => false,
'source_of_value' => '',
'show_in_conf_sample' => false,
],
'behind_reverse_proxy' => [
'type' => 'bool',
'description' => 'If true, then proxies custom header (X-Forwarded-*) are taken into account. Use only if the webserver is not publicly accessible (reachable only by the reverse proxy)',

View File

@@ -0,0 +1,28 @@
<?php
namespace Combodo\iTop\Test\UnitTest\Webservices;
use Combodo\iTop\Test\UnitTest\ItopTestCase;
use Config;
class SoapServerTest extends ItopTestCase
{
public function testSoapEndpointIsDisabledByDefault(): void
{
$oConfig = new Config();
$this->assertFalse($oConfig->GetDefault('security.soap.enabled'));
$this->assertFalse($oConfig->Get('security.soap.enabled'));
}
public function testSoapEndpointCanBeEnabledAndDisabled(): void
{
$oConfig = new Config();
$oConfig->Set('security.soap.enabled', true);
$this->assertTrue($oConfig->Get('security.soap.enabled'));
$oConfig->Set('security.soap.enabled', false);
$this->assertFalse($oConfig->Get('security.soap.enabled'));
}
}

View File

@@ -25,9 +25,19 @@ require_once('../approot.inc.php');
require_once(APPROOT.'/application/application.inc.php');
require_once(APPROOT.'/application/startup.inc.php');
// N°7924 - Deprecate SOAP API
DeprecatedCallsLog::Error(
'The webservices/soapserver.php endpoint is deprecated. Use webservices/rest.php instead.',
DeprecatedCallsLog::ENUM_CHANNEL_PHP_ENDPOINT
);
if (utils::GetConfig()->Get('security.soap.enabled') !== true) {
http_response_code(403);
exit;
}
// this file is generated dynamically with location = here
$sWsdlUri = utils::GetAbsoluteUrlAppRoot().'webservices/itop.wsdl.php';
$sServiceCategory = utils::ReadParam('service_category');
$sServiceCategory = utils::ReadParam('service_category', '', false, utils::ENUM_SANITIZATION_FILTER_PARAMETER);
if (!empty($sServiceCategory)) {
$sWsdlUri .= "?service_category=".$sServiceCategory;
}