Search in sources :

Example 1 with DefaultSecretStore

use of io.cdap.cdap.data.security.DefaultSecretStore in project cdap by caskdata.

the class SqlDefaultSecretStoreTest method setup.

@BeforeClass
public static void setup() throws Exception {
    CConfiguration cConf = CConfiguration.create();
    pg = PostgresInstantiator.createAndStart(cConf, TEMP_FOLDER.newFolder());
    Injector injector = Guice.createInjector(new ConfigModule(cConf), new LocalLocationModule(), new SystemDatasetRuntimeModule().getInMemoryModules(), new StorageModule(), new AbstractModule() {

        @Override
        protected void configure() {
            bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class).in(Scopes.SINGLETON);
        }
    });
    store = new DefaultSecretStore(injector.getInstance(TransactionRunner.class));
    StoreDefinition.SecretStore.create(injector.getInstance(StructuredTableAdmin.class));
}
Also used : StorageModule(io.cdap.cdap.data.runtime.StorageModule) LocalLocationModule(io.cdap.cdap.common.guice.LocalLocationModule) MetricsCollectionService(io.cdap.cdap.api.metrics.MetricsCollectionService) NoOpMetricsCollectionService(io.cdap.cdap.common.metrics.NoOpMetricsCollectionService) DefaultSecretStore(io.cdap.cdap.data.security.DefaultSecretStore) Injector(com.google.inject.Injector) ConfigModule(io.cdap.cdap.common.guice.ConfigModule) StructuredTableAdmin(io.cdap.cdap.spi.data.StructuredTableAdmin) SystemDatasetRuntimeModule(io.cdap.cdap.data.runtime.SystemDatasetRuntimeModule) CConfiguration(io.cdap.cdap.common.conf.CConfiguration) AbstractModule(com.google.inject.AbstractModule) BeforeClass(org.junit.BeforeClass)

Example 2 with DefaultSecretStore

use of io.cdap.cdap.data.security.DefaultSecretStore in project cdap by caskdata.

the class NoSqlDefaultSecretStoreTest method setup.

@BeforeClass
public static void setup() {
    Injector injector = AppFabricTestHelper.getInjector(CConfiguration.create());
    TransactionRunner transactionRunner = injector.getInstance(TransactionRunner.class);
    store = new DefaultSecretStore(transactionRunner);
}
Also used : DefaultSecretStore(io.cdap.cdap.data.security.DefaultSecretStore) Injector(com.google.inject.Injector) TransactionRunner(io.cdap.cdap.spi.data.transaction.TransactionRunner) BeforeClass(org.junit.BeforeClass)

Aggregations

Injector (com.google.inject.Injector)2 DefaultSecretStore (io.cdap.cdap.data.security.DefaultSecretStore)2 BeforeClass (org.junit.BeforeClass)2 AbstractModule (com.google.inject.AbstractModule)1 MetricsCollectionService (io.cdap.cdap.api.metrics.MetricsCollectionService)1 CConfiguration (io.cdap.cdap.common.conf.CConfiguration)1 ConfigModule (io.cdap.cdap.common.guice.ConfigModule)1 LocalLocationModule (io.cdap.cdap.common.guice.LocalLocationModule)1 NoOpMetricsCollectionService (io.cdap.cdap.common.metrics.NoOpMetricsCollectionService)1 StorageModule (io.cdap.cdap.data.runtime.StorageModule)1 SystemDatasetRuntimeModule (io.cdap.cdap.data.runtime.SystemDatasetRuntimeModule)1 StructuredTableAdmin (io.cdap.cdap.spi.data.StructuredTableAdmin)1 TransactionRunner (io.cdap.cdap.spi.data.transaction.TransactionRunner)1