use of org.apache.shiro.cache.MemoryConstrainedCacheManager in project neo4j by neo4j.
the class MultiRealmAuthManagerTest method createAuthManager.
private MultiRealmAuthManager createAuthManager(boolean logSuccessfulAuthentications) throws Throwable {
Log log = logProvider.getLog(this.getClass());
InternalFlatFileRealm internalFlatFileRealm = new InternalFlatFileRealm(users, new InMemoryRoleRepository(), mock(PasswordPolicy.class), authStrategy, mock(JobScheduler.class), CommunitySecurityModule.getInitialUserRepository(config, NullLogProvider.getInstance(), fsRule.get()), EnterpriseSecurityModule.getDefaultAdminRepository(config, NullLogProvider.getInstance(), fsRule.get()));
manager = new MultiRealmAuthManager(internalFlatFileRealm, Collections.singleton(internalFlatFileRealm), new MemoryConstrainedCacheManager(), new SecurityLog(log), logSuccessfulAuthentications);
manager.init();
return manager;
}
use of org.apache.shiro.cache.MemoryConstrainedCacheManager in project neo4j by neo4j.
the class MultiRealmAuthManagerRule method setupAuthManager.
private void setupAuthManager(AuthenticationStrategy authStrategy) throws Throwable {
FormattedLog.Builder builder = FormattedLog.withUTCTimeZone();
securityLogWriter = new StringWriter();
Log log = builder.toWriter(securityLogWriter);
securityLog = new SecurityLog(log);
InternalFlatFileRealm internalFlatFileRealm = new InternalFlatFileRealm(users, new InMemoryRoleRepository(), new BasicPasswordPolicy(), authStrategy, mock(JobScheduler.class), new InMemoryUserRepository(), new InMemoryUserRepository());
manager = new MultiRealmAuthManager(internalFlatFileRealm, Collections.singleton(internalFlatFileRealm), new MemoryConstrainedCacheManager(), securityLog, true);
manager.init();
}
Aggregations