Search in sources :

Example 6 with SecurityLog

use of org.neo4j.server.security.enterprise.log.SecurityLog 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)

Example 7 with SecurityLog

use of org.neo4j.server.security.enterprise.log.SecurityLog in project neo4j by neo4j.

the class UserManagementProceduresLoggingTest method setUp.

@Before
public void setUp() throws Throwable {
    log = new AssertableLogProvider();
    SecurityLog securityLog = new SecurityLog(log.getLog(getClass()));
    authProcedures = new TestUserManagementProcedures();
    authProcedures.graph = mock(GraphDatabaseAPI.class);
    authProcedures.securityLog = securityLog;
    generalUserManager = getUserManager();
    EnterpriseSecurityContext adminContext = new TestSecurityContext("admin", true, generalUserManager);
    matsContext = new TestSecurityContext("mats", false, generalUserManager);
    setSubject(adminContext);
}
Also used : EnterpriseSecurityContext(org.neo4j.kernel.enterprise.api.security.EnterpriseSecurityContext) GraphDatabaseAPI(org.neo4j.kernel.internal.GraphDatabaseAPI) SecurityLog(org.neo4j.server.security.enterprise.log.SecurityLog) AssertableLogProvider(org.neo4j.logging.AssertableLogProvider) Before(org.junit.Before)

Aggregations

SecurityLog (org.neo4j.server.security.enterprise.log.SecurityLog)7 JobScheduler (org.neo4j.kernel.impl.util.JobScheduler)5 BasicPasswordPolicy (org.neo4j.server.security.auth.BasicPasswordPolicy)4 Before (org.junit.Before)3 Log (org.neo4j.logging.Log)3 InMemoryUserRepository (org.neo4j.server.security.auth.InMemoryUserRepository)3 RateLimitedAuthenticationStrategy (org.neo4j.server.security.auth.RateLimitedAuthenticationStrategy)3 MemoryConstrainedCacheManager (org.apache.shiro.cache.MemoryConstrainedCacheManager)2 Realm (org.apache.shiro.realm.Realm)2 FileSystemAbstraction (org.neo4j.io.fs.FileSystemAbstraction)2 Config (org.neo4j.kernel.configuration.Config)2 EnterpriseSecurityContext (org.neo4j.kernel.enterprise.api.security.EnterpriseSecurityContext)2 GraphDatabaseFacade (org.neo4j.kernel.impl.factory.GraphDatabaseFacade)2 Procedures (org.neo4j.kernel.impl.proc.Procedures)2 LifeSupport (org.neo4j.kernel.lifecycle.LifeSupport)2 LogProvider (org.neo4j.logging.LogProvider)2 Ticker (com.github.benmanes.caffeine.cache.Ticker)1 FakeTicker (com.google.common.testing.FakeTicker)1 File (java.io.File)1 StringWriter (java.io.StringWriter)1