use of org.neo4j.kernel.api.security.SecurityModule in project neo4j by neo4j.
the class EditionModule method setupSecurityModule.
protected static void setupSecurityModule(PlatformModule platformModule, Log log, Procedures procedures, String key) {
for (SecurityModule candidate : Service.load(SecurityModule.class)) {
if (candidate.matches(key)) {
try {
candidate.setup(new SecurityModule.Dependencies() {
@Override
public LogService logService() {
return platformModule.logging;
}
@Override
public Config config() {
return platformModule.config;
}
@Override
public Procedures procedures() {
return procedures;
}
@Override
public JobScheduler scheduler() {
return platformModule.jobScheduler;
}
@Override
public FileSystemAbstraction fileSystem() {
return platformModule.fileSystem;
}
@Override
public LifeSupport lifeSupport() {
return platformModule.life;
}
@Override
public DependencySatisfier dependencySatisfier() {
return platformModule.dependencies;
}
});
return;
} catch (Exception e) {
String errorMessage = "Failed to load security module.";
log.error(errorMessage);
throw new RuntimeException(errorMessage, e);
}
}
}
String errorMessage = "Failed to load security module with key '" + key + "'.";
log.error(errorMessage);
throw new IllegalArgumentException(errorMessage);
}
use of org.neo4j.kernel.api.security.SecurityModule in project neo4j by neo4j.
the class CommunityEditionModule method makeSecurityModule.
private SecurityProvider makeSecurityModule(GlobalModule globalModule) {
globalModule.getGlobalDependencies().satisfyDependency(CommunitySecurityLog.NULL_LOG);
setupSecurityGraphInitializer(globalModule);
if (globalModule.getGlobalConfig().get(GraphDatabaseSettings.auth_enabled)) {
SecurityModule securityModule = new CommunitySecurityModule(globalModule.getLogService(), globalModule.getGlobalConfig(), globalModule.getGlobalDependencies());
securityModule.setup();
return securityModule;
}
return NoAuthSecurityProvider.INSTANCE;
}
Aggregations