Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Change visibility of AccountName and AccountKey to public, move to AzuriteBuilder #1258

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Testcontainers.Azurite/AzuriteBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ public sealed class AzuriteBuilder : ContainerBuilder<AzuriteBuilder, AzuriteCon

public const ushort TablePort = 10002;

public const string AccountName = "devstoreaccount1";

public const string AccountKey = "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==";

private static readonly ISet<AzuriteService> EnabledServices = new HashSet<AzuriteService>();

static AzuriteBuilder()
Expand Down
14 changes: 5 additions & 9 deletions src/Testcontainers.Azurite/AzuriteContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ namespace Testcontainers.Azurite;
[PublicAPI]
public sealed class AzuriteContainer : DockerContainer
{
private const string AccountName = "devstoreaccount1";

private const string AccountKey = "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==";

/// <summary>
/// Initializes a new instance of the <see cref="AzuriteContainer" /> class.
/// </summary>
Expand All @@ -25,11 +21,11 @@ public string GetConnectionString()
{
var properties = new Dictionary<string, string>();
properties.Add("DefaultEndpointsProtocol", Uri.UriSchemeHttp);
properties.Add("AccountName", AccountName);
properties.Add("AccountKey", AccountKey);
properties.Add("BlobEndpoint", new UriBuilder(Uri.UriSchemeHttp, Hostname, GetMappedPublicPort(AzuriteBuilder.BlobPort), AccountName).ToString());
properties.Add("QueueEndpoint", new UriBuilder(Uri.UriSchemeHttp, Hostname, GetMappedPublicPort(AzuriteBuilder.QueuePort), AccountName).ToString());
properties.Add("TableEndpoint", new UriBuilder(Uri.UriSchemeHttp, Hostname, GetMappedPublicPort(AzuriteBuilder.TablePort), AccountName).ToString());
properties.Add("AccountName", AzuriteBuilder.AccountName);
properties.Add("AccountKey", AzuriteBuilder.AccountKey);
properties.Add("BlobEndpoint", new UriBuilder(Uri.UriSchemeHttp, Hostname, GetMappedPublicPort(AzuriteBuilder.BlobPort), AzuriteBuilder.AccountName).ToString());
properties.Add("QueueEndpoint", new UriBuilder(Uri.UriSchemeHttp, Hostname, GetMappedPublicPort(AzuriteBuilder.QueuePort), AzuriteBuilder.AccountName).ToString());
properties.Add("TableEndpoint", new UriBuilder(Uri.UriSchemeHttp, Hostname, GetMappedPublicPort(AzuriteBuilder.TablePort), AzuriteBuilder.AccountName).ToString());
return string.Join(";", properties.Select(property => string.Join("=", property.Key, property.Value)));
}
}
Loading