testcontainers / testcontainers/testcontainers-dotnet

[Enhancement]: Support https connection string for Azurite container.

Open
#1,436 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement module
Dominant language
C#
Stars
4.4k
Forks
357
Avg merge
14h 42m
Merged PRs (30d)
16

Description

Problem

I need to connect to my Azurite container using an HTTPS connection string.

From Azurite docs, if you start the container with a cert and a key, the container should be accessible using HTTPS. The issue isn't there, the container is running fine, however, in AzuriteContainer (src/Testcontainers.Azurite/AzuriteContainer.cs), the Uri scheme is hardcoded to HTTP and it looks impossible to get the HTTPS variant of that connection string.

Also, the class is sealed so there's no way for me to override this in a, lets say, "AzuriteSslContainer" which could inherit from "AzuriteContainer" to override the GetConnectionString method.

workaround is to hardcode the https connection string in my code which is ugly :)

Solution

Have an HTTPS variant for the AzuriteContainer or simply make the class not sealed and let us do it in our code base.

Benefit

Simpler and cleaner code. Else I need to have my connection string hardcoded instead of calling GetConnectionString on the AzuriteContainer which is the go to solution when I need to access the storage hosted in my local container.

Alternatives

Hardcoded HTTPs connection string in my codebase :(

Would you like to help contributing this enhancement?

Yes

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/Testcontainers.Azurite/AzuriteContainer.cs and inspect GetConnectionString and the hardcoded URI scheme. The change is done when an Azurite container can provide an HTTPS connection string for certificate-enabled containers without requiring callers to hardcode it.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp, docker
Domain
devtools, testing
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.