Skip to content

Add ldap module - #9987

Merged
eddumelendez merged 1 commit into
mainfrom
ldap
Feb 19, 2025
Merged

Add ldap module#9987
eddumelendez merged 1 commit into
mainfrom
ldap

Conversation

@eddumelendez

Copy link
Copy Markdown
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
* </ul>
*/
@Slf4j
public class LLdapContainer extends GenericContainer<LLdapContainer> {

@rfelgent rfelgent Feb 19, 2025

Copy link
Copy Markdown

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

@eddumelendez eddumelendez Feb 19, 2025

Copy link
Copy Markdown
Member Author

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.

Copy link
Copy Markdown

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.

@eddumelendez eddumelendez Feb 19, 2025

Copy link
Copy Markdown
Member Author

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.

@rfelgent rfelgent Feb 27, 2025

Copy link
Copy Markdown

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