Skip to content

Commit

Permalink
Rename authorization_enabled to auth_enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
cleishm committed Feb 24, 2015
1 parent cd51646 commit 54dbc4e
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 20 deletions.
Expand Up @@ -57,7 +57,7 @@ public class InProcessServerBuilder implements TestServerBuilder
public InProcessServerBuilder( File workingDir ) public InProcessServerBuilder( File workingDir )
{ {
setDirectory( workingDir ); setDirectory( workingDir );
withConfig( ServerSettings.authorization_enabled, "false" ); withConfig( ServerSettings.auth_enabled, "false" );
withConfig( WEBSERVER_PORT_PROPERTY_KEY, Integer.toString( freePort() ) ); withConfig( WEBSERVER_PORT_PROPERTY_KEY, Integer.toString( freePort() ) );
} }


Expand Down
Expand Up @@ -154,7 +154,7 @@ private ThirdPartyJaxRsPackage createThirdPartyJaxRsPackage( String packageAndMo
@Description( "Timeout for idle transactions." ) @Description( "Timeout for idle transactions." )
public static final Setting<Long> transaction_timeout = setting( "org.neo4j.server.transaction.timeout", DURATION, "60s" ); public static final Setting<Long> transaction_timeout = setting( "org.neo4j.server.transaction.timeout", DURATION, "60s" );


@Description( "Enable authorization requirement to access Neo4j." ) @Description( "Enable auth requirement to access Neo4j." )
public static final Setting<Boolean> authorization_enabled = setting("dbms.security.authorization_enabled", public static final Setting<Boolean> auth_enabled = setting("dbms.security.auth_enabled",
BOOLEAN, TRUE); BOOLEAN, TRUE);
} }
Expand Up @@ -45,7 +45,7 @@ public AuthorizationModule( WebServer webServer, AuthManager authManager, Config
@Override @Override
public void start() public void start()
{ {
if ( config.get( ServerSettings.authorization_enabled ) ) if ( config.get( ServerSettings.auth_enabled ) )
{ {
webServer.addFilter( new AuthorizationFilter( authManager, log ), "/*" ); webServer.addFilter( new AuthorizationFilter( authManager, log ), "/*" );
} }
Expand Down
Expand Up @@ -105,7 +105,7 @@ public void shouldAllowModifyingProperties()
// let the server endpoint be on a custom port // let the server endpoint be on a custom port
config.configuration().setProperty( config.configuration().setProperty(
Configurator.WEBSERVER_PORT_PROPERTY_KEY, "7575" ); Configurator.WEBSERVER_PORT_PROPERTY_KEY, "7575" );
config.configuration().setProperty( ServerSettings.authorization_enabled.name(), "false" ); config.configuration().setProperty( ServerSettings.auth_enabled.name(), "false" );


WrappingNeoServerBootstrapper srv; WrappingNeoServerBootstrapper srv;
srv = new WrappingNeoServerBootstrapper( graphdb, config ); srv = new WrappingNeoServerBootstrapper( graphdb, config );
Expand All @@ -125,7 +125,7 @@ public void shouldAllowModifyingProperties()
public void shouldAllowShellConsoleWithoutCustomConfig() public void shouldAllowShellConsoleWithoutCustomConfig()
{ {
ServerConfigurator config = new ServerConfigurator( myDb ); ServerConfigurator config = new ServerConfigurator( myDb );
config.configuration().setProperty( ServerSettings.authorization_enabled.name(), "false" ); config.configuration().setProperty( ServerSettings.auth_enabled.name(), "false" );
WrappingNeoServerBootstrapper srv = new WrappingNeoServerBootstrapper( myDb, config ); WrappingNeoServerBootstrapper srv = new WrappingNeoServerBootstrapper( myDb, config );
srv.start(); srv.start();
String response = gen.get().payload( String response = gen.get().payload(
Expand All @@ -143,7 +143,7 @@ public void shouldAllowModifyingListenPorts() throws UnknownHostException
String hostAddress = InetAddress.getLocalHost().getHostAddress(); String hostAddress = InetAddress.getLocalHost().getHostAddress();
config.configuration().setProperty( config.configuration().setProperty(
Configurator.WEBSERVER_ADDRESS_PROPERTY_KEY, hostAddress.toString() ); Configurator.WEBSERVER_ADDRESS_PROPERTY_KEY, hostAddress.toString() );
config.configuration().setProperty( ServerSettings.authorization_enabled.name(), "false" ); config.configuration().setProperty( ServerSettings.auth_enabled.name(), "false" );
config.configuration().setProperty( config.configuration().setProperty(
Configurator.WEBSERVER_PORT_PROPERTY_KEY, "8484" ); Configurator.WEBSERVER_PORT_PROPERTY_KEY, "8484" );


Expand Down Expand Up @@ -173,7 +173,7 @@ public void shouldRespondAndBeAbleToModifyDb()
{ {
Configurator configurator = new ServerConfigurator(myDb); Configurator configurator = new ServerConfigurator(myDb);


configurator.configuration().setProperty( ServerSettings.authorization_enabled.name(), "false" ); configurator.configuration().setProperty( ServerSettings.auth_enabled.name(), "false" );
WrappingNeoServerBootstrapper srv = new WrappingNeoServerBootstrapper( myDb, configurator ); WrappingNeoServerBootstrapper srv = new WrappingNeoServerBootstrapper( myDb, configurator );
srv.start(); srv.start();


Expand Down
Expand Up @@ -217,7 +217,7 @@ private void createPropertiesFile( File temporaryConfigFile )
} }
} }


properties.put( ServerSettings.authorization_enabled.name(), "false" ); properties.put( ServerSettings.auth_enabled.name(), "false" );
properties.put( ServerInternalSettings.authorization_store.name(), "neo4j-home/data/dbms/authorization" ); properties.put( ServerInternalSettings.authorization_store.name(), "neo4j-home/data/dbms/authorization" );


for ( Object key : arbitraryProperties.keySet() ) for ( Object key : arbitraryProperties.keySet() )
Expand Down
Expand Up @@ -48,7 +48,7 @@ public void shouldReturnValidJSONWithDataAndManagementUris() throws Exception
when( mockConfig.get( ServerInternalSettings.management_api_path ) ).thenReturn( managementUri ); when( mockConfig.get( ServerInternalSettings.management_api_path ) ).thenReturn( managementUri );
URI dataUri = new URI( "/data" ); URI dataUri = new URI( "/data" );
when( mockConfig.get( ServerInternalSettings.rest_api_path ) ).thenReturn( dataUri ); when( mockConfig.get( ServerInternalSettings.rest_api_path ) ).thenReturn( dataUri );
when(mockConfig.get( ServerSettings.authorization_enabled )).thenReturn( false ); when(mockConfig.get( ServerSettings.auth_enabled )).thenReturn( false );


String baseUri = "http://www.example.com"; String baseUri = "http://www.example.com";
DiscoveryService ds = new DiscoveryService( mockConfig, new EntityOutputFormat( new JsonFormat(), new URI( DiscoveryService ds = new DiscoveryService( mockConfig, new EntityOutputFormat( new JsonFormat(), new URI(
Expand Down
Expand Up @@ -319,7 +319,7 @@ public void startServer(boolean authEnabled) throws IOException
{ {
new File( "neo4j-home/data/dbms/authorization" ).delete(); // TODO: Implement a common component for managing Neo4j file structure and use that here new File( "neo4j-home/data/dbms/authorization" ).delete(); // TODO: Implement a common component for managing Neo4j file structure and use that here
server = CommunityServerBuilder.server() server = CommunityServerBuilder.server()
.withProperty( ServerSettings.authorization_enabled.name(), Boolean.toString( authEnabled ) ) .withProperty( ServerSettings.auth_enabled.name(), Boolean.toString( authEnabled ) )
.build(); .build();
server.start(); server.start();
} }
Expand Down
Expand Up @@ -162,7 +162,7 @@ public void cleanup()
public void startServer(boolean authEnabled) throws IOException public void startServer(boolean authEnabled) throws IOException
{ {
new File( "neo4j-home/data/dbms/authorization" ).delete(); // TODO: Implement a common component for managing Neo4j file structure and use that here new File( "neo4j-home/data/dbms/authorization" ).delete(); // TODO: Implement a common component for managing Neo4j file structure and use that here
server = CommunityServerBuilder.server().withProperty( ServerSettings.authorization_enabled.name(), server = CommunityServerBuilder.server().withProperty( ServerSettings.auth_enabled.name(),
Boolean.toString( authEnabled ) ).build(); Boolean.toString( authEnabled ) ).build();
server.start(); server.start();
} }
Expand Down
Expand Up @@ -40,7 +40,7 @@ public class AuthorizationDisabledIT extends ExclusiveServerTestBase
public void shouldAllowDisablingAuthorization() throws Exception public void shouldAllowDisablingAuthorization() throws Exception
{ {
// Given // Given
server = CommunityServerBuilder.server().withProperty( ServerSettings.authorization_enabled.name(), "false" ).build(); server = CommunityServerBuilder.server().withProperty( ServerSettings.auth_enabled.name(), "false" ).build();


// When // When
server.start(); server.start();
Expand Down
2 changes: 1 addition & 1 deletion packaging/standalone/pom.xml
Expand Up @@ -56,7 +56,7 @@
<org.neo4j.server.webserver.https.keystore.location>data/keystore</org.neo4j.server.webserver.https.keystore.location> <org.neo4j.server.webserver.https.keystore.location>data/keystore</org.neo4j.server.webserver.https.keystore.location>
<org.neo4j.webservice.packages>org.neo4j.rest.web,org.neo4j.webadmin,org.neo4j.webadmin.backup,org.neo4j.webadmin.console,org.neo4j.webadmin.domain,org.neo4j.webadmin.parser,org.neo4j.webadmin.properties,org.neo4j.webadmin.resources,org.neo4j.webadmin.rest,org.neo4j.webadmin.rrd,org.neo4j.webadmin.task,org.neo4j.webadmin.utils</org.neo4j.webservice.packages> <org.neo4j.webservice.packages>org.neo4j.rest.web,org.neo4j.webadmin,org.neo4j.webadmin.backup,org.neo4j.webadmin.console,org.neo4j.webadmin.domain,org.neo4j.webadmin.parser,org.neo4j.webadmin.properties,org.neo4j.webadmin.resources,org.neo4j.webadmin.rest,org.neo4j.webadmin.rrd,org.neo4j.webadmin.task,org.neo4j.webadmin.utils</org.neo4j.webservice.packages>
<org.neo4j.server.bundledir>system/lib</org.neo4j.server.bundledir> <org.neo4j.server.bundledir>system/lib</org.neo4j.server.bundledir>
<dbms.security.require_authorization>true</dbms.security.require_authorization> <dbms.security.require_auth>true</dbms.security.require_auth>


<!-- Runtime properties. These are used to bootstrap the server. All other configuration should happen through a configuration file. Each of these should have a sensible default, so that the server can operate without them defined. --> <!-- Runtime properties. These are used to bootstrap the server. All other configuration should happen through a configuration file. Each of these should have a sensible default, so that the server can operate without them defined. -->
<neo4j.home>${project.build.directory}/neo4j</neo4j.home> <neo4j.home>${project.build.directory}/neo4j</neo4j.home>
Expand Down
Expand Up @@ -20,8 +20,8 @@ org.neo4j.server.db.tuning.properties=conf/neo4j.properties
# security section in the neo4j manual before modifying this. # security section in the neo4j manual before modifying this.
#org.neo4j.server.webserver.address=0.0.0.0 #org.neo4j.server.webserver.address=0.0.0.0


# Require (or disable the requirement of) authorization to access Neo4j # Require (or disable the requirement of) auth to access Neo4j
dbms.security.authorization_enabled=${dbms.security.require_authorization} dbms.security.auth_enabled=${dbms.security.require_auth}


# #
# HTTP Connector # HTTP Connector
Expand Down
Expand Up @@ -20,8 +20,8 @@ org.neo4j.server.db.tuning.properties=conf/neo4j.properties
# security section in the neo4j manual before modifying this. # security section in the neo4j manual before modifying this.
#org.neo4j.server.webserver.address=0.0.0.0 #org.neo4j.server.webserver.address=0.0.0.0


# Require (or disable the requirement of) authorization to access Neo4j # Require (or disable the requirement of) auth to access Neo4j
dbms.security.authorization_enabled=${dbms.security.require_authorization} dbms.security.auth_enabled=${dbms.security.require_auth}


# #
# HTTP Connector # HTTP Connector
Expand Down
Expand Up @@ -27,8 +27,8 @@ org.neo4j.server.db.tuning.properties=conf/neo4j.properties
# security section in the neo4j manual before modifying this. # security section in the neo4j manual before modifying this.
#org.neo4j.server.webserver.address=0.0.0.0 #org.neo4j.server.webserver.address=0.0.0.0


# Require (or disable the requirement of) authorization to access Neo4j # Require (or disable the requirement of) auth to access Neo4j
dbms.security.authorization_enabled=${dbms.security.require_authorization} dbms.security.auth_enabled=${dbms.security.require_auth}


# #
# HTTP Connector # HTTP Connector
Expand Down

0 comments on commit 54dbc4e

Please sign in to comment.