pan3793 commented on code in PR #7081:
URL: https://github.com/apache/kyuubi/pull/7081#discussion_r2193938046


##########
extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/ranger/AccessRequest.scala:
##########
@@ -68,17 +70,43 @@ object AccessRequest {
     req
   }
 
+  private val getRolesFromUserAndGroupsMethod: Option[UnboundMethod] =
+    getMethod(
+      SparkRangerAdminPlugin.getClass,
+      "getRolesFromUserAndGroups",
+      classOf[String],
+      classOf[JSet[String]])
+
+  private val setUserRolesMethod: Option[UnboundMethod] =
+    getMethod(classOf[AccessRequest], "setUserRoles", classOf[JSet[String]])
+
   private def getUserGroupsFromUgi(user: UserGroupInformation): JSet[String] = 
{
     user.getGroupNames.toSet.asJava
   }
 
+  private lazy val getUserStoreEnricherMethod: Option[UnboundMethod] =
+    getMethod(SparkRangerAdminPlugin.getClass, "getUserStoreEnricher")
+
+  private lazy val getRangerUserStoreMethod: Option[UnboundMethod] =
+    getMethod(
+      
Class.forName("org.apache.ranger.plugin.contextenricher.RangerUserStoreEnricher"),
+      "getRangerUserStore")
+
+  private lazy val getUserGroupMappingMethod: Option[UnboundMethod] =
+    getMethod(
+      Class.forName("org.apache.ranger.plugin.util.RangerUserStore"),

Review Comment:
   I see, it's a new feature of Ranger 2.1, we must use reflection as long as 
we support lower Ranger versions



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to