use of io.fabric8.maven.docker.access.AuthConfig in project docker-maven-plugin by fabric8io.
the class AuthConfigFactoryTest method checkDockerAuthLogin.
private void checkDockerAuthLogin(File homeDir, String configRegistry, String lookupRegistry) throws IOException, MojoExecutionException {
writeDockerConfigJson(createDockerConfig(homeDir), "roland", "secret", "roland@jolokia.org", configRegistry, false);
AuthConfig config = factory.createAuthConfig(isPush, false, null, settings, "roland", lookupRegistry);
verifyAuthConfig(config, "roland", "secret", "roland@jolokia.org");
}
use of io.fabric8.maven.docker.access.AuthConfig in project docker-maven-plugin by fabric8io.
the class AuthConfigFactoryTest method testSystemProperty.
@Test
public void testSystemProperty() throws Exception {
System.setProperty("docker.push.username", "roland");
System.setProperty("docker.push.password", "secret");
System.setProperty("docker.push.email", "roland@jolokia.org");
try {
AuthConfig config = factory.createAuthConfig(true, false, null, settings, null, null);
verifyAuthConfig(config, "roland", "secret", "roland@jolokia.org");
} finally {
System.clearProperty("docker.push.username");
System.clearProperty("docker.push.password");
System.clearProperty("docker.push.email");
}
}
use of io.fabric8.maven.docker.access.AuthConfig in project docker-maven-plugin by fabric8io.
the class AuthConfigFactoryTest method awsStaticCredentialsArePickedUpFromEnvironment.
@Test
public void awsStaticCredentialsArePickedUpFromEnvironment() throws MojoExecutionException {
givenAwsSdkIsDisabled();
String accessKeyId = randomUUID().toString();
String secretAccessKey = randomUUID().toString();
environmentVariables.set("AWS_ACCESS_KEY_ID", accessKeyId);
environmentVariables.set("AWS_SECRET_ACCESS_KEY", secretAccessKey);
AuthConfig authConfig = factory.createAuthConfig(false, true, null, settings, "user", ECR_NAME);
verifyAuthConfig(authConfig, accessKeyId, secretAccessKey, null, null);
}
use of io.fabric8.maven.docker.access.AuthConfig in project docker-maven-plugin by fabric8io.
the class AuthConfigTest method simpleConstructor.
@Test
public void simpleConstructor() {
Map<String, String> map = new HashMap<String, String>();
map.put(AuthConfig.AUTH_USERNAME, "roland");
map.put(AuthConfig.AUTH_PASSWORD, "#>secrets??");
map.put(AuthConfig.AUTH_EMAIL, "roland@jolokia.org");
AuthConfig config = new AuthConfig(map);
check(config);
}
use of io.fabric8.maven.docker.access.AuthConfig in project docker-maven-plugin by fabric8io.
the class AuthConfigTest method dockerLoginConstructor.
@Test
public void dockerLoginConstructor() {
AuthConfig config = new AuthConfig(Base64.encodeBase64String("roland:#>secrets??".getBytes()), "roland@jolokia.org");
check(config);
}
Aggregations