bejancsaba commented on code in PR #6612:
URL: https://github.com/apache/nifi/pull/6612#discussion_r1012825517


##########
minifi/minifi-assembly/pom.xml:
##########
@@ -121,10 +121,6 @@ limitations under the License.
             <groupId>org.apache.nifi.minifi</groupId>
             <artifactId>minifi-framework-api</artifactId>
         </dependency>
-        <dependency>

Review Comment:
   Thanks for the cleanup



##########
minifi/minifi-nar-bundles/minifi-framework-bundle/minifi-framework/minifi-runtime/src/main/java/org/apache/nifi/minifi/bootstrap/BootstrapRequestReader.java:
##########
@@ -0,0 +1,71 @@
+/*
+ * 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.minifi.bootstrap;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.Arrays;
+import org.apache.nifi.util.LimitingInputStream;
+
+public class BootstrapRequestReader {
+    private final String secretKey;
+
+    public BootstrapRequestReader(String secretKey) {
+        this.secretKey = secretKey;
+    }
+
+    // we don't want to close the stream, as the caller will do that
+    public BootstrapRequest readRequest(InputStream in) throws IOException {
+        // We want to ensure that we don't try to read data from an 
InputStream directly
+        // by a BufferedReader because any user on the system could open a 
socket and send
+        // a multi-gigabyte file without any new lines in order to crash the 
NiFi instance

Review Comment:
   NiFI -> MiNiFi :)



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to