HostWhiteList: IStringList;
The HostWhiteList property returns the list of addresses, which are allowed to be addressed on creating a REST service request.
The list of addresses affects the work of REST sources in ETL tasks and import wizard. If the specified URL address of the REST service does not contain the substring added to the HostWhiteList list, an exception about failure to open the specified address is thrown. The following can be added to the HostWhiteList list: IP addresses, full or partial names of REST services, if required, a port can be specified via a colon.
The HostWhiteList list is empty by default, and one can address any sources.
Add links to the Collections and Metabase system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
MbSec: IMetabaseSecurity;
Policy: IMetabasePolicy;
WhiteList: IStringList;
Lic: Object;
Begin
Mb := MetabaseClass.Active;
// Get license to be able to work with the security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
// Security manager
MbSec := Mb.Security;
Policy := MbSec.Policy;
// General security policy settings
WhiteList := Policy.HostWhiteList;
WhiteList.Clear;
WhiteList.Add("test.server.com:443");
// Apply changes
MbSec.Apply;
// Check in license
Lic := Null;
End Sub UserProc;
After executing the example the list of addresses, which can be used to address REST services, is changed. The existing list is cleared, and only one server, which address should be present in the full address of the REST service with data, is added to the list.
See also: