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

[#456] #EXTEND 'assemblyName: DotNet.Testcontainers; function: WithDo… #457

Closed

Conversation

MarcinSzyszka
Copy link

…ckerEndpoint ' {Extended method with Docker.DotNet.Credentials parameter and made required changes to related code to pass credentials to Docker.DotNet.DockerClientConfiguration ctor }

…nction: WithDockerEndpoint ' {Extended method with Docker.DotNet.Credentials parameter and made required changes to related code to pass credentials to Docker.DotNet.DockerClientConfiguration ctor }
…ts; class: TestcontainersAccessInformationTest' {Fixed tests after changes added in previous commit}
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

85.7% 85.7% Coverage
0.0% 0.0% Duplication

Copy link
Collaborator

@HofmeisterAn HofmeisterAn left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution. I can do the review at the beginning of next month. Right now, I have limit access to a proper device — sorry for the delay. I think this relates to #370 too.

Copy link
Collaborator

@HofmeisterAn HofmeisterAn left a comment

Choose a reason for hiding this comment

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

Please cover your changes with unit tests. I think we can exposes a secure Docker daemon on the Linux agent.

{
using System;
using System.Collections.Generic;
using Docker.DotNet;
Copy link
Collaborator

Choose a reason for hiding this comment

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

The library (builder) does not expose models from this namespace. Please see the discussions in #370 too. I think it makes sense to combine the endpoint and credential in a single interface and offer different implementations specific for the authentication.

/// <inheritdoc cref="IAbstractBuilder{TBuilderEntity}" />
public TBuilderEntity WithDockerEndpoint(string endpoint, Credentials credentials)
{
return this.MergeNewConfiguration(new DockerResourceConfiguration(endpoint: new Uri(endpoint), credentials: credentials));
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should use our own interface. The implementation should consider the common env variables (DOCKER_HOST, DOCKER_TLS_VERIFY, DOCKER_CERT_PATH) too (at least in the future). Then we can set and apply the default credentials from the constructor based on the machine configuration.

Copy link
Author

Choose a reason for hiding this comment

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

If I implement our own interface and class for certificate credentials will it be acceptable for now?
I know that perfect soultion would be connecting to dockerd secured with tls automatically as it is done in java lib but it sounds like a lot of work and as we can see in #370 last comment was in the end of 2k21 ;)
I'd like to use this lib in my projects but without credentials support is useless now.
We could treat this solution as first step to handle connection to secured dockerd - I don't exclude my further contribution on that

Copy link
Collaborator

Choose a reason for hiding this comment

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

We could treat this solution as first step to handle connection to secured dockerd

I can publish your changes in its own package as soon as I’m back. For develop, I would prefer the mentioned things above.

Copy link
Author

Choose a reason for hiding this comment

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

Ok, if I want to try to implement solution with docker env variables, should I do that in this PR or create new one?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, a new pull request would be nice. Smaller increments would be appreciated too (first the interface). I'll publish your package later that day.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Your changes are published in 1.6.0-beta.GitHub-457.

@HofmeisterAn
Copy link
Collaborator

I'll close this in favor of #370 (comment). You can now use the latest version to configure / authenticate the client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants