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

commit f9b89b7248d343e07cbe49108855cdd292080ee5
Author: exceptionfactory <exceptionfact...@apache.org>
AuthorDate: Fri Feb 9 16:21:34 2024 -0600

    NIFI-12770 Deprecated Ranger Authorizers for Removal
    This closes #8387
    
    Signed-off-by: Joseph Witt <joew...@apache.org>
---
 nifi-nar-bundles/nifi-ranger-bundle/nifi-ranger-plugin/pom.xml      | 4 ++++
 .../org/apache/nifi/ranger/authorization/RangerNiFiAuthorizer.java  | 6 +++++-
 .../nifi-registry-ranger/nifi-registry-ranger-plugin/pom.xml        | 5 +++++
 .../main/java/org/apache/nifi/registry/ranger/RangerAuthorizer.java | 4 ++++
 4 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/nifi-nar-bundles/nifi-ranger-bundle/nifi-ranger-plugin/pom.xml 
b/nifi-nar-bundles/nifi-ranger-bundle/nifi-ranger-plugin/pom.xml
index 0c4f47ed18..6e26203268 100644
--- a/nifi-nar-bundles/nifi-ranger-bundle/nifi-ranger-plugin/pom.xml
+++ b/nifi-nar-bundles/nifi-ranger-bundle/nifi-ranger-plugin/pom.xml
@@ -41,6 +41,10 @@
             <groupId>org.slf4j</groupId>
             <artifactId>jcl-over-slf4j</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.nifi</groupId>
+            <artifactId>nifi-deprecation-log</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.apache.ranger</groupId>
             <artifactId>ranger-plugins-common</artifactId>
diff --git 
a/nifi-nar-bundles/nifi-ranger-bundle/nifi-ranger-plugin/src/main/java/org/apache/nifi/ranger/authorization/RangerNiFiAuthorizer.java
 
b/nifi-nar-bundles/nifi-ranger-bundle/nifi-ranger-plugin/src/main/java/org/apache/nifi/ranger/authorization/RangerNiFiAuthorizer.java
index d7513d7d6f..a96eb83910 100644
--- 
a/nifi-nar-bundles/nifi-ranger-bundle/nifi-ranger-plugin/src/main/java/org/apache/nifi/ranger/authorization/RangerNiFiAuthorizer.java
+++ 
b/nifi-nar-bundles/nifi-ranger-bundle/nifi-ranger-plugin/src/main/java/org/apache/nifi/ranger/authorization/RangerNiFiAuthorizer.java
@@ -33,6 +33,8 @@ import 
org.apache.nifi.authorization.exception.AuthorizationAccessException;
 import org.apache.nifi.authorization.exception.AuthorizerCreationException;
 import org.apache.nifi.authorization.exception.AuthorizerDestructionException;
 import org.apache.nifi.components.PropertyValue;
+import org.apache.nifi.deprecation.log.DeprecationLogger;
+import org.apache.nifi.deprecation.log.DeprecationLoggerFactory;
 import org.apache.nifi.util.NiFiProperties;
 import org.apache.ranger.audit.model.AuthzAuditEvent;
 import org.apache.ranger.authorization.hadoop.config.RangerConfiguration;
@@ -85,9 +87,11 @@ public class RangerNiFiAuthorizer implements Authorizer, 
AuthorizationAuditor {
     private volatile NiFiProperties nifiProperties;
     private final NumberFormat numberFormat = NumberFormat.getInstance();
 
+    private final DeprecationLogger deprecationLogger = 
DeprecationLoggerFactory.getLogger(getClass());
+
     @Override
     public void initialize(AuthorizerInitializationContext 
initializationContext) throws AuthorizerCreationException {
-
+        deprecationLogger.warn("Apache Ranger integration does not support 
Jetty 12 and related libraries required for NiFi 2.0");
     }
 
     @Override
diff --git 
a/nifi-registry/nifi-registry-extensions/nifi-registry-ranger/nifi-registry-ranger-plugin/pom.xml
 
b/nifi-registry/nifi-registry-extensions/nifi-registry-ranger/nifi-registry-ranger-plugin/pom.xml
index a328668f71..67ef61339b 100644
--- 
a/nifi-registry/nifi-registry-extensions/nifi-registry-ranger/nifi-registry-ranger-plugin/pom.xml
+++ 
b/nifi-registry/nifi-registry-extensions/nifi-registry-ranger/nifi-registry-ranger-plugin/pom.xml
@@ -78,6 +78,11 @@
             <groupId>org.slf4j</groupId>
             <artifactId>jcl-over-slf4j</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.nifi</groupId>
+            <artifactId>nifi-deprecation-log</artifactId>
+            <version>1.26.0-SNAPSHOT</version>
+        </dependency>
 
         <!-- Ranger dependencies -->
         <dependency>
diff --git 
a/nifi-registry/nifi-registry-extensions/nifi-registry-ranger/nifi-registry-ranger-plugin/src/main/java/org/apache/nifi/registry/ranger/RangerAuthorizer.java
 
b/nifi-registry/nifi-registry-extensions/nifi-registry-ranger/nifi-registry-ranger-plugin/src/main/java/org/apache/nifi/registry/ranger/RangerAuthorizer.java
index ee90729b69..98edcb2c91 100644
--- 
a/nifi-registry/nifi-registry-extensions/nifi-registry-ranger/nifi-registry-ranger-plugin/src/main/java/org/apache/nifi/registry/ranger/RangerAuthorizer.java
+++ 
b/nifi-registry/nifi-registry-extensions/nifi-registry-ranger/nifi-registry-ranger-plugin/src/main/java/org/apache/nifi/registry/ranger/RangerAuthorizer.java
@@ -19,6 +19,8 @@ package org.apache.nifi.registry.ranger;
 import org.apache.commons.lang.StringUtils;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.security.UserGroupInformation;
+import org.apache.nifi.deprecation.log.DeprecationLogger;
+import org.apache.nifi.deprecation.log.DeprecationLoggerFactory;
 import org.apache.nifi.registry.properties.NiFiRegistryProperties;
 import org.apache.nifi.registry.security.authorization.AccessPolicy;
 import org.apache.nifi.registry.security.authorization.AccessPolicyProvider;
@@ -110,10 +112,12 @@ public class RangerAuthorizer implements 
ManagedAuthorizer, AuthorizationAuditor
     private UserGroupProviderLookup userGroupProviderLookup;
     private UserGroupProvider userGroupProvider;
 
+    private final DeprecationLogger deprecationLogger = 
DeprecationLoggerFactory.getLogger(getClass());
 
     @Override
     public void initialize(AuthorizerInitializationContext 
initializationContext) throws SecurityProviderCreationException {
         userGroupProviderLookup = 
initializationContext.getUserGroupProviderLookup();
+        deprecationLogger.warn("Apache Ranger integration does not support 
Jetty 12 and related libraries required for NiFi 2.0");
     }
 
     @Override

Reply via email to