diff --git a/community/bolt/src/test/java/org/neo4j/bolt/v1/transport/integration/AuthenticationIT.java b/community/bolt/src/test/java/org/neo4j/bolt/v1/transport/integration/AuthenticationIT.java index 2093ac1deed1a..2828f26421a5e 100644 --- a/community/bolt/src/test/java/org/neo4j/bolt/v1/transport/integration/AuthenticationIT.java +++ b/community/bolt/src/test/java/org/neo4j/bolt/v1/transport/integration/AuthenticationIT.java @@ -28,6 +28,8 @@ import java.util.Collection; import java.util.Collections; +import java.util.Map; +import java.util.function.Consumer; import org.neo4j.bolt.v1.transport.socket.client.Connection; import org.neo4j.bolt.v1.transport.socket.client.SecureSocketConnection; @@ -35,6 +37,7 @@ import org.neo4j.bolt.v1.transport.socket.client.SocketConnection; import org.neo4j.bolt.v1.transport.socket.client.WebSocketConnection; import org.neo4j.function.Factory; +import org.neo4j.graphdb.config.Setting; import org.neo4j.graphdb.factory.GraphDatabaseSettings; import org.neo4j.helpers.HostnamePort; import org.neo4j.kernel.api.exceptions.Status; @@ -53,8 +56,12 @@ public class AuthenticationIT { @Rule - public Neo4jWithSocket server = new Neo4jWithSocket( settings -> - settings.put( GraphDatabaseSettings.auth_enabled, "true" ) ); + public Neo4jWithSocket server = new Neo4jWithSocket( getSettingsFunction() ); + + protected Consumer, String>> getSettingsFunction() + { + return settings -> settings.put( GraphDatabaseSettings.auth_enabled, "true" ); + } @Parameterized.Parameter( 0 ) public Factory cf; diff --git a/community/server/src/test/java/org/neo4j/server/rest/security/AuthenticationDocIT.java b/community/server/src/test/java/org/neo4j/server/rest/security/AuthenticationDocIT.java index 99aef1ee2d5f9..b82510201eb73 100644 --- a/community/server/src/test/java/org/neo4j/server/rest/security/AuthenticationDocIT.java +++ b/community/server/src/test/java/org/neo4j/server/rest/security/AuthenticationDocIT.java @@ -50,7 +50,7 @@ public class AuthenticationDocIT extends ExclusiveServerTestBase { @Rule public TestData gen = TestData.producedThrough( RESTDocsGenerator.PRODUCER ); - private CommunityNeoServer server; + protected CommunityNeoServer server; @Before public void setUp() @@ -189,7 +189,7 @@ public void shouldSayMalformedHeaderIfMalformedAuthorization() throws Exception } @Test - public void shouldNotAllowDataAccess() throws Exception + public void shouldAllowDataAccess() throws Exception { // Given startServerWithConfiguredUser(); diff --git a/enterprise/security/pom.xml b/enterprise/security/pom.xml index 5877f773fa670..af18bb05a13c7 100644 --- a/enterprise/security/pom.xml +++ b/enterprise/security/pom.xml @@ -103,6 +103,33 @@ test-jar test + + org.neo4j + neo4j-bolt + ${project.version} + test + + + org.neo4j + neo4j-bolt + ${project.version} + test-jar + test + + + org.neo4j + neo4j-kernel + ${project.version} + test-jar + test + + + org.neo4j + neo4j-io + ${project.version} + test-jar + test + junit junit @@ -148,6 +175,11 @@ commons-lang3 test + + org.eclipse.jetty.websocket + websocket-client + test + diff --git a/enterprise/security/src/main/java/org/neo4j/server/security/enterprise/auth/ShiroAuthManager.java b/enterprise/security/src/main/java/org/neo4j/server/security/enterprise/auth/ShiroAuthManager.java index 7425e8b8db8d5..5a0ed0184ce0e 100644 --- a/enterprise/security/src/main/java/org/neo4j/server/security/enterprise/auth/ShiroAuthManager.java +++ b/enterprise/security/src/main/java/org/neo4j/server/security/enterprise/auth/ShiroAuthManager.java @@ -189,8 +189,6 @@ public void setPassword( AuthSubject authSubject, String username, String passwo throw new AuthorizationViolationException( "Invalid attempt to change the password for user " + username ); } - passwordPolicy.validatePassword( password ); - setUserPassword( username, password ); } diff --git a/enterprise/security/src/test/java/org/neo4j/server/security/enterprise/auth/integration/bolt/EnterpriseAuthenticationIT.java b/enterprise/security/src/test/java/org/neo4j/server/security/enterprise/auth/integration/bolt/EnterpriseAuthenticationIT.java new file mode 100644 index 0000000000000..8552b0e7e2651 --- /dev/null +++ b/enterprise/security/src/test/java/org/neo4j/server/security/enterprise/auth/integration/bolt/EnterpriseAuthenticationIT.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2002-2016 "Neo Technology," + * Network Engine for Objects in Lund AB [http://neotechnology.com] + * + * This file is part of Neo4j. + * + * Neo4j is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.neo4j.server.security.enterprise.auth.integration.bolt; + +import java.util.Map; +import java.util.function.Consumer; + +import org.neo4j.bolt.v1.transport.integration.AuthenticationIT; +import org.neo4j.graphdb.config.Setting; +import org.neo4j.graphdb.factory.GraphDatabaseSettings; + +public class EnterpriseAuthenticationIT extends AuthenticationIT +{ + @Override + protected Consumer, String>> getSettingsFunction() + { + return settings -> { + settings.put( GraphDatabaseSettings.auth_enabled, "true" ); + settings.put( GraphDatabaseSettings.auth_manager, "enterprise-auth-manager" ); + }; + } +} diff --git a/enterprise/server-enterprise/LICENSES.txt b/enterprise/server-enterprise/LICENSES.txt index 3afde1ebf7836..203ee73aafc76 100644 --- a/enterprise/server-enterprise/LICENSES.txt +++ b/enterprise/server-enterprise/LICENSES.txt @@ -5,8 +5,6 @@ libraries. For an overview of the licenses see the NOTICE.txt file. Apache Software License, Version 2.0 Apache Commons Configuration Apache Commons Lang - Apache Shiro :: Core - Apache Shiro :: Support :: EHCache Commons BeanUtils Commons Digester Commons IO @@ -14,7 +12,6 @@ Apache Software License, Version 2.0 Commons Logging ConcurrentLinkedHashMap Data Mapper for Jackson - Ehcache Core Graphite Integration for Metrics hazelcast-all Jackson diff --git a/enterprise/server-enterprise/NOTICE.txt b/enterprise/server-enterprise/NOTICE.txt index ab2668b342cbf..0a60f004bd713 100644 --- a/enterprise/server-enterprise/NOTICE.txt +++ b/enterprise/server-enterprise/NOTICE.txt @@ -27,8 +27,6 @@ Third-party licenses Apache Software License, Version 2.0 Apache Commons Configuration Apache Commons Lang - Apache Shiro :: Core - Apache Shiro :: Support :: EHCache Commons BeanUtils Commons Digester Commons IO @@ -36,7 +34,6 @@ Apache Software License, Version 2.0 Commons Logging ConcurrentLinkedHashMap Data Mapper for Jackson - Ehcache Core Graphite Integration for Metrics hazelcast-all Jackson diff --git a/enterprise/server-enterprise/pom.xml b/enterprise/server-enterprise/pom.xml index 6489f805862ef..7ce43a16fe3a9 100644 --- a/enterprise/server-enterprise/pom.xml +++ b/enterprise/server-enterprise/pom.xml @@ -109,6 +109,19 @@ test-jar test + + org.neo4j + neo4j-security-enterprise + ${project.version} + test + + + org.neo4j + neo4j-security-enterprise + ${project.version} + test-jar + test + org.neo4j diff --git a/enterprise/server-enterprise/src/test/java/org/neo4j/server/rest/security/EnterpriseAuthenticationDocIT.java b/enterprise/server-enterprise/src/test/java/org/neo4j/server/rest/security/EnterpriseAuthenticationDocIT.java new file mode 100644 index 0000000000000..22d7df9f1a9b8 --- /dev/null +++ b/enterprise/server-enterprise/src/test/java/org/neo4j/server/rest/security/EnterpriseAuthenticationDocIT.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2002-2016 "Neo Technology," + * Network Engine for Objects in Lund AB [http://neotechnology.com] + * + * This file is part of Neo4j. + * + * Neo4j is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.neo4j.server.rest.security; + +import java.io.IOException; + +import org.neo4j.graphdb.factory.GraphDatabaseSettings; +import org.neo4j.server.enterprise.helpers.EnterpriseServerBuilder; + +public class EnterpriseAuthenticationDocIT extends AuthenticationDocIT +{ + @Override + public void startServer( boolean authEnabled ) throws IOException + { + server = EnterpriseServerBuilder.server() + .withProperty( GraphDatabaseSettings.auth_enabled.name(), Boolean.toString( authEnabled ) ) + .withProperty( GraphDatabaseSettings.auth_manager.name(), "enterprise-auth-manager" ) + .build(); + server.start(); + } +}