Search in sources :

Example 1 with DefaultSystemGraphInitializer

use of org.neo4j.dbms.database.DefaultSystemGraphInitializer in project neo4j by neo4j.

the class BasicSystemGraphRealmIT method startSystemGraphRealm.

private void startSystemGraphRealm() throws Exception {
    Config config = Config.defaults(DatabaseManagementSystemSettings.auth_store_directory, testDirectory.directory("data/dbms"));
    var systemGraphComponents = new SystemGraphComponents();
    systemGraphComponents.register(new DefaultSystemGraphComponent(config));
    systemGraphComponents.register(new UserSecurityGraphComponent(Mockito.mock(AbstractSecurityLog.class), oldUsers, initialPassword, config));
    var systemGraphSupplier = SystemGraphRealmHelper.makeSystemSupplier(dbManager);
    systemGraphInitializer = new DefaultSystemGraphInitializer(systemGraphSupplier, systemGraphComponents);
    systemGraphInitializer.start();
    RateLimitedAuthenticationStrategy authStrategy = new RateLimitedAuthenticationStrategy(Clock.systemUTC(), config);
    realm = new BasicSystemGraphRealm(realmHelper, authStrategy);
}
Also used : SystemGraphComponents(org.neo4j.dbms.database.SystemGraphComponents) DefaultSystemGraphInitializer(org.neo4j.dbms.database.DefaultSystemGraphInitializer) RateLimitedAuthenticationStrategy(org.neo4j.server.security.auth.RateLimitedAuthenticationStrategy) DefaultSystemGraphComponent(org.neo4j.dbms.database.DefaultSystemGraphComponent) UserSecurityGraphComponent(org.neo4j.server.security.systemgraph.UserSecurityGraphComponent) Config(org.neo4j.configuration.Config) BasicSystemGraphRealm(org.neo4j.server.security.systemgraph.BasicSystemGraphRealm)

Example 2 with DefaultSystemGraphInitializer

use of org.neo4j.dbms.database.DefaultSystemGraphInitializer in project neo4j by neo4j.

the class CommunityEditionModule method createSystemGraphInitializer.

@Override
public SystemGraphInitializer createSystemGraphInitializer(GlobalModule globalModule) {
    DependencyResolver globalDependencies = globalModule.getGlobalDependencies();
    Supplier<GraphDatabaseService> systemSupplier = systemSupplier(globalDependencies);
    var systemGraphComponents = globalModule.getSystemGraphComponents();
    SystemGraphInitializer initializer = CommunityEditionModule.tryResolveOrCreate(SystemGraphInitializer.class, globalModule.getExternalDependencyResolver(), () -> new DefaultSystemGraphInitializer(systemSupplier, systemGraphComponents));
    return globalModule.getGlobalDependencies().satisfyDependency(initializer);
}
Also used : DefaultSystemGraphInitializer(org.neo4j.dbms.database.DefaultSystemGraphInitializer) GraphDatabaseService(org.neo4j.graphdb.GraphDatabaseService) DefaultSystemGraphInitializer(org.neo4j.dbms.database.DefaultSystemGraphInitializer) SystemGraphInitializer(org.neo4j.dbms.database.SystemGraphInitializer) DependencyResolver(org.neo4j.common.DependencyResolver)

Aggregations

DefaultSystemGraphInitializer (org.neo4j.dbms.database.DefaultSystemGraphInitializer)2 DependencyResolver (org.neo4j.common.DependencyResolver)1 Config (org.neo4j.configuration.Config)1 DefaultSystemGraphComponent (org.neo4j.dbms.database.DefaultSystemGraphComponent)1 SystemGraphComponents (org.neo4j.dbms.database.SystemGraphComponents)1 SystemGraphInitializer (org.neo4j.dbms.database.SystemGraphInitializer)1 GraphDatabaseService (org.neo4j.graphdb.GraphDatabaseService)1 RateLimitedAuthenticationStrategy (org.neo4j.server.security.auth.RateLimitedAuthenticationStrategy)1 BasicSystemGraphRealm (org.neo4j.server.security.systemgraph.BasicSystemGraphRealm)1 UserSecurityGraphComponent (org.neo4j.server.security.systemgraph.UserSecurityGraphComponent)1