You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by gr...@apache.org on 2022/11/04 22:05:03 UTC
[nifi] branch main updated: NIFI-10713 Added Deprecation Warning for PGP in EncryptContent NIFI-10713 Removed OpenPGP, PGP, and GPG tags
This is an automated email from the ASF dual-hosted git repository.
greyp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/main by this push:
new d9e494f976 NIFI-10713 Added Deprecation Warning for PGP in EncryptContent NIFI-10713 Removed OpenPGP, PGP, and GPG tags
d9e494f976 is described below
commit d9e494f976bb6785978d66da10c92712c16a5a3b
Author: exceptionfactory <ex...@apache.org>
AuthorDate: Wed Nov 2 11:55:57 2022 -0500
NIFI-10713 Added Deprecation Warning for PGP in EncryptContent
NIFI-10713 Removed OpenPGP, PGP, and GPG tags
This closes #6613
Signed-off-by: Paul Grey <gr...@apache.org>
---
.../org/apache/nifi/processors/standard/EncryptContent.java | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EncryptContent.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EncryptContent.java
index 1b5f02d93a..7fc901b8ff 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EncryptContent.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EncryptContent.java
@@ -48,6 +48,8 @@ import org.apache.nifi.components.AllowableValue;
import org.apache.nifi.components.PropertyDescriptor;
import org.apache.nifi.components.ValidationContext;
import org.apache.nifi.components.ValidationResult;
+import org.apache.nifi.deprecation.log.DeprecationLogger;
+import org.apache.nifi.deprecation.log.DeprecationLoggerFactory;
import org.apache.nifi.expression.ExpressionLanguageScope;
import org.apache.nifi.flowfile.FlowFile;
import org.apache.nifi.flowfile.attributes.CoreAttributes;
@@ -75,7 +77,7 @@ import org.bouncycastle.openpgp.PGPEncryptedData;
@SideEffectFree
@SupportsBatching
@InputRequirement(Requirement.INPUT_REQUIRED)
-@Tags({"encryption", "decryption", "password", "JCE", "OpenPGP", "PGP", "GPG", "KDF", "Argon2", "Bcrypt", "Scrypt", "PBKDF2", "salt", "iv"})
+@Tags({"encryption", "decryption", "password", "JCE", "KDF", "Argon2", "Bcrypt", "Scrypt", "PBKDF2", "salt", "iv"})
@CapabilityDescription("Encrypts or Decrypts a FlowFile using either symmetric encryption with a raw key or password " +
"and randomly generated salt, or asymmetric encryption using a public and secret key.")
@SystemResourceConsideration(resource = SystemResource.CPU)
@@ -214,6 +216,9 @@ public class EncryptContent extends AbstractProcessor {
public static final Relationship REL_FAILURE = new Relationship.Builder().name("failure")
.description("Any FlowFile that cannot be encrypted or decrypted will be routed to failure").build();
+
+ private static final DeprecationLogger deprecationLogger = DeprecationLoggerFactory.getLogger(EncryptContent.class);
+
private List<PropertyDescriptor> properties;
private Set<Relationship> relationships;
@@ -324,6 +329,11 @@ public class EncryptContent extends AbstractProcessor {
final String keyHex = context.getProperty(RAW_KEY_HEX).getValue();
final boolean encrypt = context.getProperty(MODE).getValue().equalsIgnoreCase(ENCRYPT_MODE);
if (isPGPAlgorithm(algorithm)) {
+ deprecationLogger.warn("{}[id={}] OpenPGP support is deprecated: see EncryptContentPGP and DecryptContentPGP",
+ getClass().getSimpleName(),
+ getIdentifier()
+ );
+
final String publicKeyring = context.getProperty(PUBLIC_KEYRING).getValue();
final String publicUserId = context.getProperty(PUBLIC_KEY_USERID).getValue();
final String privateKeyring = context.getProperty(PRIVATE_KEYRING).getValue();