use of org.neo4j.server.security.auth.InMemoryUserRepository 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.InMemoryUserRepository in project neo4j by neo4j.
the class BasicAuthenticationTest method setup.
@Before
public void setup() throws Throwable {
UserRepository userRepository = new InMemoryUserRepository();
PasswordPolicy policy = mock(PasswordPolicy.class);
BasicAuthManager manager = new BasicAuthManager(userRepository, policy, Clocks.systemClock(), userRepository);
authentication = new BasicAuthentication(manager, manager);
manager.newUser("bob", "secret", true);
manager.newUser("mike", "secret2", false);
}
use of org.neo4j.server.security.auth.InMemoryUserRepository 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.InMemoryUserRepository 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);
}
use of org.neo4j.server.security.auth.InMemoryUserRepository in project neo4j by neo4j.
the class BasicSystemGraphRealmIT method setUp.
@BeforeEach
void setUp() {
dbManager = new BasicSystemGraphRealmTestHelper.TestDatabaseManager(testDirectory);
SecureHasher secureHasher = new SecureHasher();
realmHelper = new SystemGraphRealmHelper(SystemGraphRealmHelper.makeSystemSupplier(dbManager), secureHasher);
defaultConfig = Config.defaults();
oldUsers = new InMemoryUserRepository();
initialPassword = new InMemoryUserRepository();
}
Aggregations