[GitHub] nifi pull request #2291: NIFI-4256 - Add support for all AWS S3 Encryption O...

2017-11-30 Thread baank
Github user baank closed the pull request at:

https://github.com/apache/nifi/pull/2291


---


[GitHub] nifi pull request #2291: NIFI-4256 - Add support for all AWS S3 Encryption O...

2017-11-27 Thread jvwing
Github user jvwing commented on a diff in the pull request:

https://github.com/apache/nifi/pull/2291#discussion_r153396888
  
--- Diff: 
nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/PutS3Object.java
 ---
@@ -154,6 +155,14 @@
 .defaultValue(StorageClass.Standard.name())
 .build();
 
+
+public static final PropertyDescriptor PUT_ENRICHMENT_SERVICE = new 
PropertyDescriptor.Builder()
+.name("Put Enrichment Service")
--- End diff --

Same request for machine-readable name and human-readable displayName.


---


[GitHub] nifi pull request #2291: NIFI-4256 - Add support for all AWS S3 Encryption O...

2017-11-27 Thread jvwing
Github user jvwing commented on a diff in the pull request:

https://github.com/apache/nifi/pull/2291#discussion_r153396684
  
--- Diff: 
nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/src/main/java/org/apache/nifi/processors/aws/s3/AbstractS3Processor.java
 ---
@@ -125,16 +125,31 @@
 new AllowableValue("S3SignerType", "Signature v2"))
 .defaultValue("Default Signature")
 .build();
+
+public static final PropertyDescriptor CLIENT_SERVICE = new 
PropertyDescriptor.Builder()
+.name("Client Service")
--- End diff --

Name should be a machine-readable key like "client-service" with a 
human-readable displayName like "Client Service".  I know this has not been 
done previously in this file, but we should try to do it going forward.


---


[GitHub] nifi pull request #2291: NIFI-4256 - Add support for all AWS S3 Encryption O...

2017-11-27 Thread jvwing
Github user jvwing commented on a diff in the pull request:

https://github.com/apache/nifi/pull/2291#discussion_r153398470
  
--- Diff: 
nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/encryption/EncryptedS3PutEnrichmentService.java
 ---
@@ -0,0 +1,181 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.processors.aws.s3.encryption;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import com.amazonaws.services.s3.model.InitiateMultipartUploadRequest;
+import com.amazonaws.services.s3.model.ObjectMetadata;
+import com.amazonaws.services.s3.model.PutObjectRequest;
+import com.amazonaws.services.s3.model.SSEAwsKeyManagementParams;
+import com.amazonaws.services.s3.model.SSECustomerKey;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.annotation.lifecycle.OnEnabled;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.controller.AbstractControllerService;
+import org.apache.nifi.controller.ConfigurationContext;
+import org.apache.nifi.processor.util.StandardValidators;
+import org.apache.nifi.processors.aws.s3.service.S3PutEnrichmentService;
+import org.apache.nifi.reporting.InitializationException;
+
+@Tags({"aws", "s3", "encryption", "server", "kms", "key"})
+@CapabilityDescription("Provides the ability to configure S3 Server Side 
Encryption once and reuse " +
+"that configuration throughout the application")
+public class EncryptedS3PutEnrichmentService extends 
AbstractControllerService implements S3PutEnrichmentService {
+
+public static final String METHOD_SSE_S3 = "SSE-S3";
+public static final String METHOD_SSE_KMS = "SSE-KMS";
+public static final String METHOD_SSE_C = "SSE-C";
+
+public static final String ALGORITHM_AES256 = "AES256";
+public static final String CUSTOMER_ALGORITHM_AES256 = "AES256";
+
+
+public static final PropertyDescriptor ENCRYPTION_METHOD = new 
PropertyDescriptor.Builder()
+.name("encryption-method")
+.displayName("Encryption Method")
+.required(true)
+.allowableValues(METHOD_SSE_S3, METHOD_SSE_KMS, METHOD_SSE_C)
+.defaultValue(METHOD_SSE_S3)
+.description("Method by which the S3 object will be encrypted 
server-side.")
+.build();
+
+public static final PropertyDescriptor ALGORITHM = new 
PropertyDescriptor.Builder()
+.name("sse-algorithm")
+.displayName("Algorithm")
+.allowableValues(ALGORITHM_AES256)
+.defaultValue(ALGORITHM_AES256)
+.description("Encryption algorithm to use (only AES256 
currently supported)")
+.build();
+
+public static final PropertyDescriptor KMS_KEY_ID = new 
PropertyDescriptor.Builder()
+.name("sse-kme-key-id")
+.displayName("KMS Key Id")
+.required(false)
+.expressionLanguageSupported(true)
+.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+.description("Custom KMS key identifier. Supports key or alias 
ARN.")
+.build();
+
+public static final PropertyDescriptor CUSTOMER_KEY = new 
PropertyDescriptor.Builder()
+.name("sse-customer-key")
+.displayName("Customer Key")
+.required(false)
+.expressionLanguageSupported(true)
+.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+.description("Customer provided 256-bit, base64-encoded 
encryption key.")
+.build();
+
+public static final PropertyDescriptor CUSTOMER_ALGORITHM = new 
PropertyDescriptor.Builder()
+

[GitHub] nifi pull request #2291: NIFI-4256 - Add support for all AWS S3 Encryption O...

2017-11-24 Thread baank
GitHub user baank opened a pull request:

https://github.com/apache/nifi/pull/2291

NIFI-4256 - Add support for all AWS S3 Encryption Options

Thank you for submitting a contribution to Apache NiFi.

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

### For all changes:
- [ ] Is there a JIRA ticket associated with this PR? Is it referenced 
 in the commit message?

- [ ] Does your PR title start with NIFI- where  is the JIRA number 
you are trying to resolve? Pay particular attention to the hyphen "-" character.

- [ ] Has your PR been rebased against the latest commit within the target 
branch (typically master)?

- [ ] Is your initial contribution a single, squashed commit?

### For code changes:
- [ ] Have you ensured that the full suite of tests is executed via mvn 
-Pcontrib-check clean install at the root nifi folder?
- [ ] Have you written or updated unit tests to verify your changes?
- [ ] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)? 
- [ ] If applicable, have you updated the LICENSE file, including the main 
LICENSE file under nifi-assembly?
- [ ] If applicable, have you updated the NOTICE file, including the main 
NOTICE file found under nifi-assembly?
- [ ] If adding new Properties, have you added .displayName in addition to 
.name (programmatic access) for each of the new properties?

### For documentation related changes:
- [ ] Have you ensured that format looks appropriate for the output in 
which it is rendered?

### Note:
Please ensure that once the PR is submitted, you check travis-ci for build 
issues and submit an update to your PR as soon as possible.


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/baank/nifi NIFI-4256

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/nifi/pull/2291.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #2291


commit 7fd378454cde20e4a009a96b4cdf430793ba25c5
Author: Naden Franciscus 
Date:   2017-11-02T22:28:27Z

NIFI-4256 - Add support for all AWS S3 Encryption Options




---