Search in sources :

Example 6 with AuthConfig

use of io.fabric8.docker.api.model.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);
    AuthConfig config = factory.createAuthConfig(isPush, false, null, settings, "roland", lookupRegistry);
    verifyAuthConfig(config, "roland", "secret", "roland@jolokia.org");
}
Also used : AuthConfig(io.fabric8.maven.docker.access.AuthConfig)

Example 7 with AuthConfig

use of io.fabric8.docker.api.model.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");
    }
}
Also used : AuthConfig(io.fabric8.maven.docker.access.AuthConfig) Test(org.junit.Test)

Example 8 with AuthConfig

use of io.fabric8.docker.api.model.AuthConfig in project docker-maven-plugin by fabric8io.

the class AuthConfigFactoryTest method testFromPluginConfiguration.

@Test
public void testFromPluginConfiguration() throws MojoExecutionException {
    Map pluginConfig = new HashMap();
    pluginConfig.put("username", "roland");
    pluginConfig.put("password", "secret");
    pluginConfig.put("email", "roland@jolokia.org");
    AuthConfig config = factory.createAuthConfig(isPush, false, pluginConfig, settings, null, null);
    verifyAuthConfig(config, "roland", "secret", "roland@jolokia.org");
}
Also used : HashMap(java.util.HashMap) AuthConfig(io.fabric8.maven.docker.access.AuthConfig) HashMap(java.util.HashMap) Map(java.util.Map) Collections.singletonMap(java.util.Collections.singletonMap) Test(org.junit.Test)

Example 9 with AuthConfig

use of io.fabric8.docker.api.model.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("username", "roland");
    map.put("password", "secret");
    map.put("email", "roland@jolokia.org");
    AuthConfig config = new AuthConfig(map);
    check(config);
}
Also used : HashMap(java.util.HashMap) AuthConfig(io.fabric8.maven.docker.access.AuthConfig) Test(org.junit.Test)

Example 10 with AuthConfig

use of io.fabric8.docker.api.model.AuthConfig in project docker-maven-plugin by fabric8io.

the class AuthConfigTest method dockerLoginConstructor.

@Test
public void dockerLoginConstructor() {
    AuthConfig config = new AuthConfig(Base64.encodeBase64String("roland:secret".getBytes()), "roland@jolokia.org");
    check(config);
}
Also used : AuthConfig(io.fabric8.maven.docker.access.AuthConfig) Test(org.junit.Test)

Aggregations

AuthConfig (io.fabric8.maven.docker.access.AuthConfig)22 Test (org.junit.Test)13 HashMap (java.util.HashMap)5 Map (java.util.Map)4 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)4 Date (java.util.Date)3 Collections.singletonMap (java.util.Collections.singletonMap)2 Properties (java.util.Properties)2 HttpPost (org.apache.http.client.methods.HttpPost)2 StringEntity (org.apache.http.entity.StringEntity)2 JSONObject (org.json.JSONObject)2 AuthConfig (io.fabric8.docker.api.model.AuthConfig)1 AuthConfigBuilder (io.fabric8.docker.api.model.AuthConfigBuilder)1 Config (io.fabric8.docker.client.Config)1 ConfigBuilder (io.fabric8.docker.client.ConfigBuilder)1 DefaultDockerClient (io.fabric8.docker.client.DefaultDockerClient)1 DockerClient (io.fabric8.docker.client.DockerClient)1 EventListener (io.fabric8.docker.dsl.EventListener)1 OutputHandle (io.fabric8.docker.dsl.OutputHandle)1 BuildImageConfiguration (io.fabric8.maven.docker.config.BuildImageConfiguration)1