Search in sources :

Example 11 with ProxyConfig

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

the class ProxyController method getByName.

@Override
@CheckPermissionByAccount(action = AuthorizationResourceAction.POWERUSER_ONLY)
public ProxyResponse getByName(String name) {
    String accountId = ThreadBasedUserCrnProvider.getAccountId();
    ProxyConfig config = proxyConfigService.getByNameForAccountId(name, accountId);
    return proxyConfigToProxyResponseConverter.convert(config);
}
Also used : ProxyConfig(com.sequenceiq.environment.proxy.domain.ProxyConfig) CheckPermissionByAccount(com.sequenceiq.authorization.annotation.CheckPermissionByAccount)

Example 12 with ProxyConfig

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

the class ProxyRequestToProxyConfigConverter method convert.

public ProxyConfig convert(ProxyRequest source) {
    ProxyConfig proxyConfig = new ProxyConfig();
    proxyConfig.setName(source.getName());
    proxyConfig.setDescription(source.getDescription());
    proxyConfig.setProtocol(source.getProtocol());
    proxyConfig.setServerHost(source.getHost());
    proxyConfig.setServerPort(source.getPort());
    if (StringUtils.isNoneBlank(source.getUserName(), source.getPassword())) {
        proxyConfig.setUserName(source.getUserName());
        proxyConfig.setPassword(source.getPassword());
    }
    proxyConfig.setNoProxyHosts(source.getNoProxyHosts());
    return proxyConfig;
}
Also used : ProxyConfig(com.sequenceiq.environment.proxy.domain.ProxyConfig)

Aggregations

ProxyConfig (com.sequenceiq.environment.proxy.domain.ProxyConfig)12 CheckPermissionByAccount (com.sequenceiq.authorization.annotation.CheckPermissionByAccount)4 Test (org.junit.jupiter.api.Test)2 ProxyRequest (com.sequenceiq.environment.api.v1.proxy.model.request.ProxyRequest)1 ProxyResponse (com.sequenceiq.environment.api.v1.proxy.model.response.ProxyResponse)1 Credential (com.sequenceiq.environment.credential.domain.Credential)1 Environment (com.sequenceiq.environment.environment.domain.Environment)1 ProxyTestSource.getProxyConfig (com.sequenceiq.environment.proxy.v1.ProxyTestSource.getProxyConfig)1 ProxyTestSource.getProxyRequest (com.sequenceiq.environment.proxy.v1.ProxyTestSource.getProxyRequest)1 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)1