Package org.jolokia.docker.maven.access

Examples of org.jolokia.docker.maven.access.AuthConfig


            throw new MojoExecutionException("No " + DOCKER_USERNAME + " given when using authentication");
        }
        if (!props.containsKey(DOCKER_PASSWORD)) {
            throw new MojoExecutionException("No " + DOCKER_PASSWORD + " provided for username " + props.getProperty(DOCKER_USERNAME));
        }
        return new AuthConfig(props.getProperty(DOCKER_USERNAME),
                              decrypt(props.getProperty(DOCKER_PASSWORD)),
                              props.getProperty(DOCKER_EMAIL),
                              props.getProperty(DOCKER_AUTH));
    }
View Full Code Here


                throw new MojoExecutionException("No '" + key + "' given while using <authConfig> in configuration");
            }
        }
        Map<String,String> cloneConfig = new HashMap<String,String>(authConfig);
        cloneConfig.put("password",decrypt(cloneConfig.get("password")));
        return new AuthConfig(cloneConfig);
    }
View Full Code Here

    private AuthConfig getAuthConfigFromSettings(String image, Settings settings) throws MojoExecutionException {
        String registry = getRegistryFromImageNameOrDefault(image);
        Server server = settings.getServer(registry);
        if (server != null) {
            return new AuthConfig(
                    server.getUsername(),
                    decrypt(server.getPassword()),
                    extractFromServerConfiguration(server.getConfiguration(), "email"),
                    extractFromServerConfiguration(server.getConfiguration(), "auth")
            );
View Full Code Here

    public void testSystemProperty() throws Exception {
        System.setProperty("docker.username","roland");
        System.setProperty("docker.password", "secret");
        System.setProperty("docker.email", "roland@jolokia.org");
        try {
            AuthConfig config = factory.createAuthConfig(null,"test/test",settings);
            verifyAuthConfig(config,"roland","secret","roland@jolokia.org");
        } finally {
            System.clearProperty("docker.username");
            System.clearProperty("docker.password");
            System.clearProperty("docker.email");
View Full Code Here

        Map pluginConfig = new HashMap();
        pluginConfig.put("username", "roland");
        pluginConfig.put("password", "secret");
        pluginConfig.put("email", "roland@jolokia.org");

        AuthConfig config = factory.createAuthConfig(pluginConfig,"test/test",settings);
        verifyAuthConfig(config,"roland","secret","roland@jolokia.org");
    }
View Full Code Here

            dom.addChild(email);
            server.setConfiguration(dom);
            result = server;
        }};

        AuthConfig config = factory.createAuthConfig(null,"test.org/test",settings);
        verifyAuthConfig(config,"roland","secret","roland@jolokia.org");
    }
View Full Code Here

    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);
    }
View Full Code Here

        check(config);
    }

    @Test
    public void mapConstructor() {
        AuthConfig config = new AuthConfig("roland","secret","roland@jolokia.org",null);
        check(config);
    }
View Full Code Here

TOP

Related Classes of org.jolokia.docker.maven.access.AuthConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.