Skip to content

Commit

Permalink
Revert "Create a new Commercial Security Module."
Browse files Browse the repository at this point in the history
This reverts commit f05e209.
  • Loading branch information
Lojjs committed Aug 14, 2018
1 parent 9201cbd commit 036854a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 28 deletions.
Expand Up @@ -82,11 +82,6 @@ public EnterpriseSecurityModule()
super( EnterpriseEditionSettings.ENTERPRISE_SECURITY_MODULE_ID ); super( EnterpriseEditionSettings.ENTERPRISE_SECURITY_MODULE_ID );
} }


public EnterpriseSecurityModule( String securityModuleId )
{
super( securityModuleId );
}

@Override @Override
public void setup( Dependencies dependencies ) throws KernelException public void setup( Dependencies dependencies ) throws KernelException
{ {
Expand Down Expand Up @@ -166,15 +161,11 @@ public EnterpriseAuthAndUserManager newAuthManager( Config config, LogProvider l
List<Realm> realms = new ArrayList<>( securityConfig.authProviders.size() + 1 ); List<Realm> realms = new ArrayList<>( securityConfig.authProviders.size() + 1 );
SecureHasher secureHasher = new SecureHasher(); SecureHasher secureHasher = new SecureHasher();


EnterpriseUserManager internalRealm = null; InternalFlatFileRealm internalRealm = null;
if ( securityConfig.hasNativeProvider ) if ( securityConfig.hasNativeProvider )
{ {
internalRealm = createInternalRealm( config, logProvider, fileSystem, jobScheduler ); internalRealm = createInternalRealm( config, logProvider, fileSystem, jobScheduler );
realms.add( (Realm) internalRealm ); realms.add( internalRealm );
}
else if ( config.get( SecuritySettings.native_graph_enabled ) )
{
throw illegalConfiguration("Native graph enabled but native auth provider is not configured." );
} }


if ( securityConfig.hasLdapProvider ) if ( securityConfig.hasLdapProvider )
Expand Down Expand Up @@ -217,13 +208,7 @@ private static List<Realm> selectOrderedActiveRealms( List<String> configuredRea
return orderedActiveRealms; return orderedActiveRealms;
} }


protected EnterpriseUserManager createInternalRealm( Config config, LogProvider logProvider, public static InternalFlatFileRealm createInternalRealm( Config config, LogProvider logProvider,
FileSystemAbstraction fileSystem, JobScheduler jobScheduler )
{
return createInternalFlatFileRealm( config, logProvider, fileSystem, jobScheduler );
}

protected static InternalFlatFileRealm createInternalFlatFileRealm( Config config, LogProvider logProvider,
FileSystemAbstraction fileSystem, JobScheduler jobScheduler ) FileSystemAbstraction fileSystem, JobScheduler jobScheduler )
{ {
return new InternalFlatFileRealm( return new InternalFlatFileRealm(
Expand All @@ -239,7 +224,7 @@ protected static InternalFlatFileRealm createInternalFlatFileRealm( Config confi
); );
} }


protected static AuthenticationStrategy createAuthenticationStrategy( Config config ) private static AuthenticationStrategy createAuthenticationStrategy( Config config )
{ {
return new RateLimitedAuthenticationStrategy( Clocks.systemClock(), config ); return new RateLimitedAuthenticationStrategy( Clocks.systemClock(), config );
} }
Expand Down
Expand Up @@ -117,14 +117,6 @@ public class SecuritySettings implements LoadableConfig
providers -> providers.stream().anyMatch( r -> r.startsWith( PLUGIN_REALM_NAME_PREFIX ) ), providers -> providers.stream().anyMatch( r -> r.startsWith( PLUGIN_REALM_NAME_PREFIX ) ),
BOOLEAN ); BOOLEAN );


//=========================================================================
// Native graph settings
//=========================================================================
@Description( "Use NativeGraphRealm for native security." )
@Internal
public static final Setting<Boolean> native_graph_enabled =
setting( "dbms.security.native.graph_enabled", BOOLEAN, "false" );

//========================================================================= //=========================================================================
// LDAP settings // LDAP settings
//========================================================================= //=========================================================================
Expand Down
Expand Up @@ -225,7 +225,6 @@ public void setup()
when( mockLogProvider.getLog( anyString() ) ).thenReturn( mockLog ); when( mockLogProvider.getLog( anyString() ) ).thenReturn( mockLog );
when( mockLog.isDebugEnabled() ).thenReturn( true ); when( mockLog.isDebugEnabled() ).thenReturn( true );
when( config.get( SecuritySettings.property_level_authorization_enabled ) ).thenReturn( false ); when( config.get( SecuritySettings.property_level_authorization_enabled ) ).thenReturn( false );
when( config.get( SecuritySettings.native_graph_enabled ) ).thenReturn( false );
when( config.get( SecuritySettings.auth_cache_ttl ) ).thenReturn( Duration.ZERO ); when( config.get( SecuritySettings.auth_cache_ttl ) ).thenReturn( Duration.ZERO );
when( config.get( SecuritySettings.auth_cache_max_capacity ) ).thenReturn( 10 ); when( config.get( SecuritySettings.auth_cache_max_capacity ) ).thenReturn( 10 );
when( config.get( SecuritySettings.auth_cache_use_ttl ) ).thenReturn( true ); when( config.get( SecuritySettings.auth_cache_use_ttl ) ).thenReturn( true );
Expand Down

0 comments on commit 036854a

Please sign in to comment.