use of com.sequenceiq.cloudbreak.api.model.KerberosRequest in project cloudbreak by hortonworks.
the class KerberosConfigToKerberosRequestConverter method convert.
@Override
public KerberosRequest convert(KerberosConfig source) {
KerberosRequest config = new KerberosRequest();
config.setTcpAllowed(source.getTcpAllowed());
config.setPassword("");
switch(source.getType()) {
case CB_MANAGED:
config.setMasterKey("");
config.setAdmin(source.getAdmin());
break;
case EXISTING_AD:
config.setPrincipal(source.getPrincipal());
config.setUrl(source.getUrl());
config.setAdminUrl(source.getAdminUrl());
config.setRealm(source.getRealm());
config.setLdapUrl(source.getLdapUrl());
config.setContainerDn(source.getContainerDn());
break;
case EXISTING_MIT:
config.setPrincipal(source.getPrincipal());
config.setUrl(source.getUrl());
config.setAdminUrl(source.getAdminUrl());
config.setRealm(source.getRealm());
break;
case CUSTOM:
config.setPrincipal(source.getPrincipal());
config.setDescriptor(source.getDescriptor());
config.setKrb5Conf(source.getKrb5Conf());
break;
default:
}
return config;
}
use of com.sequenceiq.cloudbreak.api.model.KerberosRequest in project cloudbreak by hortonworks.
the class AbstractStackCreationV2Test method ambariParameters.
@BeforeMethod(dependsOnGroups = "V2StackCreationInit")
@Parameters({ "blueprintName", "enableSecurity", "kerberosMasterKey", "kerberosAdmin", "kerberosPassword" })
public void ambariParameters(@Optional("") String blueprintName, @Optional("false") boolean enableSecurity, @Optional String kerberosMasterKey, @Optional String kerberosAdmin, @Optional String kerberosPassword) {
IntegrationTestContext itContext = getItContext();
blueprintName = StringUtils.hasText(blueprintName) ? blueprintName : itContext.getContextParam(CloudbreakV2Constants.SSH_PUBLICKEY_ID);
Assert.assertNotNull(itContext.getContextParam(CloudbreakITContextConstants.AMBARI_USER_ID), "Ambari user is mandatory.");
Assert.assertNotNull(itContext.getContextParam(CloudbreakITContextConstants.AMBARI_PASSWORD_ID), "Ambari password is mandatory.");
Assert.assertNotNull(blueprintName, "blueprint name is mandatory.");
StackV2Request stackV2Request = itContext.getContextParam(CloudbreakV2Constants.STACK_CREATION_REQUEST, StackV2Request.class);
ClusterV2Request clusterV2Request = new ClusterV2Request();
stackV2Request.setCluster(clusterV2Request);
AmbariV2Request ambariV2Request = new AmbariV2Request();
clusterV2Request.setAmbari(ambariV2Request);
ambariV2Request.setBlueprintName(blueprintName);
ambariV2Request.setUserName(itContext.getContextParam(CloudbreakITContextConstants.AMBARI_USER_ID));
ambariV2Request.setPassword(itContext.getContextParam(CloudbreakITContextConstants.AMBARI_PASSWORD_ID));
GatewayJson gatewayJson = new GatewayJson();
gatewayJson.setEnableGateway(Boolean.FALSE);
gatewayJson.setExposedServices(ImmutableList.of("ALL"));
ambariV2Request.setGateway(gatewayJson);
if (enableSecurity) {
ambariV2Request.setEnableSecurity(enableSecurity);
KerberosRequest kerberosRequest = new KerberosRequest();
kerberosRequest.setMasterKey(kerberosMasterKey);
kerberosRequest.setAdmin(kerberosAdmin);
kerberosRequest.setPassword(kerberosPassword);
ambariV2Request.setKerberos(kerberosRequest);
}
}
use of com.sequenceiq.cloudbreak.api.model.KerberosRequest in project cloudbreak by hortonworks.
the class KerberosTypeTest method testCloudbreakManaged.
@Test
public void testCloudbreakManaged() {
KerberosRequest request = new KerberosRequest();
request.setMasterKey("mk");
request.setAdmin("adm");
request.setPassword("pwd");
Assert.assertEquals(KerberosType.CB_MANAGED, KerberosType.valueOf(request));
}
use of com.sequenceiq.cloudbreak.api.model.KerberosRequest in project cloudbreak by hortonworks.
the class KerberosTypeTest method testExistingMit.
@Test
public void testExistingMit() {
KerberosRequest request = new KerberosRequest();
request.setPrincipal("prnc");
request.setPassword("pwd");
request.setUrl("url");
request.setAdminUrl("admurl");
request.setRealm("rlm");
Assert.assertEquals(KerberosType.EXISTING_MIT, KerberosType.valueOf(request));
}
use of com.sequenceiq.cloudbreak.api.model.KerberosRequest in project cloudbreak by hortonworks.
the class KerberosTypeTest method testCloudbreakManagedMissing.
@Test
public void testCloudbreakManagedMissing() {
KerberosRequest request = new KerberosRequest();
request.setMasterKey("mk");
request.setAdmin("adm");
Assert.assertNull(KerberosType.valueOf(request));
}
Aggregations