WrenSecurity / wrenidm

Community‐developed identity management system with a flexible data model, multiple extension points and scripting support, including JavaScript and Groovy.
https://wrensecurity.org/
Other
40 stars 19 forks source link

Treat NULL values in mapped tables as undefined #202

Open pavelhoral opened 1 month ago

pavelhoral commented 1 month ago

This changes the way how NULL values in mapped table columns are handled - all NULL values are being treated as undefined JSON values.

This change makes sense as it aligns generic table behavior with the explicitly mapped behavior. However this also makes it impossible to actually save null values, but supporting undefined is definitely a more reasonable default. This needs to be properly tested before merging (i.e. no phantom changes when working with Admin UI and during synchronization).

pavelhoral commented 1 month ago

Played with this change a bit and there are quite a lot of corner cases that needs to be properly addressed (mainly in relation to phantom changes). For example right now there is no easy way to unset a property during synchronization process from within the mapping file. Also we probably need to make sure there is a way how to make the JDBC repo behave in a legacy compatible way to not break existing deployments.

pavelhoral commented 1 month ago

Just to add what was the LEGACY behavior even before the recent JDBC repo refactor... NULLs were alway nulls - https://github.com/WrenSecurity/wrenidm/blob/6.1.x/openidm-repo-jdbc/src/main/java/org/forgerock/openidm/repo/jdbc/impl/ExplicitResultSetMapper.java#L116 .