Search in sources :

Example 11 with LdapConfig

use of com.sequenceiq.freeipa.ldap.LdapConfig in project cloudbreak by hortonworks.

the class LdapConfigV1Service method convertMinimalLdapConfigRequestToLdapConfig.

private LdapConfig convertMinimalLdapConfigRequestToLdapConfig(MinimalLdapConfigRequest minimalLdapConfigRequest) {
    LdapConfig config = new LdapConfig();
    config.setBindDn(minimalLdapConfigRequest.getBindDn());
    config.setBindPassword(minimalLdapConfigRequest.getBindPassword());
    config.setServerHost(minimalLdapConfigRequest.getHost());
    config.setServerPort(minimalLdapConfigRequest.getPort());
    config.setProtocol(minimalLdapConfigRequest.getProtocol());
    return config;
}
Also used : LdapConfig(com.sequenceiq.freeipa.ldap.LdapConfig)

Example 12 with LdapConfig

use of com.sequenceiq.freeipa.ldap.LdapConfig in project cloudbreak by hortonworks.

the class LdapConfigV1Service method testConnection.

public TestLdapConfigResponse testConnection(TestLdapConfigRequest testLdapConfigRequest) {
    LdapConfig ldapConfig = null;
    if (testLdapConfigRequest.getLdap() != null) {
        ldapConfig = convertMinimalLdapConfigRequestToLdapConfig(testLdapConfigRequest.getLdap());
    }
    String result = ldapConfigService.testConnection(testLdapConfigRequest.getEnvironmentCrn(), ldapConfig);
    TestLdapConfigResponse testLdapConfigResponse = new TestLdapConfigResponse();
    testLdapConfigResponse.setResult(result);
    return testLdapConfigResponse;
}
Also used : LdapConfig(com.sequenceiq.freeipa.ldap.LdapConfig) TestLdapConfigResponse(com.sequenceiq.freeipa.api.v1.ldap.model.test.TestLdapConfigResponse)

Example 13 with LdapConfig

use of com.sequenceiq.freeipa.ldap.LdapConfig in project cloudbreak by hortonworks.

the class LdapConfigV1Service method post.

public DescribeLdapConfigResponse post(CreateLdapConfigRequest createLdapConfigRequest) {
    LdapConfig ldapConfig = convertCreateLdapConfigRequest(createLdapConfigRequest);
    ldapConfig = ldapConfigService.createLdapConfig(ldapConfig);
    return convertLdapConfigToDescribeLdapConfigResponse(ldapConfig);
}
Also used : LdapConfig(com.sequenceiq.freeipa.ldap.LdapConfig)

Aggregations

LdapConfig (com.sequenceiq.freeipa.ldap.LdapConfig)13 Test (org.junit.Test)3 SecretResponse (com.sequenceiq.cloudbreak.service.secret.model.SecretResponse)2 CreateLdapConfigRequest (com.sequenceiq.freeipa.api.v1.ldap.model.create.CreateLdapConfigRequest)2 DescribeLdapConfigResponse (com.sequenceiq.freeipa.api.v1.ldap.model.describe.DescribeLdapConfigResponse)2 FreeIpa (com.sequenceiq.freeipa.entity.FreeIpa)2 Stack (com.sequenceiq.freeipa.entity.Stack)2 CreateBindUserEvent (com.sequenceiq.freeipa.flow.freeipa.binduser.create.event.CreateBindUserEvent)2 Test (org.junit.jupiter.api.Test)2 Selectable (com.sequenceiq.cloudbreak.common.event.Selectable)1 HandlerEvent (com.sequenceiq.flow.reactor.api.handler.HandlerEvent)1 TestLdapConfigResponse (com.sequenceiq.freeipa.api.v1.ldap.model.test.TestLdapConfigResponse)1 InstanceGroup (com.sequenceiq.freeipa.entity.InstanceGroup)1 InstanceMetaData (com.sequenceiq.freeipa.entity.InstanceMetaData)1 CreateLdapBindUserEvent (com.sequenceiq.freeipa.flow.freeipa.binduser.create.event.CreateLdapBindUserEvent)1