Commit 069d94dc authored by Jan Marchel's avatar Jan Marchel
Browse files

integration of ssh key

parent 53416b37
Pipeline #21395 failed with stages
in 24 minutes and 26 seconds
......@@ -18,5 +18,7 @@ public class CloudDefinitionRequest {
private CloudConfigurationRequest cloudConfiguration;
private SSHCredentialsRequest sshCredentialsRequest;
private String id;
}
\ No newline at end of file
}
package eu.melodic.upperware.guibackend.communication.mule.deployment;
import lombok.Builder;
import lombok.Getter;
@Getter
@Builder
public class SSHCredentialsRequest {
private String username;
private String keyPairName;
private String privateKey;
}
package eu.melodic.upperware.guibackend.service.deployment;
import com.google.protobuf.TextFormatParseInfoTree;
import eu.melodic.models.commons.Watermark;
import eu.melodic.models.services.frontend.DeploymentProcessRequest;
import eu.melodic.models.services.frontend.DeploymentProcessRequestImpl;
import eu.melodic.upperware.guibackend.communication.mule.deployment.ApiRequest;
import eu.melodic.upperware.guibackend.communication.mule.deployment.CloudConfigurationRequest;
import eu.melodic.upperware.guibackend.communication.mule.deployment.CloudDefinitionRequest;
import eu.melodic.upperware.guibackend.communication.mule.deployment.CredentialRequest;
import eu.melodic.upperware.guibackend.communication.mule.deployment.*;
import eu.melodic.upperware.guibackend.controller.deployment.request.DeploymentRequest;
import eu.passage.upperware.commons.model.provider.*;
import org.apache.commons.lang3.RandomStringUtils;
......@@ -32,6 +30,7 @@ public class DeploymentMapper {
private List<Object> mapCloudDefinitionsToRequest(List<CloudDefinition> cloudDefinitions) {
return cloudDefinitions.stream().map(cloudDefinition -> CloudDefinitionRequest.builder()
.sshCredentialsRequest(mapSSHCredentialToRequest(cloudDefinition.getSshCredentials()))
.cloudConfiguration(mapCloudConfigurationToRequest(cloudDefinition.getCloudConfiguration()))
.cloudType(cloudDefinition.getCloudType())
.api(mapApiToRequest(cloudDefinition.getApi()))
......@@ -72,4 +71,12 @@ public class DeploymentMapper {
.collect(Collectors.toMap(SingleProperty::getKey, SingleProperty::getValue));
}
private SSHCredentialsRequest mapSSHCredentialToRequest(SSHCredentials sshCredentials) {
return SSHCredentialsRequest.builder()
.username(sshCredentials.getUsername())
.keyPairName(sshCredentials.getKeyPairName())
.privateKey(sshCredentials.getPrivateKey())
.build();
}
}
......@@ -21,4 +21,7 @@ public class CloudDefinition {
private Credential credential;
private CloudConfiguration cloudConfiguration;
private SSHCredentials sshCredentials;
}
package eu.passage.upperware.commons.model.provider;
import lombok.*;
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Setter
@Getter
@ToString
public class SSHCredentials {
private String username;
private String keyPairName;
private String privateKey;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment