KEMBAR78
Add ldap module by eddumelendez · Pull Request #9987 · testcontainers/testcontainers-java · GitHub
Skip to content

Conversation

@eddumelendez
Copy link
Member

Provide LLdapContainer supporting lldap/lldap image.

Fixes #9960

@eddumelendez eddumelendez requested a review from a team February 19, 2025 02:48
@eddumelendez eddumelendez added this to the next milestone Feb 19, 2025
Provide LLdapContainer supporting `lldap/lldap` image.

Fixes #9960
@eddumelendez eddumelendez merged commit 2ac4ed6 into main Feb 19, 2025
109 checks passed
@eddumelendez eddumelendez deleted the ldap branch February 19, 2025 03:13
* </ul>
*/
@Slf4j
public class LLdapContainer extends GenericContainer<LLdapContainer> {
Copy link

@rfelgent rfelgent Feb 19, 2025

Choose a reason for hiding this comment

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

what do you think of adding an abstract LdapContainer class as adapter (similar to org.testcontainers.containers.JdbcDatabaseContainer).

By doing so, we could (later) add support for other containers like 'bitnami/openldap' or 'docker-openldap' at a later time

Copy link
Member Author

@eddumelendez eddumelendez Feb 19, 2025

Choose a reason for hiding this comment

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

I think it is different. I don't see much shared between ldap as you can see in the implementation. It only took exposed ports and specific wait strategy.

We still can add other implementations later with the proper setup.

Choose a reason for hiding this comment

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

Hello,

I believe introducing an abstract class for the LDAP container could be beneficial once a second LDAP container is added to Testcontainers. For Spring Boot, this would allow the creation of a single ContainerConnectionDetailsFactory, similar to the JdbcContainerConnectionDetailsFactory.

@eddumelendez: Do you think it would be valuable to add another LDAP container for the bitnami/openldap image in the near future? If so, please let me know if you would welcome an OSS contribution on this.

Copy link
Member Author

@eddumelendez eddumelendez Feb 19, 2025

Choose a reason for hiding this comment

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

I believe introducing an abstract class for the LDAP container could be beneficial once a second LDAP container is added to Testcontainers. For Spring Boot, this would allow the creation of a single ContainerConnectionDetailsFactory, similar to the JdbcContainerConnectionDetailsFactory.

Yes, I understand that. I think this in general could be something to revisit in a major version.

Do you think it would be valuable to add another LDAP container for the bitnami/openldap image in the near future?

bitnami has really great images with easy configuration for some scenarios. I wish there is a bitnami module with support for their images. But, the suggestion was declined, see bitnami/containers#74973. And for us, it is getting a bit complex to handle many modules.

Copy link

@rfelgent rfelgent Feb 27, 2025

Choose a reason for hiding this comment

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

Hi @eddumelendez ,

Yes, I understand that. I think this in general could be something to revisit in a major version.

I understand your point of delaying this abstraction.

Still, I think that such introduction "now" would have made the in the integration in "spring-boot" testcontainers easier and "future" proven.

By "future" proven, I mean there are a few ldap Information any ldap container should share:

  • "admin-user/password" (similar to a database user) so that the app can interact with the ldap server
  • base-dn, the majority - if not all - ldap server will provide base directory setup and not a blank one
  • another feature would be "ldif" importer

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement]: Support for Ldap module in Java

3 participants