You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2021/12/05 20:49:03 UTC

[GitHub] [nifi] gresockj commented on a change in pull request #5504: NIFI-9353: Adding Config Verification to AWS Processors

gresockj commented on a change in pull request #5504:
URL: https://github.com/apache/nifi/pull/5504#discussion_r762613551



##########
File path: nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/FetchS3Object.java
##########
@@ -148,6 +153,37 @@
         return problems;
     }
 
+    @Override
+    public List<ConfigVerificationResult> verify(ProcessContext context, ComponentLog verificationLogger, Map<String, String> attributes) {
+        final List<ConfigVerificationResult> results = new ArrayList<>(super.verify(context, verificationLogger, attributes));
+
+        final String bucket = context.getProperty(BUCKET).evaluateAttributeExpressions(attributes).getValue();
+        final String key = context.getProperty(KEY).evaluateAttributeExpressions(attributes).getValue();
+
+        final AmazonS3 client = getConfiguration(context).getClient();
+        final GetObjectRequest request = createGetObjectRequest(context, attributes);
+
+        try (final S3Object s3Object = client.getObject(request)) {

Review comment:
       Yes, so that's the downside -- the tradeoff between requiring different policies vs. a potentially heavy request.  So far the community has tended to err on the side of requiring exactly the same permissions.  Also, particularly with the Fetch processor, the user will be fetching an object they specifically provide in the attributes dialog, which gives them an opportunity not to specify a large object.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org