use of com.sequenceiq.environment.api.v1.credential.model.parameters.aws.AwsCredentialParameters in project cloudbreak by hortonworks.
the class CredentialValidatorTest method testValidateAwsCredentialRequestKeyBased.
@Test
void testValidateAwsCredentialRequestKeyBased() {
CredentialRequest request = new CredentialRequest();
request.setCloudPlatform("AWS");
request.setAws(new AwsCredentialParameters());
ValidationResult result = underTest.validateAwsCredentialRequest(request);
assertTrue(result.hasError());
assertEquals("Role ARN is not found in credential request.", result.getErrors().get(0));
}
use of com.sequenceiq.environment.api.v1.credential.model.parameters.aws.AwsCredentialParameters in project cloudbreak by hortonworks.
the class AwsCloudProvider method awsCredentialDetailsKey.
public AwsCredentialParameters awsCredentialDetailsKey() {
AwsCredentialParameters parameters = new AwsCredentialParameters();
KeyBasedParameters keyBasedCredentialParameters = new KeyBasedParameters();
String accessKeyId = awsProperties.getCredential().getAccessKeyId();
keyBasedCredentialParameters.setAccessKey(accessKeyId);
String secretKey = awsProperties.getCredential().getSecretKey();
keyBasedCredentialParameters.setSecretKey(secretKey);
parameters.setKeyBased(keyBasedCredentialParameters);
return parameters;
}
use of com.sequenceiq.environment.api.v1.credential.model.parameters.aws.AwsCredentialParameters in project cloudbreak by hortonworks.
the class CredentialValidatorTest method testValidateAwsCredentialRequestValid.
@Test
void testValidateAwsCredentialRequestValid() {
CredentialRequest request = new CredentialRequest();
request.setCloudPlatform("AWS");
AwsCredentialParameters aws = new AwsCredentialParameters();
RoleBasedParameters roleBased = new RoleBasedParameters();
roleBased.setRoleArn("arn");
aws.setRoleBased(roleBased);
request.setAws(aws);
ValidationResult result = underTest.validateAwsCredentialRequest(request);
assertFalse(result.hasError());
}
use of com.sequenceiq.environment.api.v1.credential.model.parameters.aws.AwsCredentialParameters in project cloudbreak by hortonworks.
the class CredentialValidatorTest method testValidateAwsCredentialRequestNoArn.
@Test
void testValidateAwsCredentialRequestNoArn() {
CredentialRequest request = new CredentialRequest();
request.setCloudPlatform("AWS");
AwsCredentialParameters aws = new AwsCredentialParameters();
aws.setRoleBased(new RoleBasedParameters());
request.setAws(aws);
ValidationResult result = underTest.validateAwsCredentialRequest(request);
assertTrue(result.hasError());
assertEquals("Role ARN is not found in credential request.", result.getErrors().get(0));
}
use of com.sequenceiq.environment.api.v1.credential.model.parameters.aws.AwsCredentialParameters in project cloudbreak by hortonworks.
the class EnvironmentServiceIntegrationTest method getAwsKeyBasedCredentialParameters.
private AwsCredentialParameters getAwsKeyBasedCredentialParameters(boolean govCloud, String yyy, String zzzz) {
AwsCredentialParameters aws = new AwsCredentialParameters();
aws.setGovCloud(govCloud);
KeyBasedParameters keyBased = new KeyBasedParameters();
keyBased.setAccessKey(yyy);
keyBased.setSecretKey(zzzz);
aws.setKeyBased(keyBased);
return aws;
}
Aggregations