use of io.fabric8.docker.api.model.AuthConfig in project docker-maven-plugin by fabric8io.
the class AuthConfigFactoryTest method testFromSettingsDefault.
@Test
public void testFromSettingsDefault() throws MojoExecutionException {
setupServers();
AuthConfig config = factory.createAuthConfig(isPush, false, null, settings, "fabric8io", "test.org");
assertNotNull(config);
verifyAuthConfig(config, "fabric8io", "secret2", "fabric8io@redhat.com");
}
use of io.fabric8.docker.api.model.AuthConfig in project docker-maven-plugin by fabric8io.
the class AuthConfigFactoryTest method awsTemporaryCredentialsArePickedUpFromEnvironment.
@Test
public void awsTemporaryCredentialsArePickedUpFromEnvironment() throws MojoExecutionException {
givenAwsSdkIsDisabled();
String accessKeyId = randomUUID().toString();
String secretAccessKey = randomUUID().toString();
String sessionToken = randomUUID().toString();
environmentVariables.set("AWS_ACCESS_KEY_ID", accessKeyId);
environmentVariables.set("AWS_SECRET_ACCESS_KEY", secretAccessKey);
environmentVariables.set("AWS_SESSION_TOKEN", sessionToken);
AuthConfig authConfig = factory.createAuthConfig(false, true, null, settings, "user", ECR_NAME);
verifyAuthConfig(authConfig, accessKeyId, secretAccessKey, null, sessionToken);
}
use of io.fabric8.docker.api.model.AuthConfig in project docker-maven-plugin by fabric8io.
the class AuthConfigFactoryTest method testFromPluginConfigurationPull.
@Test
public void testFromPluginConfigurationPull() throws MojoExecutionException {
Map pullConfig = new HashMap();
pullConfig.put("username", "roland");
pullConfig.put("password", "secret");
pullConfig.put("email", "roland@jolokia.org");
Map pluginConfig = new HashMap();
pluginConfig.put("pull", pullConfig);
AuthConfig config = factory.createAuthConfig(false, false, pluginConfig, settings, null, null);
verifyAuthConfig(config, "roland", "secret", "roland@jolokia.org");
}
use of io.fabric8.docker.api.model.AuthConfig in project docker-maven-plugin by fabric8io.
the class AuthConfigFactoryTest method getAuthConfigViaAwsSdk.
@Test
public void getAuthConfigViaAwsSdk() throws MojoExecutionException {
String accessKeyId = randomUUID().toString();
String secretAccessKey = randomUUID().toString();
new MockedAwsSdkAuthConfigFactory(accessKeyId, secretAccessKey);
AuthConfig authConfig = factory.createAuthConfig(false, true, null, settings, "user", ECR_NAME);
verifyAuthConfig(authConfig, accessKeyId, secretAccessKey, null, null);
}
use of io.fabric8.docker.api.model.AuthConfig in project docker-maven-plugin by fabric8io.
the class AuthConfigFactoryTest method ecsTaskRole.
@Test
public void ecsTaskRole() throws IOException, MojoExecutionException {
givenAwsSdkIsDisabled();
String containerCredentialsUri = "/v2/credentials/" + randomUUID().toString();
String accessKeyId = randomUUID().toString();
String secretAccessKey = randomUUID().toString();
String sessionToken = randomUUID().toString();
givenEcsMetadataService(containerCredentialsUri, accessKeyId, secretAccessKey, sessionToken);
setupEcsMetadataConfiguration(httpServer, containerCredentialsUri);
AuthConfig authConfig = factory.createAuthConfig(false, true, null, settings, "user", ECR_NAME);
verifyAuthConfig(authConfig, accessKeyId, secretAccessKey, null, sessionToken);
}
Aggregations