Search in sources :

Example 11 with ProxyConfig

use of com.sequenceiq.cloudbreak.domain.ProxyConfig in project cloudbreak by hortonworks.

the class ProxyConfigController method getPrivates.

@Override
public Set<ProxyConfigResponse> getPrivates() {
    IdentityUser user = authenticatedUserService.getCbUser();
    Set<ProxyConfig> proxyConfigs = proxyConfigService.retrievePrivateProxyConfigs(user);
    return proxyConfigMapper.mapEntityToResponse(proxyConfigs);
}
Also used : IdentityUser(com.sequenceiq.cloudbreak.common.model.user.IdentityUser) ProxyConfig(com.sequenceiq.cloudbreak.domain.ProxyConfig)

Example 12 with ProxyConfig

use of com.sequenceiq.cloudbreak.domain.ProxyConfig in project cloudbreak by hortonworks.

the class ProxyConfigController method getPublics.

@Override
public Set<ProxyConfigResponse> getPublics() {
    IdentityUser user = authenticatedUserService.getCbUser();
    Set<ProxyConfig> proxyConfigs = proxyConfigService.retrieveAccountProxyConfigs(user);
    return proxyConfigMapper.mapEntityToResponse(proxyConfigs);
}
Also used : IdentityUser(com.sequenceiq.cloudbreak.common.model.user.IdentityUser) ProxyConfig(com.sequenceiq.cloudbreak.domain.ProxyConfig)

Example 13 with ProxyConfig

use of com.sequenceiq.cloudbreak.domain.ProxyConfig in project cloudbreak by hortonworks.

the class ProxyConfigController method getPublic.

@Override
public ProxyConfigResponse getPublic(String name) {
    IdentityUser user = authenticatedUserService.getCbUser();
    ProxyConfig proxyConfig = proxyConfigService.getPublicProxyConfig(name, user);
    return proxyConfigMapper.mapEntityToResponse(proxyConfig);
}
Also used : IdentityUser(com.sequenceiq.cloudbreak.common.model.user.IdentityUser) ProxyConfig(com.sequenceiq.cloudbreak.domain.ProxyConfig)

Example 14 with ProxyConfig

use of com.sequenceiq.cloudbreak.domain.ProxyConfig in project cloudbreak by hortonworks.

the class ProxyConfigProviderTest method testWithAuthProxy.

@Test
public void testWithAuthProxy() {
    ProxyConfig proxyConfig = new ProxyConfig();
    proxyConfig.setUserName("test");
    proxyConfig.setPassword("test");
    Map<String, Object> properties = testProxyCore(proxyConfig);
    assertTrue(StringUtils.isNotBlank((String) properties.get("user")));
    assertTrue(StringUtils.isNotBlank((String) properties.get("password")));
}
Also used : ProxyConfig(com.sequenceiq.cloudbreak.domain.ProxyConfig) Test(org.junit.Test)

Example 15 with ProxyConfig

use of com.sequenceiq.cloudbreak.domain.ProxyConfig in project cloudbreak by hortonworks.

the class ProxyConfigProviderTest method testWithoutAuthProxy.

@Test
public void testWithoutAuthProxy() {
    ProxyConfig proxyConfig = new ProxyConfig();
    Map<String, Object> properties = testProxyCore(proxyConfig);
    assertTrue(StringUtils.isNotBlank((String) properties.get("host")));
    assertTrue(StringUtils.isNotBlank((String) properties.get("protocol")));
    assertNotNull(properties.get("port"));
    assertFalse(properties.containsKey("user"));
    assertFalse(properties.containsKey("password"));
}
Also used : ProxyConfig(com.sequenceiq.cloudbreak.domain.ProxyConfig) Test(org.junit.Test)

Aggregations

ProxyConfig (com.sequenceiq.cloudbreak.domain.ProxyConfig)19 IdentityUser (com.sequenceiq.cloudbreak.common.model.user.IdentityUser)5 NotFoundException (com.sequenceiq.cloudbreak.controller.NotFoundException)5 Test (org.junit.Test)4 Cluster (com.sequenceiq.cloudbreak.domain.Cluster)2 ProxyConfigRequest (com.sequenceiq.cloudbreak.api.model.proxy.ProxyConfigRequest)1 Blueprint (com.sequenceiq.cloudbreak.domain.Blueprint)1 Stack (com.sequenceiq.cloudbreak.domain.Stack)1 SaltPillarProperties (com.sequenceiq.cloudbreak.orchestrator.model.SaltPillarProperties)1 HashMap (java.util.HashMap)1 Transactional (javax.transaction.Transactional)1 Before (org.junit.Before)1