spring-projects / spring-projects/spring-security

SEC-2387: Interceptors breaks an ability to add custom attribute types from ldif on embedded LDAP server

Open
#2,612 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: ldap type: bug type: jira
Dominant language
Java
Stars
9.6k
Forks
6.3k
Avg merge
2d 11h
Merged PRs (30d)
52

Description

Marcin Zajączkowski (Migrated from SEC-2387) said:

Loading ldif which defines custom attribute generates warnings and the attribute is not added.

ServerStringValue.java:247 WARN Cannot normalize the value :Encountered name based id of optionalprotocols which was not found in the OID registry

And later on a try to use that attribute:

DefaultOidRegistry.java:148 WARN OID for name 'optionalprotocols' was not found within the OID registry
DefaultServerEntry.java:307 WARN The attribute 'optionalprotocols' cannot be stored

It works fine with plain ApacheDS. Some digging shows that interceptors break this feature. When disabled - commented the line

service.setInterceptors( list );

in ApacheDSContainer (only default interceptors from DefaultDirectoryService applied) it works fine.

Sample configuration and ldif given in the forum thread.

I created also a test case which reproduced a problem on master (will post the link in a few minutes).

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 with ApacheDSContainer and the service.setInterceptors(list) call described in the issue, then review the supplied sample configuration and LDIF from the linked forum thread. Reproduce the warning about optionalprotocols on the embedded server and compare behavior with interceptors disabled. Done means the custom attribute loads without warnings and can be used afterward.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, security
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.