This is an automated email from the ASF dual-hosted git repository.
joewitt pushed a commit to branch support/nifi-1.x
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/support/nifi-1.x by this push:
new e99344fada NIFI-13415 Deprecated Property Protection and Encrypt
Config This closes #8979
e99344fada is described below
commit e99344fadab4af67b86b03d130bc196c9b9715eb
Author: exceptionfactory <[email protected]>
AuthorDate: Tue Jun 18 16:20:14 2024 -0500
NIFI-13415 Deprecated Property Protection and Encrypt Config
This closes #8979
Signed-off-by: Joseph Witt <[email protected]>
---
.../nifi-framework/nifi-properties-loader/pom.xml | 5 +++++
.../main/java/org/apache/nifi/properties/NiFiPropertiesLoader.java | 5 +++++
.../nifi-registry-core/nifi-registry-properties-loader/pom.xml | 5 +++++
.../nifi/registry/properties/NiFiRegistryPropertiesLoader.java | 5 +++++
.../org/apache/nifi/toolkit/encryptconfig/EncryptConfigMain.groovy | 2 ++
5 files changed, 22 insertions(+)
diff --git
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-properties-loader/pom.xml
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-properties-loader/pom.xml
index a5524ca1ed..7567d87654 100644
---
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-properties-loader/pom.xml
+++
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-properties-loader/pom.xml
@@ -41,5 +41,10 @@
<scope>provided</scope>
<!-- Provided through isolated ClassLoader to avoid unnecessary
runtime dependencies -->
</dependency>
+ <dependency>
+ <groupId>org.apache.nifi</groupId>
+ <artifactId>nifi-deprecation-log</artifactId>
+ <version>1.27.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
</project>
\ No newline at end of file
diff --git
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-properties-loader/src/main/java/org/apache/nifi/properties/NiFiPropertiesLoader.java
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-properties-loader/src/main/java/org/apache/nifi/properties/NiFiPropertiesLoader.java
index d893e8fd01..f561ec2791 100644
---
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-properties-loader/src/main/java/org/apache/nifi/properties/NiFiPropertiesLoader.java
+++
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-properties-loader/src/main/java/org/apache/nifi/properties/NiFiPropertiesLoader.java
@@ -16,6 +16,8 @@
*/
package org.apache.nifi.properties;
+import org.apache.nifi.deprecation.log.DeprecationLogger;
+import org.apache.nifi.deprecation.log.DeprecationLoggerFactory;
import
org.apache.nifi.property.protection.loader.PropertyProtectionURLClassLoader;
import
org.apache.nifi.property.protection.loader.PropertyProviderFactoryLoader;
import org.apache.nifi.util.NiFiBootstrapUtils;
@@ -44,6 +46,7 @@ import java.util.stream.Collectors;
public class NiFiPropertiesLoader {
+ private static final DeprecationLogger deprecationLogger =
DeprecationLoggerFactory.getLogger(NiFiPropertiesLoader.class);
private static final Logger logger =
LoggerFactory.getLogger(NiFiPropertiesLoader.class);
private static final Base64.Encoder KEY_ENCODER =
Base64.getEncoder().withoutPadding();
private static final int SENSITIVE_PROPERTIES_KEY_LENGTH = 24;
@@ -162,6 +165,8 @@ public class NiFiPropertiesLoader {
final NiFiProperties properties;
if (protectedProperties.hasProtectedKeys()) {
+ deprecationLogger.warn("Support for encrypted application
properties is deprecated for removal in NiFi 2.0.0");
+
final ClassLoader contextClassLoader =
Thread.currentThread().getContextClassLoader();
try {
diff --git
a/nifi-registry/nifi-registry-core/nifi-registry-properties-loader/pom.xml
b/nifi-registry/nifi-registry-core/nifi-registry-properties-loader/pom.xml
index a7230b9b2f..d542e0830e 100644
--- a/nifi-registry/nifi-registry-core/nifi-registry-properties-loader/pom.xml
+++ b/nifi-registry/nifi-registry-core/nifi-registry-properties-loader/pom.xml
@@ -36,5 +36,10 @@
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-property-protection-loader</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.nifi</groupId>
+ <artifactId>nifi-deprecation-log</artifactId>
+ <version>1.27.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
</project>
diff --git
a/nifi-registry/nifi-registry-core/nifi-registry-properties-loader/src/main/java/org/apache/nifi/registry/properties/NiFiRegistryPropertiesLoader.java
b/nifi-registry/nifi-registry-core/nifi-registry-properties-loader/src/main/java/org/apache/nifi/registry/properties/NiFiRegistryPropertiesLoader.java
index c5f5a750c2..e9a06818e7 100644
---
a/nifi-registry/nifi-registry-core/nifi-registry-properties-loader/src/main/java/org/apache/nifi/registry/properties/NiFiRegistryPropertiesLoader.java
+++
b/nifi-registry/nifi-registry-core/nifi-registry-properties-loader/src/main/java/org/apache/nifi/registry/properties/NiFiRegistryPropertiesLoader.java
@@ -16,6 +16,8 @@
*/
package org.apache.nifi.registry.properties;
+import org.apache.nifi.deprecation.log.DeprecationLogger;
+import org.apache.nifi.deprecation.log.DeprecationLoggerFactory;
import org.apache.nifi.properties.BootstrapProperties;
import org.apache.nifi.properties.SensitivePropertyProvider;
import org.apache.nifi.properties.SensitivePropertyProviderFactory;
@@ -33,6 +35,7 @@ import java.util.Properties;
public class NiFiRegistryPropertiesLoader {
+ private static final DeprecationLogger deprecationLogger =
DeprecationLoggerFactory.getLogger(NiFiRegistryPropertiesLoader.class);
private static final Logger logger =
LoggerFactory.getLogger(NiFiRegistryPropertiesLoader.class);
private String keyHex;
@@ -125,6 +128,8 @@ public class NiFiRegistryPropertiesLoader {
public NiFiRegistryProperties load(final File file) {
final ProtectedNiFiRegistryProperties protectedNiFiProperties =
readProtectedPropertiesFromDisk(file);
if (protectedNiFiProperties.hasProtectedKeys()) {
+ deprecationLogger.warn("Support for encrypted application
properties is deprecated for removal in NiFi 2.0.0");
+
Security.addProvider(new BouncyCastleProvider());
getSensitivePropertyProviderFactory()
.getSupportedProviders()
diff --git
a/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/toolkit/encryptconfig/EncryptConfigMain.groovy
b/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/toolkit/encryptconfig/EncryptConfigMain.groovy
index e6ce68e3cc..2703d58702 100644
---
a/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/toolkit/encryptconfig/EncryptConfigMain.groovy
+++
b/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/toolkit/encryptconfig/EncryptConfigMain.groovy
@@ -90,6 +90,8 @@ class EncryptConfigMain {
}
static void main(String[] args) {
+ System.out.println("The encrypt-config command is deprecated for
removal in NiFi 2.0.0")
+
Security.addProvider(new BouncyCastleProvider())
if (args.length < 1) {