Search in sources :

Example 1 with StackAuthenticationV4Request

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.authentication.StackAuthenticationV4Request in project cloudbreak by hortonworks.

the class StackAuthenticationToStackAuthenticationV4RequestConverter method convert.

public StackAuthenticationV4Request convert(StackAuthentication source) {
    StackAuthenticationV4Request stackAuthenticationRequest = new StackAuthenticationV4Request();
    stackAuthenticationRequest.setLoginUserName(null);
    stackAuthenticationRequest.setPublicKey(source.getPublicKey());
    stackAuthenticationRequest.setPublicKeyId(source.getPublicKeyId());
    return stackAuthenticationRequest;
}
Also used : StackAuthenticationV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.authentication.StackAuthenticationV4Request)

Example 2 with StackAuthenticationV4Request

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.authentication.StackAuthenticationV4Request in project cloudbreak by hortonworks.

the class FreeIpaTestDto method withAuthentication.

private FreeIpaTestDto withAuthentication(StackAuthenticationTestDto stackAuthentication) {
    StackAuthenticationV4Request request = stackAuthentication.getRequest();
    StackAuthenticationRequest authReq = new StackAuthenticationRequest();
    authReq.setLoginUserName(request.getLoginUserName());
    authReq.setPublicKey(request.getPublicKey());
    authReq.setPublicKeyId(request.getPublicKeyId());
    getRequest().setAuthentication(authReq);
    return this;
}
Also used : StackAuthenticationV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.authentication.StackAuthenticationV4Request) StackAuthenticationRequest(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.security.StackAuthenticationRequest)

Example 3 with StackAuthenticationV4Request

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.authentication.StackAuthenticationV4Request in project cloudbreak by hortonworks.

the class DistroXAuthenticationToStaAuthenticationConverterTest method testConvertEnvironmentAuthenticationResponseToStackAuthenticationV4Request.

@Test
void testConvertEnvironmentAuthenticationResponseToStackAuthenticationV4Request() {
    EnvironmentAuthenticationResponse input = new EnvironmentAuthenticationResponse();
    input.setPublicKey("somePublicKey");
    input.setPublicKeyId("somePublicKeyId");
    input.setLoginUserName("someLoginUserName");
    StackAuthenticationV4Request result = underTest.convert(input);
    assertNotNull(result);
    assertNull(result.getLoginUserName());
    assertEquals(input.getPublicKey(), result.getPublicKey());
    assertEquals(input.getPublicKeyId(), result.getPublicKeyId());
}
Also used : StackAuthenticationV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.authentication.StackAuthenticationV4Request) EnvironmentAuthenticationResponse(com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentAuthenticationResponse) Test(org.junit.jupiter.api.Test)

Example 4 with StackAuthenticationV4Request

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.authentication.StackAuthenticationV4Request in project cloudbreak by hortonworks.

the class DistroXAuthenticationToStaAuthenticationConverter method convert.

public StackAuthenticationV4Request convert(EnvironmentAuthenticationResponse source) {
    StackAuthenticationV4Request response = new StackAuthenticationV4Request();
    // response.setLoginUserName(source.getLoginUserName());
    response.setPublicKey(source.getPublicKey());
    response.setPublicKeyId(source.getPublicKeyId());
    return response;
}
Also used : StackAuthenticationV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.authentication.StackAuthenticationV4Request)

Example 5 with StackAuthenticationV4Request

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.authentication.StackAuthenticationV4Request in project cloudbreak by hortonworks.

the class StackRequestManifester method setupAuthentication.

private void setupAuthentication(DetailedEnvironmentResponse environment, StackV4Request stackRequest) {
    if (stackRequest.getAuthentication() == null) {
        StackAuthenticationV4Request stackAuthenticationV4Request = new StackAuthenticationV4Request();
        stackAuthenticationV4Request.setPublicKey(environment.getAuthentication().getPublicKey());
        stackAuthenticationV4Request.setPublicKeyId(environment.getAuthentication().getPublicKeyId());
        stackRequest.setAuthentication(stackAuthenticationV4Request);
    }
}
Also used : StackAuthenticationV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.authentication.StackAuthenticationV4Request)

Aggregations

StackAuthenticationV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.authentication.StackAuthenticationV4Request)5 EnvironmentAuthenticationResponse (com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentAuthenticationResponse)1 StackAuthenticationRequest (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.security.StackAuthenticationRequest)1 Test (org.junit.jupiter.api.Test)1