Open
Description
When writing a LSC task with a executableLdifDestinationService, the values are not compared correctly, and LSC tries to modify every value.
Here is the relevant part of the configuration:
<task>
<name>Teams</name>
<bean>org.lsc.beans.SimpleBean</bean>
<ldapSourceService>
<name>openldap-groups-source-service</name>
<connection reference="openldap" />
<baseDn>ou=groups,dc=my-domain,dc=com</baseDn>
<pivotAttributes>
<string>cn</string>
</pivotAttributes>
<fetchedAttributes>
<string>cn</string>
<string>member</string>
</fetchedAttributes>
<getAllFilter>(&(objectClass=groupOfNames))</getAllFilter>
<getOneFilter>(&(objectClass=groupOfNames)(cn={cn}))</getOneFilter>
</ldapSourceService>
<pluginDestinationService implementationClass="org.lsc.plugins.connectors.executable.ExecutableLdifDestinationService">
<name>teams-dst-service</name>
<connection reference="executable" />
<exec:executableLdifDestinationServiceSettings>
<name>teams-dst-service-exec</name>
<connection reference="executable" />
<exec:listScript>/var/lib/lsc/list.py</exec:listScript>
<exec:getScript>/var/lib/lsc/get.py</exec:getScript>
<exec:addScript>/var/lib/lsc/add.py</exec:addScript>
<exec:updateScript>/var/lib/lsc/add.py</exec:updateScript>
<exec:removeScript>/var/lib/lsc/remove.py</exec:removeScript>
<exec:renameScript>/var/lib/lsc/rename.py</exec:renameScript>
<exec:variables>
<entry><key>MYKEY</key><value>MYVALUE</value></entry>
</exec:variables>
<exec:fetchedAttributes>
<string>cn</string>
<string>member</string>
</exec:fetchedAttributes>
</exec:executableLdifDestinationServiceSettings>
</pluginDestinationService>
<propertiesBasedSyncOptions>
<mainIdentifier>srcBean.getMainIdentifier()</mainIdentifier>
<defaultDelimiter>;</defaultDelimiter>
<defaultPolicy>KEEP</defaultPolicy>
<conditions>
<create>true</create>
<update>true</update>
<delete>false</delete>
<changeId>false</changeId>
</conditions>
<dataset>
<name>cn</name>
<policy>FORCE</policy>
<forceValues>
<string>
srcBean.getDatasetFirstValueById("cn")
</string>
</forceValues>
</dataset>
<dataset>
<name>member</name>
<policy>FORCE</policy>
<forceValues>
<string>
srcBean.getDatasetValuesById("member")
</string>
</forceValues>
</dataset>
</propertiesBasedSyncOptions>
There is a unit test in the code, but it does not test executableLdifDestinationService, just executableLdapDestinationService
We should:
- try to reproduce with a unit test
- fix if we reproduce