use of com.sequenceiq.cloudbreak.clusterproxy.ClientCertificate in project cloudbreak by hortonworks.
the class ClusterProxyService method clientCertificates.
private ClientCertificate clientCertificates(Stack stack) {
Optional<SecurityConfig> securityConfigOptional = securityConfigService.findOneByStackId(stack.getId());
ClientCertificate clientCertificate = null;
if (securityConfigOptional.isPresent() && StringUtils.isNoneBlank(securityConfigOptional.get().getClientCert(), securityConfigOptional.get().getClientCertSecret())) {
SecurityConfig securityConfig = securityConfigOptional.get();
String clientCertRef = vaultPath(securityConfig.getClientCertSecret(), true);
String clientKeyRef = vaultPath(securityConfig.getClientKeySecret(), true);
clientCertificate = new ClientCertificate(clientKeyRef, clientCertRef);
}
return clientCertificate;
}
use of com.sequenceiq.cloudbreak.clusterproxy.ClientCertificate in project cloudbreak by hortonworks.
the class ClusterProxyServiceTest method cmServiceConfigWithInstanceId.
private ClusterServiceConfig cmServiceConfigWithInstanceId(String ipAddress, String instanceId) {
ClusterServiceCredential cloudbreakUser = new ClusterServiceCredential("cloudbreak", "/cb/test-data/secret/cbpassword:secret");
ClusterServiceCredential dpUser = new ClusterServiceCredential("cmmgmt", "/cb/test-data/secret/dppassword:secret", true);
ClientCertificate clientCertificate = new ClientCertificate("/cb/test-data/secret/clientKey:secret:base64", "/cb/test-data/secret/clientCert:secret:base64");
return new ClusterServiceConfig("cb-internal-" + instanceId, List.of("https://" + ipAddress + ":9443"), null, false, asList(cloudbreakUser, dpUser), clientCertificate, null);
}
use of com.sequenceiq.cloudbreak.clusterproxy.ClientCertificate in project cloudbreak by hortonworks.
the class ClusterProxyServiceTest method cmServiceConfig.
private ClusterServiceConfig cmServiceConfig() {
ClusterServiceCredential cloudbreakUser = new ClusterServiceCredential("cloudbreak", "/cb/test-data/secret/cbpassword:secret");
ClusterServiceCredential dpUser = new ClusterServiceCredential("cmmgmt", "/cb/test-data/secret/dppassword:secret", true);
ClientCertificate clientCertificate = new ClientCertificate("/cb/test-data/secret/clientKey:secret:base64", "/cb/test-data/secret/clientCert:secret:base64");
return new ClusterServiceConfig(CLOUDERA_MANAGER_SERVICE, List.of("https://10.10.10.10:9443"), null, false, asList(cloudbreakUser, dpUser), clientCertificate, null);
}
use of com.sequenceiq.cloudbreak.clusterproxy.ClientCertificate in project cloudbreak by hortonworks.
the class ClusterProxyService method createDnsMappedServiceConfigs.
private List<ClusterServiceConfig> createDnsMappedServiceConfigs(Stack stack, List<GatewayConfig> gatewayConfigs, ClientCertificate clientCertificate, boolean preferPrivateIp) {
List<ClusterServiceConfig> serviceConfigs = gatewayConfigs.stream().map(gatewayConfig -> createServiceConfig(stack, gatewayConfig.getHostname(), gatewayConfig, clientCertificate, preferPrivateIp)).collect(Collectors.toList());
List<String> endpoints = gatewayConfigs.stream().map(gatewayConfig -> getNginxEndpointForRegistration(stack, gatewayConfig, preferPrivateIp)).collect(Collectors.toList());
serviceConfigs.add(new ClusterServiceConfig(generateFreeIpaFqdn(stack), endpoints, null, false, List.of(), clientCertificate, getHealthCheck(stack)));
return serviceConfigs;
}
use of com.sequenceiq.cloudbreak.clusterproxy.ClientCertificate in project cloudbreak by hortonworks.
the class ClusterProxyServiceTest method cmInternalServiceConfig.
private ClusterServiceConfig cmInternalServiceConfig(boolean withPrivateIp) {
ClusterServiceCredential cloudbreakUser = new ClusterServiceCredential("cloudbreak", "/cb/test-data/secret/cbpassword:secret");
ClusterServiceCredential dpUser = new ClusterServiceCredential("cmmgmt", "/cb/test-data/secret/dppassword:secret", true);
ClientCertificate clientCertificate = new ClientCertificate("/cb/test-data/secret/clientKey:secret:base64", "/cb/test-data/secret/clientCert:secret:base64");
return new ClusterServiceConfig("cb-internal", List.of(withPrivateIp ? "https://10.10.10.10:9443" : "https://1.2.3.4:9443"), null, false, asList(cloudbreakUser, dpUser), clientCertificate, null);
}
Aggregations