Hi,
I would like to have @SeviceConnection
functionality for the docker image "lldap:lldap" (https://github.com/lldap/lldap).
Currently, the only ldap support is based on docker image "osixia/openldap" (OpenLdapContainerConnectionDetailsFactory
).
The "osixia/openldap" project is not actively maintained and haven't received any updates for more than 3 years.
That's the main reason for me to look for alternatives, e.g. "lldap".
I can contribute a pull request, If you are fine with my proposal/enhancement.
Comment From: nicolaskrier
Hello @rfelgent,
I share the same concerns about osixia/openldap Docker image not being maintained anymore.
If I may, you could consider using bitnami/openldap Docker image. As you can see, it is well maintained by a company and quite popular. There is a Testcontainers Go OpenLDAP module with this image. It could serve as a source of inspiration.
Comment From: rfelgent
Hi @nicolaskrier ,
thanks for your input!
To be honest: Why not supporting both - the "lldap:lldap" and "bitnami/openldap" ? In my current project, the simplified and opinionated LDAP server "lldap:lldap" meets the (technical) requirements and provides a nice web interface out-of-the-box (bitnami/openldap doesn't) which is a "convenience" bonus for me (and developers unfamiliar with LDAP in general).
The specific Java Ldap Testcontainer module support is on my wish list, too. But it should be discussed elsewhere...
Comment From: nicolaskrier
Thank you for sharing this feedback about the "lldap:lldap" Docker image. The web interface feature is really appealing, and KeyCloak integration interests me as well.
I believe that having both images supported by Spring Boot could make sense. I would opt for creating LDAP Testcontainer modules as you have suggested.
Let's see what the Spring Boot team thinks about it. In the meantime, if you are willing to dive into the source code, here is the issue introducing LDAP support in Spring Boot 3.3. I have figured out that OpenLdapContainer has been moved here.
Comment From: rfelgent
Hi @nicolaskrier ,
I am in the lucky position that my current project uses Spring Boot 3.4.x. So my pull request will be based on the latest version.
After a quick dive into the code of spring-boot-testcontainers
related to @ServiceConnection
and ConnectionDetials
I revisit my quick answer:
The specific Java Ldap Testcontainer module support is on my wish list, too. But it should be discussed elsewhere...
Let me explain:
The functionality for JdbcConnectionDetails
(and its factory JdbcContainerConnectionDetailsFactory
) is backed by the testcontainer module JdbcDatabaseContainer
. This container module encapsulate "relational database stuff" and acts as thin adapter in order to be indepent from vendor/container specific functionality. Therefore, many relational database container are compatible with the JdbcContainerConnectionDetailsFactory
(or its @ServiceConnection
).
I'd like to have something similar for LdapConnectionDetails
in order to support "lldap:lldap" or "osixia/openldap" or "bitnami/openldap" or any ldap container.
Steps in following order:
- introduce the "LdapContainer" module in the testcontainer library (there is already one for Go, but not for Java) and
- then introduce a LdapContainerConnectionDetailsFactory
for the LdapConnectionDetails
and
- then deprecate the existing OpenLdapContainerConnectionDetailsFactory
But yeah, let's wait for feedback by the Spring Boot Team...
Comment From: philwebb
We discussed this today and we'd be quite happy to accept a contribution to support lldap. We think that it could even live alongside the existing osixia/openldap
support to give folks a while to migrate. We'd also ideally like to support lldap for both Testcontainers and Docker Compose.
Any efforts for a add an official LdapContainer
would also be welcome. Perhaps we should wait to see how those progress before we add support in Spring Boot. Otherwise we may be adding something only for it to be immediately changed to support the official Testcontainer LLdapContainer
.
Comment From: nicolaskrier
Hello @philwebb,
LLdapContainer
was introduced in Testcontainers with this PR by @eddumelendez. In this PR, @eddumelendez shared his opinion on where a possible LDAP container for the bitnami/openldap
image should ideally be added, and I agree with him. Another option could be to add it to the spring-boot-test-support-docker
module, but that makes less sense because it should be decoupled from Spring Boot.
What are your thoughts on this?
Comment From: thecooldrop
Hello @philwebb, I am a fresher to Spring Boot project (but long time user), and I would like to take on this issue. I do warn ahead of time that it might take a while (counted in weeks) for me to have this "right", but I would love to give it a stab if that is okay with you.
Edit:
It is also my understanding that following things are part of this issue:
- Add support for lldap via
@ServiceConnection
for Testcontainers - Add support for lldap for Docker Compose
After that in Testcontainers library itself we should add an LdapContainer abstraction. The abstraction analogous to JdbcDatabaseContainer, and then when that is done ideally refactor the code of all LDAP @ServiceConnection
implementations to build on this new abstraction. This should be done then in separate issue though?
Did I understand everything correctly?