use of io.cdap.cdap.security.auth.context.AuthenticationContextModules in project cdap by cdapio.
the class FileMetadataTest method setUpContext.
@BeforeClass
public static void setUpContext() throws Exception {
Configuration hConf = HBaseConfiguration.create();
final CConfiguration cConf = CConfiguration.create();
cConf.set(Constants.CFG_LOCAL_DATA_DIR, TMP_FOLDER.newFolder().getAbsolutePath());
String logBaseDir = cConf.get(LoggingConfiguration.LOG_BASE_DIR) + "/" + CDAPLogAppender.class.getSimpleName();
cConf.set(LoggingConfiguration.LOG_BASE_DIR, logBaseDir);
injector = Guice.createInjector(new ConfigModule(cConf, hConf), new NonCustomLocationUnitTestModule(), new TransactionModules().getInMemoryModules(), new LocalLogAppenderModule(), new DataSetsModules().getInMemoryModules(), new SystemDatasetRuntimeModule().getInMemoryModules(), new AuthorizationTestModule(), new AuthorizationEnforcementModule().getInMemoryModules(), new AuthenticationContextModules().getNoOpModule(), new StorageModule(), new AbstractModule() {
@Override
protected void configure() {
bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class);
bind(UGIProvider.class).to(UnsupportedUGIProvider.class);
bind(OwnerAdmin.class).to(DefaultOwnerAdmin.class);
bind(NamespaceQueryAdmin.class).to(SimpleNamespaceQueryAdmin.class);
}
});
txManager = injector.getInstance(TransactionManager.class);
txManager.startAndWait();
StoreDefinition.LogFileMetaStore.create(injector.getInstance(StructuredTableAdmin.class));
}
use of io.cdap.cdap.security.auth.context.AuthenticationContextModules in project cdap by cdapio.
the class MetricsProcessorServiceTestBase method getAdditionalModules.
@Override
protected List<Module> getAdditionalModules() {
List<Module> list = new ArrayList<>();
list.add(new DataSetsModules().getStandaloneModules());
list.add(new IOModule());
list.add(Modules.override(new NonCustomLocationUnitTestModule(), new DataFabricModules().getInMemoryModules(), new DataSetServiceModules().getInMemoryModules(), new ExploreClientModule(), new NamespaceAdminTestModule(), new MetricsStoreModule(), new AuthorizationTestModule(), new AuthorizationEnforcementModule().getInMemoryModules(), new AuthenticationContextModules().getMasterModule()).with(new AbstractModule() {
@Override
protected void configure() {
bind(UGIProvider.class).to(UnsupportedUGIProvider.class);
bind(OwnerAdmin.class).to(NoOpOwnerAdmin.class);
bind(MetadataServiceClient.class).to(NoOpMetadataServiceClient.class);
}
}));
return list;
}
use of io.cdap.cdap.security.auth.context.AuthenticationContextModules in project cdap by cdapio.
the class InMemoryExploreServiceTest method start.
@BeforeClass
public static void start() throws Exception {
CConfiguration configuration = CConfiguration.create();
Configuration hConf = new Configuration();
configuration.set(Constants.CFG_DATA_INMEMORY_PERSISTENCE, Constants.InMemoryPersistenceType.MEMORY.name());
configuration.set(Constants.Explore.LOCAL_DATA_DIR, tmpFolder.newFolder().getAbsolutePath());
Injector injector = Guice.createInjector(new ConfigModule(configuration, hConf), RemoteAuthenticatorModules.getNoOpModule(), new IOModule(), new InMemoryDiscoveryModule(), new NonCustomLocationUnitTestModule(), new DataFabricModules().getInMemoryModules(), new DataSetsModules().getStandaloneModules(), new DataSetServiceModules().getInMemoryModules(), new MetricsClientRuntimeModule().getInMemoryModules(), new ExploreRuntimeModule().getInMemoryModules(), new ExploreClientModule(), new NamespaceAdminTestModule(), new AuthorizationTestModule(), new AuthorizationEnforcementModule().getInMemoryModules(), new AuthenticationContextModules().getMasterModule(), new AbstractModule() {
@Override
protected void configure() {
bind(UGIProvider.class).to(UnsupportedUGIProvider.class);
bind(OwnerAdmin.class).to(DefaultOwnerAdmin.class);
bind(MetadataServiceClient.class).to(NoOpMetadataServiceClient.class);
}
});
transactionManager = injector.getInstance(TransactionManager.class);
transactionManager.startAndWait();
StoreDefinition.createAllTables(injector.getInstance(StructuredTableAdmin.class));
dsOpService = injector.getInstance(DatasetOpExecutorService.class);
dsOpService.startAndWait();
datasetService = injector.getInstance(DatasetService.class);
datasetService.startAndWait();
exploreService = injector.getInstance(ExploreService.class);
exploreService.startAndWait();
namespaceAdmin = injector.getInstance(NamespaceAdmin.class);
}
use of io.cdap.cdap.security.auth.context.AuthenticationContextModules in project cdap by cdapio.
the class SupportBundleTestModule method configure.
@Override
protected void configure() {
install(new DataFabricModules().getInMemoryModules());
install(new DataSetsModules().getStandaloneModules());
install(new TransactionExecutorModule());
install(new DataSetServiceModules().getInMemoryModules());
install(new ConfigModule(cConf, hConf));
install(RemoteAuthenticatorModules.getNoOpModule());
install(new IOModule());
install(new InMemoryDiscoveryModule());
install(new AppFabricServiceRuntimeModule(cConf).getInMemoryModules());
install(new MonitorHandlerModule(false));
install(new ProgramRunnerRuntimeModule().getInMemoryModules());
install(new NonCustomLocationUnitTestModule());
install(new LocalLogAppenderModule());
install(new LogReaderRuntimeModules().getInMemoryModules());
install(new LogQueryRuntimeModule().getInMemoryModules());
install(new MetricsHandlerModule());
install(new MetricsClientRuntimeModule().getInMemoryModules());
install(new ExploreClientModule());
install(new ConfigStoreModule());
install(new MetadataServiceModule());
install(new AuthenticationContextModules().getMasterModule());
install(new AuthorizationModule());
install(new AuthorizationEnforcementModule().getStandaloneModules());
install(new SecureStoreServerModule());
install(new MetadataReaderWriterModules().getInMemoryModules());
install(new MessagingServerRuntimeModule().getInMemoryModules());
install(new MockProvisionerModule());
// Needed by MonitorHandlerModuler
bind(TwillRunner.class).to(NoopTwillRunnerService.class);
}
use of io.cdap.cdap.security.auth.context.AuthenticationContextModules in project cdap by cdapio.
the class CDAPLogAppenderTest method setUpContext.
@BeforeClass
public static void setUpContext() throws Exception {
Configuration hConf = HBaseConfiguration.create();
final CConfiguration cConf = CConfiguration.create();
cConf.set(Constants.CFG_LOCAL_DATA_DIR, TMP_FOLDER.newFolder().getAbsolutePath());
String logBaseDir = cConf.get(LoggingConfiguration.LOG_BASE_DIR) + "/" + CDAPLogAppender.class.getSimpleName();
cConf.set(LoggingConfiguration.LOG_BASE_DIR, logBaseDir);
injector = Guice.createInjector(new ConfigModule(cConf, hConf), new NonCustomLocationUnitTestModule(), new TransactionModules().getInMemoryModules(), new LocalLogAppenderModule(), new DataSetsModules().getInMemoryModules(), new SystemDatasetRuntimeModule().getInMemoryModules(), new AuthorizationTestModule(), new AuthorizationEnforcementModule().getInMemoryModules(), new AuthenticationContextModules().getNoOpModule(), new StorageModule(), new AbstractModule() {
@Override
protected void configure() {
bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class);
bind(UGIProvider.class).to(UnsupportedUGIProvider.class);
bind(OwnerAdmin.class).to(DefaultOwnerAdmin.class);
bind(NamespaceQueryAdmin.class).to(SimpleNamespaceQueryAdmin.class);
}
});
txManager = injector.getInstance(TransactionManager.class);
txManager.startAndWait();
StoreDefinition.LogFileMetaStore.create(injector.getInstance(StructuredTableAdmin.class));
}
Aggregations