seawinde commented on code in PR #61893: URL: https://github.com/apache/doris/pull/61893#discussion_r3015273274
##########
fe/fe-core/src/main/java/org/apache/doris/catalog/authorizer/ranger/hive/RangerHivePlugin.java:
##########
@@ -21,12 +21,14 @@
import org.apache.ranger.plugin.service.RangerBasePlugin;
public class RangerHivePlugin extends RangerBasePlugin {
+ private static final String SERVICE_TYPE = "hive";
Review Comment:
This change alters the behavior of how serviceName is resolved:
Before: The serviceName parameter from the catalog property
ranger.service.name was passed as the serviceType to RangerBasePlugin(String
serviceType, String appId). The actual serviceName was null, so it was read
from the XML config file property ranger.plugin.{
serviceType}.service.name.
After: serviceType is hardcoded to "hive", and the serviceName is
directly taken from the catalog property ranger.service.name via
RangerBasePlugin(String serviceType, String serviceName, String appId),
bypassing the XML config file.
This fixes a semantic issue where serviceType and serviceName were
conflated, but introduces a behavioral change:
1. Config file lookup is now stable. Previously, if
ranger.service.name=my_custom_hive, the plugin would look for
ranger-my_custom_hive-security.xml, which is incorrect. Now it always loads
ranger-hive-security.xml.
2. serviceName source changed. Previously it was read from the XML
property ranger.plugin.{serviceType}.service.name; now it comes directly from
the catalog property ranger.service.name. For existing users who had a
different serviceName configured in their XML
file (e.g., ranger.plugin.hive.service.name=hive_prod), that XML
setting will no longer take effect after the upgrade.
The same change applies to RangerDorisPlugin.
--
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]
