8000 KEYCLOAK-14162 Uplifted Apache DS version for LDAPEmbeddedServer by tsaarni · Pull Request #7069 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

KEYCLOAK-14162 Uplifted Apache DS version for LDAPEmbeddedServer - #7069

Merged
mposolda merged 1 commit into
keycloak:masterfrom
Nordix:apacheds-uplift
May 14, 2020
Merged

mposolda merged 1 commit into
keycloak:masterfrom
Nordix:apacheds-uplift

Conversation

@tsaarni
@tsaarni tsaarni commented May 13, 2020
Copy link
Copy Markdown
Contributor

LDAPEmbeddedServer and KerberosEmbeddedServer depend on old version of ApacheDS which hangs occasionally on LDAP federation tests when StartTLS is used. This problem seems to happen very frequently with OpenJDK 11 (and later) on Ubuntu.

To fix the problem, update to the latest version of ApacheDS.

@tsaarni
tsaarni commented May 13, 2020
Copy link
Copy Markdown
Contributor Author

@mposolda, @iankko could you please review? Thank you!

Removal of storage backend specific subclasses

This PR keeps both file and in-memory backend options, but I removed the FileDirectoryServiceFactory and InMemoryDirectoryServiceFactory subclasses since I believe they are not necessary anymore. It is possible to configure a property for ApacheDS to choose the partition factory. DefaultDirectoryServiceFactory then uses that to instantiate the correct partition type.

Installing interceptor

There are two test cases that depend on adding RangedAttributeInterceptor for ApacheDS to impact the search behavior. The test case code depending on the behavior is here, and it is also inherited by LDAPGroupMapperNoImportTest

The interceptor has been installed when in-memory server is used here

// Find Normalization interceptor in chain and add our range emulated interceptor

I have now copied this behavior: I add the interceptor always when in-memory backend is used. See here https://github.com/Nordix/keycloak/blob/apacheds-uplift/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/LDAPEmbeddedServer.java#L218

This maybe now looks bit stranger than previously, since it is now bit more visible and not really explained why the directory server partition type has any impact on ApacheDS interceptors.

Question: in theory there could be a new property to enable the interceptor per test case when needed. Do you think it would be worth of adding this property or is it ok like this?

@mposolda mposolda self-assigned this May 13, 2020
@mposolda
Copy link
Copy Markdown
Contributor

@tsaarni Thanks! PR looks nice to me.

I've tried locally that LDAPEmbeddedServer and KerberosEmbeddedServer can be still executed and "persistence" works as expected. I've tried to run our internal pipeline with the PR and will approve if that passes.

@mposolda mposolda left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests passed in our lab with all the JDK versions, so seems to be fine. Approving.

@mposolda
mposolda requested a review from iankko May 14, 2020 10:05
@iankko iankko left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM @tsaarni Thanks, Tero!

The former JDK11 hang seems to be gone with this version (AFAICT from testing) for all of the cases:

  1. no debug options used at all,
  2. using the -Djavax.net.debug=ssl one,
  3. using the -Djavax.net.debug=all one.

@mposolda
mposolda merged commit bf8316e into keycloak:master May 14, 2020
@mposolda
Copy link
Copy Markdown
Contributor

@tsaarni @iankko Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0