use of com.sequenceiq.cloudbreak.domain.ProxyConfig in project cloudbreak by hortonworks.
the class ProxyConfigService method delete.
public void delete(Long id, IdentityUser user) {
ProxyConfig proxyConfig = proxyConfigRepository.findByIdAndAccount(id, user.getAccount());
if (proxyConfig == null) {
throw new NotFoundException(String.format("Proxy configuration '%s' not found.", id));
}
authorizationService.hasWritePermission(proxyConfig);
delete(proxyConfig);
}
use of com.sequenceiq.cloudbreak.domain.ProxyConfig in project cloudbreak by hortonworks.
the class ProxyConfigService method get.
public ProxyConfig get(Long id) {
ProxyConfig proxyConfig = proxyConfigRepository.findOne(id);
if (proxyConfig == null) {
throw new NotFoundException(String.format("Proxy configuration '%s' not found.", id));
}
authorizationService.hasReadPermission(proxyConfig);
return proxyConfig;
}
use of com.sequenceiq.cloudbreak.domain.ProxyConfig in project cloudbreak by hortonworks.
the class ProxyConfigService method delete.
public void delete(String name, IdentityUser user) {
ProxyConfig proxyConfig = proxyConfigRepository.findByNameBasedOnAccount(name, user.getAccount(), user.getUserId());
if (proxyConfig == null) {
throw new NotFoundException(String.format("Proxy configuration '%s' not found.", name));
}
authorizationService.hasWritePermission(proxyConfig);
delete(proxyConfig);
}
use of com.sequenceiq.cloudbreak.domain.ProxyConfig in project cloudbreak by hortonworks.
the class ClusterProxyDecoratorTest method setUp.
@Before
public void setUp() {
when(mapper.mapRequestToEntity(any(ProxyConfigRequest.class), anyBoolean())).thenReturn(new ProxyConfig());
when(service.create(any(IdentityUser.class), any(ProxyConfig.class))).thenReturn(new ProxyConfig());
when(service.getPublicProxyConfig(anyString(), eq(identityUser))).thenReturn(new ProxyConfig());
cluster = new Cluster();
stack.setPublicInAccount(true);
}
use of com.sequenceiq.cloudbreak.domain.ProxyConfig in project cloudbreak by hortonworks.
the class ProxyConfigProviderTest method testWithoutAuthUsernameSetProxy.
@Test
public void testWithoutAuthUsernameSetProxy() {
ProxyConfig proxyConfig = new ProxyConfig();
proxyConfig.setUserName("test");
Map<String, Object> properties = testProxyCore(proxyConfig);
assertFalse(properties.containsKey("user"));
assertFalse(properties.containsKey("password"));
}
Aggregations