lsc-project / lsc

LSC engine
http://lsc-project.org/wiki/documentation/latest/start
Other
108 stars 41 forks source link

require createValues, defaultValues and forceValues in xsd #215

Open davidcoutadeur opened 1 year ago

davidcoutadeur commented 1 year ago

In a LSC synchronization DB -> DB, I noticed that defaultValues, forceValues and createValues are mandatory, else we get a generic nullPointerException. (which is hard to understand)

For example, this one is ok:

        <dataset>
          <name>userPassword</name>
          <policy>KEEP</policy>
          <defaultValues>
            <string>"changethis"</string>
          </defaultValues>
          <forceValues></forceValues>
          <createValues></createValues>
        </dataset>

This one is ko:

        <dataset>
          <name>userPassword</name>
          <policy>KEEP</policy>
          <defaultValues>
            <string>"changethis"</string>
          </defaultValues>
        </dataset>

I think it could be a good idea to fail fast when the tags are absent

Maybe we could make the default/force/createValues to be mandatory in the XSD verification?

coudot commented 1 year ago

I think we should not require them, as they are not mandatory for a DB -> LDAP or LDAP -> LDAP connector. There is no reason that a dataset has to be specific to source or destination type.

davidcoutadeur commented 1 year ago

Ok, if it is not mandatory for DB -> LDAP or LDAP -> LDAP.

By the way, it can be interesting to give a look to the code to understand why it is required for DB -> DB.

coudot commented 1 year ago

Indeed, I consider this is a bug and has to be fixed.

davidcoutadeur commented 12 months ago

I don't reproduce with a hsqldb -> ldap connector.

Maybe this is specific to a special database. The bug was found on a DB2 -> LDAP connector