use of org.eclipse.jkube.kit.build.api.auth.AuthConfig in project jkube by eclipse.
the class FromConfigRegistryAuthHandlerTest method testFromPluginConfigurationPull.
@Test
public void testFromPluginConfigurationPull() {
FromConfigRegistryAuthHandler handler = new FromConfigRegistryAuthHandler(setupAuthConfigFactoryWithConfigDataForKind(RegistryAuthConfig.Kind.PULL), log);
AuthConfig config = handler.create(RegistryAuthConfig.Kind.PULL, null, null, s -> s);
verifyAuthConfig(config, "roland", "secret", "roland@jolokia.org");
}
use of org.eclipse.jkube.kit.build.api.auth.AuthConfig in project jkube by eclipse.
the class FromConfigRegistryAuthHandlerTest method testFromPluginConfiguration.
@Test
public void testFromPluginConfiguration() throws IOException {
FromConfigRegistryAuthHandler handler = new FromConfigRegistryAuthHandler(setupAuthConfigFactoryWithConfigData(), log);
AuthConfig config = handler.create(RegistryAuthConfig.Kind.PUSH, null, null, s -> s);
verifyAuthConfig(config, "roland", "secret", "roland@jolokia.org");
}
use of org.eclipse.jkube.kit.build.api.auth.AuthConfig in project jkube by eclipse.
the class OpenShiftRegistryAuthHandlerTest method testOpenShiftConfigFromSystemProps.
@Test
public void testOpenShiftConfigFromSystemProps() throws Exception {
try {
System.setProperty("docker.useOpenShiftAuth", "true");
executeWithTempHomeDir(homeDir -> {
createOpenShiftConfig(homeDir, "openshift_simple_config.yaml");
AuthConfig config = handler.create(RegistryAuthConfig.Kind.PUSH, "roland", null, s -> s);
verifyAuthConfig(config, "admin", "token123", null);
});
} finally {
System.getProperties().remove("docker.useOpenShiftAuth");
}
}
use of org.eclipse.jkube.kit.build.api.auth.AuthConfig in project jkube by eclipse.
the class OpenShiftRegistryAuthHandlerTest method testOpenShiftConfigFromPluginConfig.
@Test
public void testOpenShiftConfigFromPluginConfig() throws Exception {
executeWithTempHomeDir(homeDir -> {
createOpenShiftConfig(homeDir, "openshift_simple_config.yaml");
AuthConfig config = handler.create(RegistryAuthConfig.Kind.PUSH, "roland", null, s -> s);
verifyAuthConfig(config, "admin", "token123", null);
});
}
use of org.eclipse.jkube.kit.build.api.auth.AuthConfig in project jkube by eclipse.
the class SystemPropertyRegistryAuthHandlerTest method testSystemProperty.
@Test
public void testSystemProperty() throws Exception {
System.setProperty("jkube.docker.push.username", "roland");
System.setProperty("jkube.docker.push.password", "secret");
System.setProperty("jkube.docker.push.email", "roland@jolokia.org");
try {
AuthConfig config = handler.create(RegistryAuthConfig.Kind.PUSH, null, null, s -> s);
verifyAuthConfig(config, "roland", "secret", "roland@jolokia.org");
} finally {
System.clearProperty("jkube.docker.push.username");
System.clearProperty("jkube.docker.push.password");
System.clearProperty("jkube.docker.push.email");
}
}
Aggregations