Search in sources :

Example 1 with XodusConfig

use of com.bakdata.conquery.models.config.XodusConfig in project conquery by bakdata.

the class LocalAuthRealmTest method setupAll.

@BeforeAll
public void setupAll() throws Exception {
    tmpDir = Files.createTempDirectory(LocalAuthRealmTest.class.getName()).toFile();
    assert tmpDir.exists();
    conqueryTokenRealm = new ConqueryTokenRealm(storage);
    realm = new LocalAuthenticationRealm(Validators.newValidator(), Jackson.BINARY_MAPPER, conqueryTokenRealm, "localtestRealm", tmpDir, new XodusConfig(), Duration.hours(1));
    LifecycleUtils.init(realm);
}
Also used : LocalAuthenticationRealm(com.bakdata.conquery.models.auth.basic.LocalAuthenticationRealm) ConqueryTokenRealm(com.bakdata.conquery.models.auth.conquerytoken.ConqueryTokenRealm) XodusConfig(com.bakdata.conquery.models.config.XodusConfig) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 2 with XodusConfig

use of com.bakdata.conquery.models.config.XodusConfig in project conquery by bakdata.

the class ApiTokenRealmTest method overrideConfig.

@Override
public ConqueryConfig overrideConfig(ConqueryConfig conf, final File workDir) {
    XodusStoreFactory storageConfig = (XodusStoreFactory) conf.getStorage();
    final Path storageDir = workDir.toPath().resolve(storageConfig.getDirectory().resolve(getClass().getSimpleName()));
    return conf.withStorage(storageConfig.withDirectory(storageDir)).withAuthenticationRealms(ImmutableList.<AuthenticationRealmFactory>builder().addAll(conf.getAuthenticationRealms()).add(new ApiTokenRealmFactory(storageDir, new XodusConfig())).build());
}
Also used : Path(java.nio.file.Path) XodusStoreFactory(com.bakdata.conquery.models.config.XodusStoreFactory) ApiTokenRealmFactory(com.bakdata.conquery.models.config.auth.ApiTokenRealmFactory) XodusConfig(com.bakdata.conquery.models.config.XodusConfig) AuthenticationRealmFactory(com.bakdata.conquery.models.config.auth.AuthenticationRealmFactory)

Aggregations

XodusConfig (com.bakdata.conquery.models.config.XodusConfig)2 LocalAuthenticationRealm (com.bakdata.conquery.models.auth.basic.LocalAuthenticationRealm)1 ConqueryTokenRealm (com.bakdata.conquery.models.auth.conquerytoken.ConqueryTokenRealm)1 XodusStoreFactory (com.bakdata.conquery.models.config.XodusStoreFactory)1 ApiTokenRealmFactory (com.bakdata.conquery.models.config.auth.ApiTokenRealmFactory)1 AuthenticationRealmFactory (com.bakdata.conquery.models.config.auth.AuthenticationRealmFactory)1 Path (java.nio.file.Path)1 BeforeAll (org.junit.jupiter.api.BeforeAll)1