spring-projects / spring-projects/spring-ldap

LDAP-303: odm: missing objectClass inheritance

Open
#338 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
375
Forks
501
Avg merge
6h 4m
Merged PRs (30d)
63

Description

Torsten Werner (Migrated from LDAP-303) said:

I have a class with annotation
@Entry(objectClasses = {"top"})
but several ldap nodes have only the objectClass=inetOrgPerson which is correct because inetOrgPerson inherits from top. Spring-ldap submits a query
(&(objectClass=top)(uid=...))
to the server and the server responds with all nodes because it knows about the inheritance. For nodes with objectClass=inetOrgPerson only the server sends only this objectClass back to the client without the inherited objectClass top.

But there is a check in org.springframework.ldap.odm.core.impl.DefaultObjectDirectoryMapper#mapFromLdapDataEntry
if(!collectionContainsAll(objectClassesFromJndi, metaData.getObjectClasses()))
that throws away all results that do not have an explicit objectClass=top in the server's response.

IMHO, spring-ldap should trust the ldap server and do not throw away such results. But at least there should be an option for disabling/enabling this extra check.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at org.springframework.ldap.odm.core.impl.DefaultObjectDirectoryMapper#mapFromLdapDataEntry and inspect the collectionContainsAll check against metadata object classes. Reproduce the inetOrgPerson/top response case, then verify that inherited objectClass results are accepted or that the requested check can be configured, with tests covering the chosen behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.