Skip to content

Commit 29cae0d

Browse files
committed
Remove logs EnvironmentAndSystemPropertyClientProviderStrategy which risk leaking credentials on console output
Fixes #1912
1 parent b1cb06d commit 29cae0d

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

core/src/main/java/org/testcontainers/dockerclient/EnvironmentAndSystemPropertyClientProviderStrategy.java

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.testcontainers.dockerclient;
22

33
import com.github.dockerjava.core.DefaultDockerClientConfig;
4-
import com.github.dockerjava.core.DockerClientConfig;
54
import lombok.extern.slf4j.Slf4j;
65
import org.apache.commons.lang.SystemUtils;
76

@@ -50,21 +49,7 @@ public void test() throws InvalidConfigurationException {
5049

5150
@Override
5251
public String getDescription() {
53-
return "Environment variables, system properties and defaults. Resolved: \n" + stringRepresentation(config);
54-
}
55-
56-
private String stringRepresentation(DockerClientConfig config) {
57-
58-
if (config == null) {
59-
return "";
60-
}
61-
62-
return " dockerHost=" + config.getDockerHost() + "\n" +
63-
" apiVersion='" + config.getApiVersion() + "'\n" +
64-
" registryUrl='" + config.getRegistryUrl() + "'\n" +
65-
" registryUsername='" + config.getRegistryUsername() + "'\n" +
66-
" registryPassword='" + config.getRegistryPassword() + "'\n" +
67-
" registryEmail='" + config.getRegistryEmail() + "'\n" +
68-
" dockerConfig='" + config.toString() + "'\n";
52+
return "Environment variables, system properties and defaults. Resolved dockerHost=" +
53+
(config != null ? config.getDockerHost() : "");
6954
}
7055
}

0 commit comments

Comments
 (0)