exceptionfactory commented on code in PR #8151:
URL: https://github.com/apache/nifi/pull/8151#discussion_r1425528372


##########
minifi/minifi-nar-bundles/minifi-framework-bundle/minifi-framework/minifi-properties-loader/src/main/java/org/apache/nifi/minifi/properties/ProtectedMiNiFiProperties.java:
##########
@@ -0,0 +1,241 @@
+/*
+ * 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.properties;
+
+import static java.util.Arrays.asList;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import org.apache.nifi.minifi.commons.api.MiNiFiProperties;
+import org.apache.nifi.properties.ApplicationPropertiesProtector;
+import org.apache.nifi.properties.ProtectedProperties;
+import org.apache.nifi.properties.SensitivePropertyProtectionException;
+import org.apache.nifi.properties.SensitivePropertyProtector;
+import org.apache.nifi.properties.SensitivePropertyProvider;
+import org.apache.nifi.util.NiFiProperties;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Decorator class for intermediate phase when {@link MiNiFiPropertiesLoader} 
loads the
+ * raw properties file and performs unprotection activities before returning a 
clean
+ * implementation of {@link NiFiProperties}.
+ * This encapsulates the sensitive property access logic from external 
consumers
+ * of {@code NiFiProperties}.
+ */
+public class ProtectedMiNiFiProperties extends NiFiProperties implements 
ProtectedProperties<NiFiProperties>,
+    SensitivePropertyProtector<ProtectedMiNiFiProperties, NiFiProperties> {
+    private static final Logger logger = 
LoggerFactory.getLogger(ProtectedMiNiFiProperties.class);
+    public static final String ADDITIONAL_SENSITIVE_PROPERTIES_KEY = 
"nifi.sensitive.props.additional.keys";
+    public static final List<String> DEFAULT_SENSITIVE_PROPERTIES = new 
ArrayList<>(asList(
+        SECURITY_KEY_PASSWD,
+        SECURITY_KEYSTORE_PASSWD,
+        SECURITY_TRUSTSTORE_PASSWD,
+        SENSITIVE_PROPS_KEY,
+        REPOSITORY_ENCRYPTION_KEY_PROVIDER_KEYSTORE_PASSWORD,
+        SECURITY_USER_OIDC_CLIENT_SECRET

Review Comment:
   The OIDC and Repository Encryption Key properties are not applicable, so at 
least those should be removed.



-- 
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-unsubscr...@nifi.apache.org

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

Reply via email to