allthingssecurity opened a new pull request, #27642: URL: https://github.com/apache/camel/pull/27642
# Description [CAMEL-25509](https://issues.apache.org/jira/browse/CAMEL-25509) RFC 2849 defines `changetype: modrdn` and `changetype: moddn` as the same change: the entry gets the new RDN, and moves under `newsuperior` only when it is given. `LdifProducer` handled them as two operations: - `modrdn` with `newsuperior` was a rename in place: the entry was not moved, and the result was still `success`; - `moddn` without `newsuperior` became `moveAndRename(dn, new Dn(newRdn, null))`, a move to the one-RDN DN `newRdn` directly under the root, which the server rejects. Both change types now move the entry with `moveAndRename` when `newsuperior` is given and rename it in place with `rename` otherwise. The requests for `moddn` with `newsuperior` and `modrdn` without it (the cases in `LdifRouteIT`) are unchanged. A short 4.23 upgrade guide note describes the two changed cases. Tests: - New `LdifModDnTest` with a stub `LdapConnection` (a `java.lang.reflect.Proxy` that records the resulting DN), so no LDAP server is needed: the four combinations of change type and `newsuperior`. - Without the change: two fail, e.g. `expected: <uid=b,ou=new,dc=example,dc=org deleteOldRdn=true> but was: <uid=b,ou=old,dc=example,dc=org deleteOldRdn=true>`. - With the change: camel-ldif unit tests 5, 0 failures. `LdifRouteIT` needs the OpenLDAP container and was not run. Found with a Lean 4 model of the dispatch (DNs as lists of RDNs): "the new DN is newrdn under newsuperior if given, else under the current parent" fails for both records, and the fix is proved correct for every record and to send the same request as before in the two cases that worked. I then reproduced it with the producer and the LDAP API. # Target - [x] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch) # Tracking - [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it). # Apache Camel coding standards and style - [x] I checked that each commit in the pull request has a meaningful subject line and body. - [ ] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes. (I built and tested camel-ldif, including the formatter and import-sort plugins. I did not run the full root build.) # AI-assisted contributions - [x] If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR description identifies the AI tool used. This PR was prepared with Claude Code (Claude Opus 5.5). The commit carries a `Co-Authored-By` trailer. _Claude Code on behalf of allthingssecurity_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
