testcontainers / testcontainers/testcontainers-dotnet
[Enhancement]: Add new module for OpenLDAP support (Testcontainers.Ldap)
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 4.4k
- Forks
- 357
- Avg merge
- 14h 42m
- Merged PRs (30d)
- 16
Description
Problem
Currently, Testcontainers for .NET does not provide any built-in support for LDAP services. Developers who need to test applications relying on directory services like OpenLDAP or Active Directory must manually configure containers using the generic TestcontainersBuilder.
In the past week, I implemented a custom LDAP test container from scratch for one of my projects. The process of loading and setting up the LDAP configuration was complicated and prone to bugs, especially for developers without deep knowledge of LDAP protocols and setup details. This increases maintenance overhead and reduces test reliability.
Solution
Initially, implement a basic configuration that provides a ready-to-use OpenLDAP container with default settings (admin user, password, domain, port mapping). Then, gradually develop the module to support configuring organizations, users, groups, and other LDAP entities internally within the container setup.
This approach aims to prevent increased maintenance overhead and reduce test reliability issues by hiding complex LDAP setup details from users and providing sensible defaults out-of-the-box.
var container = new LdapBuilder().Build();
await container.StartAsync();
var ldapConfig = container.GetLdapConnectionConfig();
container.AddOrganization("");
Benefit
- Simplifies LDAP integration testing with a ready-to-use container.
- Reduces setup time and errors for developers.
Alternatives
- Use generic TestcontainersBuilder with manual LDAP setup.
- Use in-memory or mock LDAP servers (less realistic).
Would you like to help contributing this enhancement?
Yes
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files or tests. Begin by reviewing existing Testcontainers module conventions and the proposed LdapBuilder, GetLdapConnectionConfig, and AddOrganization entry points; done means a ready-to-use OpenLDAP module with sensible defaults and validated configuration behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, docker
- Domain
- devtools, testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100