spring-projects / spring-projects/spring-ldap

LDAP-313: Ability to persist new entries without precoding DnAttribute annotations to allow location flexibility

Open
#348 0 comments 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

Harel (Migrated from LDAP-313) said:

Sometimes, applications need to create new entries (of the same type) in different locations.
However, the DefaultObjectDirectoryMapper.getCalculatedId(Object entry) method relies on the DnAttribute annotations to determine the location in case the ID is null (new entry).
An attempt to set the ID to the correct location yields an exception as the entry does not exist (of course).

This means that the entry is pinned to a predefined/precoded location and can no longer be used in another location.
Example:
Directory that contains multiple organisations, or even departments.
There is no way to persist a new user record in more than one location.

There should be a way to provide a base DN prior to persisting it.
The calculation method should check for the base DN and only if it is missing, try to use the DnAttribute annotations.

Thanks in advance.

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 DefaultObjectDirectoryMapper.getCalculatedId(Object entry) and trace how DnAttribute annotations determine the location for a new entry. Check how a base DN could be supplied before persistence, then verify that it takes precedence when present and that annotation-based calculation remains the fallback.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
api, backend
Issue type
Feature
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.