spring-projects / spring-projects/spring-ldap
LDAP-287: LdapTemplate should convert string DNs to DistinguishedNames before passing them to DirContext
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 375
- Forks
- 501
- Avg merge
- 6h 4m
- Merged PRs (30d)
- 63
Description
Pavel Horal (Migrated from LDAP-287) said:
Oracle's com.sun.jndi.ldap.LdapCtx (OracleJDK and OpenJDK) is converting all string based names to CompositeName. This means that it will get special handling for forward slashes and possibly other unwanted behavior.
Spring LDAP is LDAP library and LdapTemplate is supposed to work with LDAP objects. If JavaDoc says a DN string is expected, it should not have any side-effects, like misinterpretting forward slash character, which is not consistent with LDAP RFCs.
ldapTemplate.lookup("cn=foo/bar,cn=root"); // Results in error
ldapTemplate.lookup(new DistinguishedName("cn=foo/bar,cn=root")); // Works nicely
I suggest to convert internally all string based DNs to DistinguishedName inside LdapTemplate methods, before handing them over to DirContext.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the LdapTemplate methods that accept string-based DNs and trace how they pass names to DirContext. Use the lookup examples in the issue to verify the forward-slash behavior; done means string DNs are converted to DistinguishedName before delegation without changing existing DistinguishedName handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100