use of com.sequenceiq.environment.api.v1.credential.model.parameters.aws.AwsCredentialParameters in project cloudbreak by hortonworks.
the class AuditCredentialAuthorizationIntegrationTest method getAwsKeyBasedCredentialParameters.
private AwsCredentialParameters getAwsKeyBasedCredentialParameters() {
AwsCredentialParameters aws = new AwsCredentialParameters();
aws.setGovCloud(false);
KeyBasedParameters keyBased = new KeyBasedParameters();
keyBased.setAccessKey("accessKey");
keyBased.setSecretKey("secretKey");
aws.setKeyBased(keyBased);
return aws;
}
use of com.sequenceiq.environment.api.v1.credential.model.parameters.aws.AwsCredentialParameters in project cloudbreak by hortonworks.
the class CredentialAuthorizationIntegrationTest method getAwsKeyBasedCredentialParameters.
private AwsCredentialParameters getAwsKeyBasedCredentialParameters() {
AwsCredentialParameters aws = new AwsCredentialParameters();
aws.setGovCloud(false);
KeyBasedParameters keyBased = new KeyBasedParameters();
keyBased.setAccessKey("accessKey");
keyBased.setSecretKey("secretKey");
aws.setKeyBased(keyBased);
return aws;
}
use of com.sequenceiq.environment.api.v1.credential.model.parameters.aws.AwsCredentialParameters in project cloudbreak by hortonworks.
the class AwsCredentialV1ParametersToAwsCredentialAttributesConverter method convert.
public AwsCredentialParameters convert(AwsCredentialAttributes source) {
AwsCredentialParameters response = new AwsCredentialParameters();
doIfNotNull(source.getKeyBased(), params -> response.setKeyBased(getKeyBased(params)));
doIfNotNull(source.getRoleBased(), params -> response.setRoleBased(getRoleBased(params)));
return response;
}
use of com.sequenceiq.environment.api.v1.credential.model.parameters.aws.AwsCredentialParameters in project cloudbreak by hortonworks.
the class CredentialValidator method validateAwsCredentialRequest.
public ValidationResult validateAwsCredentialRequest(CredentialRequest credentialRequest) {
ValidationResultBuilder resultBuilder = new ValidationResultBuilder();
resultBuilder.ifError(() -> !CloudPlatform.AWS.name().equalsIgnoreCase(credentialRequest.getCloudPlatform()), "Credential request is not for AWS.");
resultBuilder.ifError(() -> StringUtils.isBlank(Optional.ofNullable(credentialRequest.getAws()).map(AwsCredentialParameters::getRoleBased).map(RoleBasedParameters::getRoleArn).orElse(null)), "Role ARN is not found in credential request.");
return resultBuilder.build();
}
use of com.sequenceiq.environment.api.v1.credential.model.parameters.aws.AwsCredentialParameters in project cloudbreak by hortonworks.
the class AwsCloudProvider method awsCredentialDetailsArn.
public AwsCredentialParameters awsCredentialDetailsArn() {
AwsCredentialParameters parameters = new AwsCredentialParameters();
RoleBasedParameters roleBasedCredentialParameters = new RoleBasedParameters();
String roleArn = awsProperties.getCredential().getRoleArn();
roleBasedCredentialParameters.setRoleArn(roleArn);
parameters.setRoleBased(roleBasedCredentialParameters);
return parameters;
}
Aggregations