Search in sources :

Example 1 with MemoryConstrainedCacheManager

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;
}
Also used : JobScheduler(org.neo4j.kernel.impl.util.JobScheduler) Log(org.neo4j.logging.Log) SecurityLog(org.neo4j.server.security.enterprise.log.SecurityLog) AssertableLogProvider.inLog(org.neo4j.logging.AssertableLogProvider.inLog) MemoryConstrainedCacheManager(org.apache.shiro.cache.MemoryConstrainedCacheManager) PasswordPolicy(org.neo4j.kernel.api.security.PasswordPolicy) SecurityLog(org.neo4j.server.security.enterprise.log.SecurityLog)

Example 2 with MemoryConstrainedCacheManager

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();
}
Also used : JobScheduler(org.neo4j.kernel.impl.util.JobScheduler) FormattedLog(org.neo4j.logging.FormattedLog) StringWriter(java.io.StringWriter) Log(org.neo4j.logging.Log) FormattedLog(org.neo4j.logging.FormattedLog) SecurityLog(org.neo4j.server.security.enterprise.log.SecurityLog) MemoryConstrainedCacheManager(org.apache.shiro.cache.MemoryConstrainedCacheManager) SecurityLog(org.neo4j.server.security.enterprise.log.SecurityLog) BasicPasswordPolicy(org.neo4j.server.security.auth.BasicPasswordPolicy) InMemoryUserRepository(org.neo4j.server.security.auth.InMemoryUserRepository)

Aggregations

MemoryConstrainedCacheManager (org.apache.shiro.cache.MemoryConstrainedCacheManager)2 JobScheduler (org.neo4j.kernel.impl.util.JobScheduler)2 Log (org.neo4j.logging.Log)2 SecurityLog (org.neo4j.server.security.enterprise.log.SecurityLog)2 StringWriter (java.io.StringWriter)1 PasswordPolicy (org.neo4j.kernel.api.security.PasswordPolicy)1 AssertableLogProvider.inLog (org.neo4j.logging.AssertableLogProvider.inLog)1 FormattedLog (org.neo4j.logging.FormattedLog)1 BasicPasswordPolicy (org.neo4j.server.security.auth.BasicPasswordPolicy)1 InMemoryUserRepository (org.neo4j.server.security.auth.InMemoryUserRepository)1