wForget commented on code in PR #7081: URL: https://github.com/apache/kyuubi/pull/7081#discussion_r2191917626
########## 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: > it's located at `ranger-plugins-common`, should be always accessible? I don't get your point, but the logic here seems to be consistent with previous. https://github.com/apache/kyuubi/blob/4e40f9457dfcde9b2748eb6da877e1ee32193fca/extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/ranger/AccessRequest.scala#L79-L80 -- 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: notifications-unsubscr...@kyuubi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@kyuubi.apache.org For additional commands, e-mail: notifications-h...@kyuubi.apache.org