NIFI-1358 Enable expression language support for AWS processor SECRET_KEY and ACCESS_KEY properties

Signed-off-by: Aldrin Piri <aldrin@apache.org>
This commit is contained in:
Jeremy Dyer 2016-01-21 00:28:42 -08:00 committed by Aldrin Piri
parent bc75dd3c17
commit 7d73ae77f8
2 changed files with 6 additions and 6 deletions

View File

@ -79,14 +79,14 @@ public abstract class AbstractAWSProcessor<ClientType extends AmazonWebServiceCl
.build();
public static final PropertyDescriptor ACCESS_KEY = new PropertyDescriptor.Builder()
.name("Access Key")
.expressionLanguageSupported(false)
.expressionLanguageSupported(true)
.required(false)
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
.sensitive(true)
.build();
public static final PropertyDescriptor SECRET_KEY = new PropertyDescriptor.Builder()
.name("Secret Key")
.expressionLanguageSupported(false)
.expressionLanguageSupported(true)
.required(false)
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
.sensitive(true)
@ -234,8 +234,8 @@ public abstract class AbstractAWSProcessor<ClientType extends AmazonWebServiceCl
}
protected AWSCredentials getCredentials(final ProcessContext context) {
final String accessKey = context.getProperty(ACCESS_KEY).getValue();
final String secretKey = context.getProperty(SECRET_KEY).getValue();
final String accessKey = context.getProperty(ACCESS_KEY).evaluateAttributeExpressions().getValue();
final String secretKey = context.getProperty(SECRET_KEY).evaluateAttributeExpressions().getValue();
final String credentialsFile = context.getProperty(CREDENTIALS_FILE).getValue();

View File

@ -149,8 +149,8 @@ public class AWSCredentialsProviderControllerService extends AbstractControllerS
@OnEnabled
public void onConfigured(final ConfigurationContext context) throws InitializationException {
final String accessKey = context.getProperty(ACCESS_KEY).getValue();
final String secretKey = context.getProperty(SECRET_KEY).getValue();
final String accessKey = context.getProperty(ACCESS_KEY).evaluateAttributeExpressions().getValue();
final String secretKey = context.getProperty(SECRET_KEY).evaluateAttributeExpressions().getValue();
final String assumeRoleArn = context.getProperty(ASSUME_ROLE_ARN).getValue();
final Integer maxSessionTime = context.getProperty(MAX_SESSION_TIME).asInteger();
final String assumeRoleName = context.getProperty(ASSUME_ROLE_NAME).getValue();