Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -329,17 +329,4 @@ protected RangerBasePlugin getPlugin() {
protected RangerAccessResultProcessor getAccessResultProcessor() {
return null;
}

// For test only
public static void main(String[] args) {
RangerDorisAccessController ac = new RangerDorisAccessController("doris");
UserIdentity user = new UserIdentity("user1", "127.0.0.1");
user.setIsAnalyzed();
boolean res = ac.checkDbPriv(user, "internal", "db1", PrivPredicate.SHOW);
System.out.println("res: " + res);
user = new UserIdentity("user2", "127.0.0.1");
user.setIsAnalyzed();
res = ac.checkTblPriv(user, "internal", "db1", "tbl1", PrivPredicate.SELECT);
System.out.println("res: " + res);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
import java.util.concurrent.ConcurrentHashMap;

/**
* AccessControllerManager is the entry point of privilege authentication.
* AccessControllerManager is the entry point of privilege authorization.
* There are 2 kinds of access controller:
* SystemAccessController: for global level priv, resource priv and other Doris internal priv checking
* CatalogAccessController: for specified catalog's priv checking, can be customized.
Expand Down Expand Up @@ -98,15 +98,15 @@ private CatalogAccessController loadAccessControllerOrThrow(String accessControl
private void loadAccessControllerPlugins() {
ServiceLoader<AccessControllerFactory> loaderFromClasspath = ServiceLoader.load(AccessControllerFactory.class);
for (AccessControllerFactory factory : loaderFromClasspath) {
LOG.info("Found Authentication Plugin Factories: {} from class path.", factory.factoryIdentifier());
LOG.info("Found Access Controller Plugin Factory: {} from class path.", factory.factoryIdentifier());
accessControllerFactoriesCache.put(factory.factoryIdentifier(), factory);
accessControllerClassNameMapping.put(factory.getClass().getName(), factory.factoryIdentifier());
}
List<AccessControllerFactory> loader = null;
try {
loader = ClassLoaderUtils.loadServicesFromDirectory(AccessControllerFactory.class);
} catch (IOException e) {
throw new RuntimeException("Failed to load Authentication Plugin Factories", e);
throw new RuntimeException("Failed to load Access Controller Plugin Factories", e);
}
for (AccessControllerFactory factory : loader) {
LOG.info("Found Access Controller Plugin Factory: {} from directory.", factory.factoryIdentifier());
Expand Down
Loading