use of org.neo4j.server.security.auth.BasicPasswordPolicy in project neo4j by neo4j.
the class UserManagementProceduresLoggingTest method getUserManager.
private EnterpriseUserManager getUserManager() throws Throwable {
InternalFlatFileRealm realm = new InternalFlatFileRealm(new InMemoryUserRepository(), new InMemoryRoleRepository(), new BasicPasswordPolicy(), mock(AuthenticationStrategy.class), mock(JobScheduler.class), new InMemoryUserRepository(), new InMemoryUserRepository());
// creates default user and roles
realm.start();
return realm;
}
use of org.neo4j.server.security.auth.BasicPasswordPolicy in project neo4j by neo4j.
the class FlatFileStressBase method setup.
@Before
public void setup() throws Throwable {
Config config = Config.defaults();
LogProvider logProvider = NullLogProvider.getInstance();
JobScheduler jobScheduler = new NoopJobScheduler();
userRepository = CommunitySecurityModule.getUserRepository(config, logProvider, getFileSystem());
roleRepository = EnterpriseSecurityModule.getRoleRepository(config, logProvider, getFileSystem());
flatFileRealm = new InternalFlatFileRealm(userRepository, roleRepository, new BasicPasswordPolicy(), new RateLimitedAuthenticationStrategy(Clock.systemUTC(), 3), jobScheduler, CommunitySecurityModule.getInitialUserRepository(config, logProvider, getFileSystem()), EnterpriseSecurityModule.getDefaultAdminRepository(config, logProvider, getFileSystem()));
flatFileRealm.init();
flatFileRealm.start();
}
use of org.neo4j.server.security.auth.BasicPasswordPolicy in project neo4j by neo4j.
the class InternalFlatFileRealmIT method setup.
@Before
public void setup() throws Throwable {
fs = new EvilFileSystem(new EphemeralFileSystemAbstraction());
userStoreFile = new File("dbms", "auth");
roleStoreFile = new File("dbms", "roles");
final UserRepository userRepository = new FileUserRepository(fs, userStoreFile, logProvider);
final RoleRepository roleRepository = new FileRoleRepository(fs, roleStoreFile, logProvider);
final UserRepository initialUserRepository = CommunitySecurityModule.getInitialUserRepository(Config.defaults(), logProvider, fs);
final UserRepository defaultAdminRepository = EnterpriseSecurityModule.getDefaultAdminRepository(Config.defaults(), logProvider, fs);
final PasswordPolicy passwordPolicy = new BasicPasswordPolicy();
AuthenticationStrategy authenticationStrategy = new RateLimitedAuthenticationStrategy(Clocks.systemClock(), 3);
realm = new InternalFlatFileRealm(userRepository, roleRepository, passwordPolicy, authenticationStrategy, true, true, jobScheduler, initialUserRepository, defaultAdminRepository);
realm.init();
realm.start();
}
use of org.neo4j.server.security.auth.BasicPasswordPolicy in project neo4j by neo4j.
the class PersonalUserManagerTest method setup.
@Before
public void setup() {
evilUserManager = new EvilUserManager(new InternalFlatFileRealm(new InMemoryUserRepository(), new InMemoryRoleRepository(), new BasicPasswordPolicy(), new RateLimitedAuthenticationStrategy(Clock.systemUTC(), 3), new InternalFlatFileRealmIT.TestJobScheduler(), new InMemoryUserRepository(), new InMemoryUserRepository()));
log = spy(Log.class);
userManager = new PersonalUserManager(evilUserManager, SecurityContext.AUTH_DISABLED, new SecurityLog(log));
}
use of org.neo4j.server.security.auth.BasicPasswordPolicy in project neo4j by neo4j.
the class LdapCachingTest method setup.
@Before
public void setup() throws Throwable {
SecurityLog securityLog = mock(SecurityLog.class);
InternalFlatFileRealm internalFlatFileRealm = new InternalFlatFileRealm(new InMemoryUserRepository(), new InMemoryRoleRepository(), new BasicPasswordPolicy(), new RateLimitedAuthenticationStrategy(Clock.systemUTC(), 3), mock(JobScheduler.class), new InMemoryUserRepository(), new InMemoryUserRepository());
testRealm = new TestRealm(getLdapConfig(), securityLog, new SecureHasher());
List<Realm> realms = listOf(internalFlatFileRealm, testRealm);
fakeTicker = new FakeTicker();
authManager = new MultiRealmAuthManager(internalFlatFileRealm, realms, new ShiroCaffeineCache.Manager(fakeTicker::read, 100, 10), securityLog, false);
authManager.init();
authManager.start();
authManager.getUserManager().newUser("mike", "123", false);
authManager.getUserManager().newUser("mats", "456", false);
}
Aggregations