use of com.facebook.presto.plugin.base.security.FileBasedAccessControlModule in project presto by prestodb.
the class RaptorSecurityModule method setup.
@Override
protected void setup(Binder binder) {
bindSecurityModule("none", new AllowAllAccessControlModule());
bindSecurityModule("read-only", new ReadOnlySecurityModule());
bindSecurityModule("file", new FileBasedAccessControlModule());
}
use of com.facebook.presto.plugin.base.security.FileBasedAccessControlModule in project presto by prestodb.
the class AtopConnectorFactory method create.
@Override
public Connector create(String catalogName, Map<String, String> requiredConfig, ConnectorContext context) {
requireNonNull(requiredConfig, "requiredConfig is null");
try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(classLoader)) {
Bootstrap app = new Bootstrap(new AtopModule(atopFactoryClass, context.getTypeManager(), context.getNodeManager(), context.getNodeManager().getEnvironment(), catalogName), installModuleIf(AtopConnectorConfig.class, config -> config.getSecurity().equalsIgnoreCase(SECURITY_NONE), new AllowAllAccessControlModule()), installModuleIf(AtopConnectorConfig.class, config -> config.getSecurity().equalsIgnoreCase(SECURITY_FILE), binder -> {
binder.install(new FileBasedAccessControlModule());
binder.install(new JsonModule());
}));
Injector injector = app.doNotInitializeLogging().setRequiredConfigurationProperties(requiredConfig).initialize();
return injector.getInstance(AtopConnector.class);
} catch (Exception e) {
throwIfUnchecked(e);
throw new RuntimeException(e);
}
}
use of com.facebook.presto.plugin.base.security.FileBasedAccessControlModule in project presto by prestodb.
the class HiveSecurityModule method setup.
@Override
protected void setup(Binder binder) {
bindSecurityModule("legacy", new LegacySecurityModule());
bindSecurityModule("file", new FileBasedAccessControlModule());
bindSecurityModule("read-only", new ReadOnlySecurityModule());
bindSecurityModule("sql-standard", new SqlStandardSecurityModule());
}
Aggregations