You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by bb...@apache.org on 2017/10/25 19:01:49 UTC
nifi-registry git commit: NIFIREG-44 Refactor integration test
framework to sandbox configuration classes in Spring profiles.
Repository: nifi-registry
Updated Branches:
refs/heads/master 69c9c43c9 -> d441c95e6
NIFIREG-44 Refactor integration test framework to sandbox configuration classes in Spring profiles.
This closes #28.
Signed-off-by: Bryan Bende <bb...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/nifi-registry/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-registry/commit/d441c95e
Tree: http://git-wip-us.apache.org/repos/asf/nifi-registry/tree/d441c95e
Diff: http://git-wip-us.apache.org/repos/asf/nifi-registry/diff/d441c95e
Branch: refs/heads/master
Commit: d441c95e6c786e5cdbffebbba082f0a5ba33047d
Parents: 69c9c43
Author: Kevin Doran <kd...@gmail.com>
Authored: Tue Oct 24 20:42:36 2017 -0400
Committer: Bryan Bende <bb...@apache.org>
Committed: Wed Oct 25 15:01:18 2017 -0400
----------------------------------------------------------------------
nifi-registry-framework/pom.xml | 5 +
nifi-registry-web-api/pom.xml | 6 +
.../apache/nifi/registry/web/api/BucketsIT.java | 6 +-
.../apache/nifi/registry/web/api/FlowsIT.java | 7 +-
.../registry/web/api/IntegrationTestBase.java | 138 ++++++++++++++----
.../nifi/registry/web/api/SecureFileIT.java | 92 ++++++++++++
.../web/api/SecureITClientConfiguration.java | 91 ++++++++++++
.../nifi/registry/web/api/UnsecuredITBase.java | 42 ++++++
.../web/api/UnsecuredIntegrationTestBase.java | 50 -------
.../application-ITSecureFile.properties | 36 +++++
.../application-ITUnsecured.properties | 21 +++
.../src/test/resources/application.properties | 2 +
.../resources/conf/secure-file/authorizers.xml | 143 +++++++++++++++++++
.../secure-file/nifi-registry-client.properties | 25 ++++
.../conf/secure-file/nifi-registry.properties | 33 +++++
.../src/test/resources/keys/README.md | 46 ++++++
.../src/test/resources/keys/client-ks.jks | Bin 0 -> 3048 bytes
.../src/test/resources/keys/localhost-ks.jks | Bin 0 -> 3077 bytes
.../src/test/resources/keys/localhost-ts.jks | Bin 0 -> 911 bytes
19 files changed, 658 insertions(+), 85 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/d441c95e/nifi-registry-framework/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-registry-framework/pom.xml b/nifi-registry-framework/pom.xml
index 68a7d8f..1179188 100644
--- a/nifi-registry-framework/pom.xml
+++ b/nifi-registry-framework/pom.xml
@@ -199,5 +199,10 @@
<version>2.2.2</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.nifi.registry</groupId>
+ <artifactId>nifi-registry-security-utils</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </dependency>
</dependencies>
</project>
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/d441c95e/nifi-registry-web-api/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-registry-web-api/pom.xml b/nifi-registry-web-api/pom.xml
index caa74b6..0174bd5 100644
--- a/nifi-registry-web-api/pom.xml
+++ b/nifi-registry-web-api/pom.xml
@@ -205,5 +205,11 @@
<version>${spring.boot.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.nifi.registry</groupId>
+ <artifactId>nifi-registry-client</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/d441c95e/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/BucketsIT.java
----------------------------------------------------------------------
diff --git a/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/BucketsIT.java b/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/BucketsIT.java
index 88ce2da..15477f9 100644
--- a/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/BucketsIT.java
+++ b/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/BucketsIT.java
@@ -21,8 +21,6 @@ import org.junit.Test;
import org.skyscreamer.jsonassert.JSONAssert;
import org.springframework.test.context.jdbc.Sql;
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@@ -31,9 +29,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
-public class BucketsIT extends UnsecuredIntegrationTestBase {
-
- private final Client client = ClientBuilder.newClient();
+public class BucketsIT extends UnsecuredITBase {
@Test
public void testGetBucketsEmpty() throws Exception {
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/d441c95e/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/FlowsIT.java
----------------------------------------------------------------------
diff --git a/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/FlowsIT.java b/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/FlowsIT.java
index 630a07f..0a238b2 100644
--- a/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/FlowsIT.java
+++ b/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/FlowsIT.java
@@ -26,8 +26,6 @@ import org.junit.Test;
import org.skyscreamer.jsonassert.JSONAssert;
import org.springframework.test.context.jdbc.Sql;
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
@@ -38,11 +36,8 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
-
@Sql(executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD, scripts = {"classpath:db/clearDB.sql", "classpath:db/FlowsIT.sql"})
-public class FlowsIT extends UnsecuredIntegrationTestBase {
-
- private final Client client = ClientBuilder.newClient();
+public class FlowsIT extends UnsecuredITBase {
@Test
public void testGetFlowsEmpty() throws Exception {
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/d441c95e/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/IntegrationTestBase.java
----------------------------------------------------------------------
diff --git a/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/IntegrationTestBase.java b/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/IntegrationTestBase.java
index 8be31bb..5b12074 100644
--- a/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/IntegrationTestBase.java
+++ b/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/IntegrationTestBase.java
@@ -16,30 +16,28 @@
*/
package org.apache.nifi.registry.web.api;
-import org.apache.nifi.registry.NiFiRegistryApiTestApplication;
+import org.apache.nifi.registry.client.NiFiRegistryClientConfig;
import org.apache.nifi.registry.properties.NiFiRegistryProperties;
-import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.embedded.LocalServerPort;
import org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory;
-import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.context.annotation.Bean;
-import org.springframework.test.annotation.DirtiesContext;
-import org.springframework.test.context.jdbc.Sql;
-import org.springframework.test.context.junit4.SpringRunner;
+
+import javax.annotation.PostConstruct;
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.SSLContext;
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.ClientBuilder;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
/**
- * Deploy the Web API Application using an embedded Jetty Server for local integration testing, with the follow characteristics:
- *
- * - A NiFiRegistryProperties Bean has to be explicitly provided to the application context, i.e. using an inline @TestConfiguration class
- * - @DirtiesContext is providing that each (sub)class gets a fresh context
- * - The database is embed H2 using volatile (in-memory) persistence
- * - Custom SQL is clearing the DB before each test method by default, unless method overrides this behavior
+ * A base class to simplify creating integration tests against an API application running with an embedded server and volatile DB.
*/
-@RunWith(SpringRunner.class)
-@SpringBootTest(classes = NiFiRegistryApiTestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
-@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_CLASS)
-@Sql(executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD, scripts = "classpath:db/clearDB.sql")
public abstract class IntegrationTestBase {
private static final String CONTEXT_PATH = "/nifi-registry-api-test";
@@ -47,6 +45,14 @@ public abstract class IntegrationTestBase {
@TestConfiguration
public static class TestConfigurationClass {
+ /* REQUIRED: Any subclass extending IntegrationTestBase must add a Spring profile that defines a
+ * property value for this key containing the path to the nifi-registy.properties file to use to
+ * create a NiFiRegistryProperties Bean in the ApplicationContext. */
+ @Value("${nifi.registry.properties.file}")
+ private String propertiesFileLocation;
+
+ private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
+ private final Lock readLock = lock.readLock();
private NiFiRegistryProperties testProperties;
@Bean
@@ -56,23 +62,107 @@ public abstract class IntegrationTestBase {
return jettyContainerFactory;
}
+ @Bean
+ public NiFiRegistryProperties getNiFiRegistryProperties() {
+ readLock.lock();
+ try {
+ if (testProperties == null) {
+ testProperties = loadNiFiRegistryProperties(propertiesFileLocation);
+ }
+ } finally {
+ readLock.unlock();
+ }
+ return testProperties;
+ }
+
}
+ @Autowired
+ private NiFiRegistryProperties properties;
+
+ /* OPTIONAL: Any subclass that extends this base class MAY provide or specify a @TestConfiguration that provides a
+ * NiFiRegistryClientConfig @Bean. The properties specified should correspond with the integration test cases in
+ * the concrete subclass. See SecureFileIT for an example. */
+ @Autowired(required = false)
+ private NiFiRegistryClientConfig clientConfig;
+
+ /* This will be injected with the random port assigned to the embedded Jetty container. */
@LocalServerPort
- int port;
+ private int port;
+
+ /**
+ * Subclasses can access this auto-configured JAX-RS client to communicate to the NiFi Registry Server
+ */
+ protected Client client;
+
+ @PostConstruct
+ void initialize() {
+ if (this.clientConfig != null) {
+ this.client = createClientFromConfig(this.clientConfig);
+ } else {
+ this.client = ClientBuilder.newClient();
+ }
+
+ }
- String createURL(String resourcePathRelativeToBaseUrl) {
- if (resourcePathRelativeToBaseUrl == null) {
+ /**
+ * Subclasses can utilize this method to build a URL that has the correct protocol, hostname, and port
+ * for a given path.
+ *
+ * @param relativeResourcePath the path component of the resource you wish to access, relative to the
+ * base API URL, where the base includes the servlet context path.
+ *
+ * @return a String containing the absolute URL of the resource.
+ */
+ String createURL(String relativeResourcePath) {
+ if (relativeResourcePath == null) {
throw new IllegalArgumentException("Resource path cannot be null");
}
- StringBuilder baseUri = new StringBuilder().append("http://localhost:").append(port).append(CONTEXT_PATH);
- if (!resourcePathRelativeToBaseUrl.startsWith("/")) {
- baseUri.append('/');
+ final boolean isSecure = this.properties.getSslPort() != null;
+ final String protocolSchema = isSecure ? "https" : "http";
+
+ final StringBuilder baseUriBuilder = new StringBuilder()
+ .append(protocolSchema).append("://localhost:").append(port).append(CONTEXT_PATH);
+
+ if (!relativeResourcePath.startsWith("/")) {
+ baseUriBuilder.append('/');
+ }
+ baseUriBuilder.append(relativeResourcePath);
+
+ return baseUriBuilder.toString();
+ }
+
+ /**
+ * A helper method for loading NiFiRegistryProperties by reading *.properties files from disk.
+ *
+ * @param propertiesFilePath The location of the properties file
+ * @return A NiFIRegistryProperties instance based on the properties file contents
+ */
+ static NiFiRegistryProperties loadNiFiRegistryProperties(String propertiesFilePath) {
+ NiFiRegistryProperties properties = new NiFiRegistryProperties();
+ try (final FileReader reader = new FileReader(propertiesFilePath)) {
+ properties.load(reader);
+ } catch (final IOException ioe) {
+ throw new RuntimeException("Unable to load properties: " + ioe, ioe);
+ }
+ return properties;
+ }
+
+ private static Client createClientFromConfig(NiFiRegistryClientConfig registryClientConfig) {
+
+ final SSLContext sslContext = registryClientConfig.getSslContext();
+ final HostnameVerifier hostnameVerifier = registryClientConfig.getHostnameVerifier();
+
+ final ClientBuilder clientBuilder = ClientBuilder.newBuilder();
+ if (sslContext != null) {
+ clientBuilder.sslContext(sslContext);
+ }
+ if (hostnameVerifier != null) {
+ clientBuilder.hostnameVerifier(hostnameVerifier);
}
- baseUri.append(resourcePathRelativeToBaseUrl);
- return baseUri.toString();
+ return clientBuilder.build();
}
}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/d441c95e/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/SecureFileIT.java
----------------------------------------------------------------------
diff --git a/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/SecureFileIT.java b/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/SecureFileIT.java
new file mode 100644
index 0000000..d04e79b
--- /dev/null
+++ b/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/SecureFileIT.java
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.registry.web.api;
+
+import org.apache.nifi.registry.NiFiRegistryApiTestApplication;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.skyscreamer.jsonassert.JSONAssert;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.context.annotation.Import;
+import org.springframework.test.context.jdbc.Sql;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import javax.ws.rs.core.Response;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Deploy the Web API Application using an embedded Jetty Server for local integration testing, with the follow characteristics:
+ *
+ * - A NiFiRegistryProperties has to be explicitly provided to the ApplicationContext using a profile unique to this test suite.
+ * - A NiFiRegistryClientConfig has been configured to create a client capable of completing two-way TLS
+ * - The database is embed H2 using volatile (in-memory) persistence
+ * - Custom SQL is clearing the DB before each test method by default, unless method overrides this behavior
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest(
+ classes = NiFiRegistryApiTestApplication.class,
+ webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
+ properties = "spring.profiles.include=ITSecureFile")
+@Import(SecureITClientConfiguration.class)
+@Sql(executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD, scripts = "classpath:db/clearDB.sql")
+public class SecureFileIT extends IntegrationTestBase {
+
+ @Test
+ public void testAccessStatus() throws Exception {
+
+ // Given: the client and server have been configured correctly for two-way TLS
+ String expectedJson = "{" +
+ "\"identity\":\"CN=user1, OU=nifi\"," +
+ "\"status\":\"ACTIVE\"" +
+ "}";
+
+ // When: the /access endpoint is queried
+ final Response response = client
+ .target(createURL("access"))
+ .request()
+ .get(Response.class);
+
+ // Then: the server returns 200 OK with the expected client identity
+ assertEquals(200, response.getStatus());
+ String actualJson = response.readEntity(String.class);
+ JSONAssert.assertEquals(expectedJson, actualJson, false);
+ }
+
+ @Test
+ public void testRetrieveResources() throws Exception {
+
+ // Given: an empty registry returns these resources
+ String expected = "[" +
+ "{\"identifier\":\"/policies\",\"name\":\"Access Policies\"}," +
+ "{\"identifier\":\"/tenants\",\"name\":\"Tenant\"}," +
+ "{\"identifier\":\"/proxy\",\"name\":\"Proxy User Requests\"}," +
+ "{\"identifier\":\"/resources\",\"name\":\"NiFi Resources\"}," +
+ "{\"identifier\":\"/buckets\",\"name\":\"Buckets\"}" +
+ "]";
+
+ // When: the /resources endpoint is queried
+ final String resourcesJson = client
+ .target(createURL("resources"))
+ .request()
+ .get(String.class);
+
+ // Then: the expected array of resources is returned
+ JSONAssert.assertEquals(expected, resourcesJson, false);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/d441c95e/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/SecureITClientConfiguration.java
----------------------------------------------------------------------
diff --git a/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/SecureITClientConfiguration.java b/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/SecureITClientConfiguration.java
new file mode 100644
index 0000000..ab07a08
--- /dev/null
+++ b/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/SecureITClientConfiguration.java
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.registry.web.api;
+
+import org.apache.nifi.registry.client.NiFiRegistryClientConfig;
+import org.apache.nifi.registry.properties.NiFiRegistryProperties;
+import org.apache.nifi.registry.security.util.KeystoreType;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+
+import static org.apache.nifi.registry.web.api.IntegrationTestBase.loadNiFiRegistryProperties;
+
+// Do not add Spring annotations that would cause this class to be picked up by a ComponentScan. It must be imported manually.
+public class SecureITClientConfiguration {
+
+ @Value("${nifi.registry.client.properties.file}")
+ String clientPropertiesFileLocation;
+
+ private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
+ private final Lock readLock = lock.readLock();
+ private NiFiRegistryClientConfig clientConfig;
+
+ @Bean
+ public NiFiRegistryClientConfig getNiFiRegistryClientConfig() {
+ readLock.lock();
+ try {
+ if (clientConfig == null) {
+ final NiFiRegistryProperties clientProperties = loadNiFiRegistryProperties(clientPropertiesFileLocation);
+ clientConfig = createNiFiRegistryClientConfig(clientProperties);
+ }
+ } finally {
+ readLock.unlock();
+ }
+ return clientConfig;
+ }
+
+ /**
+ * A helper method for loading a NiFiRegistryClientConfig corresponding to a NiFiRegistryProperties object
+ * holding the values needed to create a client configuration context.
+ *
+ * @param clientProperties A NiFiRegistryProperties object holding the config for client keystore, truststore, etc.
+ * @return A NiFiRegistryClientConfig instance based on the properties file contents
+ */
+ private static NiFiRegistryClientConfig createNiFiRegistryClientConfig(NiFiRegistryProperties clientProperties) {
+
+ NiFiRegistryClientConfig.Builder configBuilder = new NiFiRegistryClientConfig.Builder();
+
+ // load keystore/truststore if applicable
+ if (clientProperties.getKeyStorePath() != null) {
+ configBuilder.keystoreFilename(clientProperties.getKeyStorePath());
+ }
+ if (clientProperties.getKeyStoreType() != null) {
+ configBuilder.keystoreType(KeystoreType.valueOf(clientProperties.getKeyStoreType()));
+ }
+ if (clientProperties.getKeyStorePassword() != null) {
+ configBuilder.keystorePassword(clientProperties.getKeyStorePassword());
+ }
+ if (clientProperties.getKeyPassword() != null) {
+ configBuilder.keyPassword(clientProperties.getKeyPassword());
+ }
+ if (clientProperties.getTrustStorePath() != null) {
+ configBuilder.truststoreFilename(clientProperties.getTrustStorePath());
+ }
+ if (clientProperties.getTrustStoreType() != null) {
+ configBuilder.truststoreType(KeystoreType.valueOf(clientProperties.getTrustStoreType()));
+ }
+ if (clientProperties.getTrustStorePassword() != null) {
+ configBuilder.truststorePassword(clientProperties.getTrustStorePassword());
+ }
+
+ return configBuilder.build();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/d441c95e/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/UnsecuredITBase.java
----------------------------------------------------------------------
diff --git a/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/UnsecuredITBase.java b/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/UnsecuredITBase.java
new file mode 100644
index 0000000..e546511
--- /dev/null
+++ b/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/UnsecuredITBase.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.registry.web.api;
+
+import org.apache.nifi.registry.NiFiRegistryApiTestApplication;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.jdbc.Sql;
+import org.springframework.test.context.junit4.SpringRunner;
+
+/**
+ * Deploy the Web API Application using an embedded Jetty Server for local integration testing, with the follow characteristics:
+ *
+ * - A NiFiRegistryProperties has to be explicitly provided to the ApplicationContext using a profile unique to this test suite.
+ * - The database is embed H2 using volatile (in-memory) persistence
+ * - Custom SQL is clearing the DB before each test method by default, unless method overrides this behavior
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest(
+ classes = NiFiRegistryApiTestApplication.class,
+ webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
+ properties = "spring.profiles.include=ITUnsecured")
+@Sql(executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD, scripts = "classpath:db/clearDB.sql")
+public class UnsecuredITBase extends IntegrationTestBase {
+
+ // Tests cases defined in subclasses
+
+}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/d441c95e/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/UnsecuredIntegrationTestBase.java
----------------------------------------------------------------------
diff --git a/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/UnsecuredIntegrationTestBase.java b/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/UnsecuredIntegrationTestBase.java
deleted file mode 100644
index c868bf1..0000000
--- a/nifi-registry-web-api/src/test/java/org/apache/nifi/registry/web/api/UnsecuredIntegrationTestBase.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.nifi.registry.web.api;
-
-import org.apache.nifi.registry.properties.NiFiRegistryProperties;
-import org.springframework.boot.test.context.TestConfiguration;
-import org.springframework.context.annotation.Bean;
-
-import java.io.FileReader;
-import java.io.IOException;
-
-/**
- * Extends the base integration and provide a NiFiRegistryProperties Bean that configures the NiFi Registry to be unsecured
- */
-public class UnsecuredIntegrationTestBase extends IntegrationTestBase {
-
- @TestConfiguration
- public static class TestConfigurationClass {
-
- private NiFiRegistryProperties testProperties;
-
- @Bean
- public synchronized NiFiRegistryProperties getNiFiRegistryProperties() {
- if (testProperties == null) {
- testProperties = new NiFiRegistryProperties();
- try (final FileReader reader = new FileReader("src/test/resources/conf/unsecured/nifi-registry.properties")) {
- testProperties.load(reader);
- } catch (final IOException ioe) {
- throw new RuntimeException("Unable to load properties: " + ioe, ioe);
- }
- }
- return testProperties;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/d441c95e/nifi-registry-web-api/src/test/resources/application-ITSecureFile.properties
----------------------------------------------------------------------
diff --git a/nifi-registry-web-api/src/test/resources/application-ITSecureFile.properties b/nifi-registry-web-api/src/test/resources/application-ITSecureFile.properties
new file mode 100644
index 0000000..3ea5398
--- /dev/null
+++ b/nifi-registry-web-api/src/test/resources/application-ITSecureFile.properties
@@ -0,0 +1,36 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+
+# Properties for Spring Boot integration tests
+# Documentation for common Spring Boot application properties can be found at:
+# https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html
+
+
+# Custom (non-standard to Spring Boot) properties
+nifi.registry.properties.file: src/test/resources/conf/secure-file/nifi-registry.properties
+nifi.registry.client.properties.file: src/test/resources/conf/secure-file/nifi-registry-client.properties
+
+
+# Embedded Server SSL Context Config
+server.ssl.client-auth: need
+server.ssl.key-store: ./target/test-classes/keys/localhost-ks.jks
+server.ssl.key-store-password: localhostKeystorePassword
+server.ssl.key-password: localhostKeystorePassword
+server.ssl.protocol: TLS
+server.ssl.trust-store: ./target/test-classes/keys/localhost-ts.jks
+server.ssl.trust-store-password: localhostTruststorePassword
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/d441c95e/nifi-registry-web-api/src/test/resources/application-ITUnsecured.properties
----------------------------------------------------------------------
diff --git a/nifi-registry-web-api/src/test/resources/application-ITUnsecured.properties b/nifi-registry-web-api/src/test/resources/application-ITUnsecured.properties
new file mode 100644
index 0000000..bcd338c
--- /dev/null
+++ b/nifi-registry-web-api/src/test/resources/application-ITUnsecured.properties
@@ -0,0 +1,21 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# Integration Test Profile for running an unsecured NiFi Registry instance
+
+# Custom (non-standard to Spring Boot) properties
+nifi.registry.properties.file = src/test/resources/conf/unsecured/nifi-registry.properties
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/d441c95e/nifi-registry-web-api/src/test/resources/application.properties
----------------------------------------------------------------------
diff --git a/nifi-registry-web-api/src/test/resources/application.properties b/nifi-registry-web-api/src/test/resources/application.properties
index 29ef094..9cc9f51 100644
--- a/nifi-registry-web-api/src/test/resources/application.properties
+++ b/nifi-registry-web-api/src/test/resources/application.properties
@@ -16,6 +16,8 @@
#
# Properties for Spring Boot integration tests
+# Documentation for commoon Spring Boot application properties can be found at:
+# https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html
# These verbose log levels can be enabled locally for dev testing, but disable them in the repo to minimize travis logs.
#logging.level.org.springframework.core.io.support: DEBUG
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/d441c95e/nifi-registry-web-api/src/test/resources/conf/secure-file/authorizers.xml
----------------------------------------------------------------------
diff --git a/nifi-registry-web-api/src/test/resources/conf/secure-file/authorizers.xml b/nifi-registry-web-api/src/test/resources/conf/secure-file/authorizers.xml
new file mode 100644
index 0000000..70d75b1
--- /dev/null
+++ b/nifi-registry-web-api/src/test/resources/conf/secure-file/authorizers.xml
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<!--
+ This file lists the userGroupProviders, accessPolicyProviders, and authorizers to use when running securely. In order
+ to use a specific authorizer it must be configured here and its identifier must be specified in the nifi.properties file.
+ If the authorizer is a managedAuthorizer, it may need to be configured with an accessPolicyProvider and an userGroupProvider.
+ This file allows for configuration of them, but they must be configured in order:
+
+ ...
+ all userGroupProviders
+ all accessPolicyProviders
+ all Authorizers
+ ...
+-->
+<authorizers>
+
+ <!--
+ The FileUserGroupProvider will provide support for managing users and groups which is backed by a file
+ on the local file system.
+
+ - Users File - The file where the FileUserGroupProvider will store users and groups.
+
+ - Initial User Identity [unique key] - The identity of a users and systems to seed the Users File. The name of
+ each property must be unique, for example: "Initial User Identity A", "Initial User Identity B",
+ "Initial User Identity C" or "Initial User Identity 1", "Initial User Identity 2", "Initial User Identity 3"
+
+ NOTE: Any identity mapping rules specified in nifi.properties will also be applied to the user identities,
+ so the values should be the unmapped identities (i.e. full DN from a certificate).
+ -->
+ <userGroupProvider>
+ <identifier>file-user-group-provider</identifier>
+ <class>org.apache.nifi.registry.authorization.file.FileUserGroupProvider</class>
+ <property name="Users File">./target/test-classes/conf/secure-file/users.xml</property>
+ <property name="Initial User Identity 1">CN=user1, OU=nifi</property>
+ </userGroupProvider>
+
+ <!--
+ The CompositeUserGroupProvider will provide support for retrieving users and groups from multiple sources.
+
+ - User Group Provider [unique key] - The identifier of user group providers to load from. The name of
+ each property must be unique, for example: "User Group Provider A", "User Group Provider B",
+ "User Group Provider C" or "User Group Provider 1", "User Group Provider 2", "User Group Provider 3"
+
+ NOTE: Any identity mapping rules specified in nifi.properties are not applied in this implementation. This behavior
+ would need to be applied by the base implementation.
+ -->
+ <!-- To enable the composite-user-group-provider remove 2 lines. This is 1 of 2.
+ <userGroupProvider>
+ <identifier>composite-user-group-provider</identifier>
+ <class>org.apache.nifi.authorization.CompositeUserGroupProvider</class>
+ <property name="User Group Provider 1"></property>
+ </userGroupProvider>
+ To enable the composite-user-group-provider remove 2 lines. This is 2 of 2. -->
+
+ <!--
+ The CompositeConfigurableUserGroupProvider will provide support for retrieving users and groups from multiple sources.
+ Additionally, a single configurable user group provider is required. Users from the configurable user group provider
+ are configurable, however users loaded from one of the User Group Provider [unique key] will not be.
+
+ - Configurable User Group Provider - A configurable user group provider.
+
+ - User Group Provider [unique key] - The identifier of user group providers to load from. The name of
+ each property must be unique, for example: "User Group Provider A", "User Group Provider B",
+ "User Group Provider C" or "User Group Provider 1", "User Group Provider 2", "User Group Provider 3"
+
+ NOTE: Any identity mapping rules specified in nifi.properties are not applied in this implementation. This behavior
+ would need to be applied by the base implementation.
+ -->
+ <!-- To enable the composite-configurable-user-group-provider remove 2 lines. This is 1 of 2.
+ <userGroupProvider>
+ <identifier>composite-configurable-user-group-provider</identifier>
+ <class>org.apache.nifi.authorization.CompositeConfigurableUserGroupProvider</class>
+ <property name="Configurable User Group Provider">file-user-group-provider</property>
+ <property name="User Group Provider 1"></property>
+ </userGroupProvider>
+ To enable the composite-configurable-user-group-provider remove 2 lines. This is 2 of 2. -->
+
+ <!--
+ The FileAccessPolicyProvider will provide support for managing access policies which is backed by a file
+ on the local file system.
+
+ - User Group Provider - The identifier for an User Group Provider defined above that will be used to access
+ users and groups for use in the managed access policies.
+
+ - Authorizations File - The file where the FileAccessPolicyProvider will store policies.
+
+ - Initial Admin Identity - The identity of an initial admin user that will be granted access to the UI and
+ given the ability to create additional users, groups, and policies. The value of this property could be
+ a DN when using certificates or LDAP. This property will only be used when there
+ are no other policies defined.
+
+ NOTE: Any identity mapping rules specified in nifi.properties will also be applied to the initial admin identity,
+ so the value should be the unmapped identity. This identity must be found in the configured User Group Provider.
+
+ - Node Identity [unique key] - The identity of a NiFi cluster node. When clustered, a property for each node
+ should be defined, so that every node knows about every other node. If not clustered these properties can be ignored.
+ The name of each property must be unique, for example for a three node cluster:
+ "Node Identity A", "Node Identity B", "Node Identity C" or "Node Identity 1", "Node Identity 2", "Node Identity 3"
+
+ NOTE: Any identity mapping rules specified in nifi.properties will also be applied to the node identities,
+ so the values should be the unmapped identities (i.e. full DN from a certificate). This identity must be found
+ in the configured User Group Provider.
+ -->
+ <accessPolicyProvider>
+ <identifier>file-access-policy-provider</identifier>
+ <class>org.apache.nifi.registry.authorization.file.FileAccessPolicyProvider</class>
+ <property name="User Group Provider">file-user-group-provider</property>
+ <property name="Authorizations File">./target/test-classes/conf/secure-file/authorizations.xml</property>
+ <property name="Initial Admin Identity">CN=user1, OU=nifi</property>
+
+ <!--<property name="Node Identity 1"></property>-->
+ </accessPolicyProvider>
+
+ <!--
+ The StandardManagedAuthorizer. This authorizer implementation must be configured with the
+ Access Policy Provider which it will use to access and manage users, groups, and policies.
+ These users, groups, and policies will be used to make all access decisions during authorization
+ requests.
+
+ - Access Policy Provider - The identifier for an Access Policy Provider defined above.
+ -->
+ <authorizer>
+ <identifier>managed-authorizer</identifier>
+ <class>org.apache.nifi.registry.authorization.StandardManagedAuthorizer</class>
+ <property name="Access Policy Provider">file-access-policy-provider</property>
+ </authorizer>
+
+</authorizers>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/d441c95e/nifi-registry-web-api/src/test/resources/conf/secure-file/nifi-registry-client.properties
----------------------------------------------------------------------
diff --git a/nifi-registry-web-api/src/test/resources/conf/secure-file/nifi-registry-client.properties b/nifi-registry-web-api/src/test/resources/conf/secure-file/nifi-registry-client.properties
new file mode 100644
index 0000000..8eb6b56
--- /dev/null
+++ b/nifi-registry-web-api/src/test/resources/conf/secure-file/nifi-registry-client.properties
@@ -0,0 +1,25 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# client security properties #
+nifi.registry.security.keystore=./target/test-classes/keys/client-ks.jks
+nifi.registry.security.keystoreType=JKS
+nifi.registry.security.keystorePasswd=clientKeystorePassword
+nifi.registry.security.keyPasswd=u1Pass
+nifi.registry.security.truststore=./target/test-classes/keys/localhost-ts.jks
+nifi.registry.security.truststoreType=JKS
+nifi.registry.security.truststorePasswd=localhostTruststorePassword
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/d441c95e/nifi-registry-web-api/src/test/resources/conf/secure-file/nifi-registry.properties
----------------------------------------------------------------------
diff --git a/nifi-registry-web-api/src/test/resources/conf/secure-file/nifi-registry.properties b/nifi-registry-web-api/src/test/resources/conf/secure-file/nifi-registry.properties
new file mode 100644
index 0000000..65271c6
--- /dev/null
+++ b/nifi-registry-web-api/src/test/resources/conf/secure-file/nifi-registry.properties
@@ -0,0 +1,33 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# web properties #
+nifi.registry.web.https.host=localhost
+nifi.registry.web.https.port=0
+
+# security properties #
+#
+# ** Server KeyStore and TrustStore configuration set in Spring profile properties for embedded Jetty **
+#
+nifi.registry.security.authorizers.configuration.file=./target/test-classes/conf/secure-file/authorizers.xml
+nifi.registry.security.authorizer=managed-authorizer
+
+# providers properties #
+nifi.registry.providers.configuration.file=./target/test-classes/conf/providers.xml
+
+# database properties
+nifi.registry.db.url.append=;LOCK_TIMEOUT=25000;WRITE_DELAY=0;AUTO_SERVER=FALSE
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/d441c95e/nifi-registry-web-api/src/test/resources/keys/README.md
----------------------------------------------------------------------
diff --git a/nifi-registry-web-api/src/test/resources/keys/README.md b/nifi-registry-web-api/src/test/resources/keys/README.md
new file mode 100644
index 0000000..c49bc18
--- /dev/null
+++ b/nifi-registry-web-api/src/test/resources/keys/README.md
@@ -0,0 +1,46 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+# Integration Test Keys
+
+The integration tests that run a secure NiFi require keystores and truststores for the server and client in order
+to establish a two-way TLS connection.
+
+The keys/certs for these tests were generated with the tls-toolkit included with NiFi Toolkit v1.4.0.
+
+The steps for generating replacements are:
+
+ # use NiFi tls-toolkit to generate CA, server key/cert, client key/cert
+ ./nifi-toolkit-1.4.0/bin/tls-toolkit.sh standalone --certificateAuthorityHostname localhost --hostnames localhost --nifiDnSuffix ", OU=nifi" --keyStorePassword localhostKeystorePassword --trustStorePassword localhostTruststorePassword --clientCertDn "CN=user1, OU=nifi" --clientCertPassword u1Pass --days 3650 --outputDirectory nifireg-integrationtest
+
+ # change to tls-toolkit output directory
+ cd ./nifireg-integrationtest
+
+ # copy server's key/trust stores
+ mkdir keys
+ cp localhost/keystore.jks keys/localhost-ks.jks
+ cp localhost/truststore.jks keys/localhost-ts.jks
+
+ # create a Java Key Store (JKS) from the client key
+ keytool -importkeystore -destkeystore keys/client-ks.jks -deststorepass clientKeystorePassword -destkeypass u1Pass -srckeystore CN=user1_OU=nifi.p12 -srcstorepass u1Pass -srcstoretype PKCS12
+
+
+You should now have a directory with the following contents:
+ keys/
+ +-- client-ks.jks # client keystore: keystorePass=clientKeystorePassword, keyPass=u1Pass
+ +-- localhost-ks.jks # server keystore: keystorePass=localhostKeystorePassword, keyPass=localhostKeystorePassword
+ +-- localhost-ts.jks # server/client truststore (contains CA): truststorePass=localhostTruststorePassword
+
+Copy these files to the test/resources/keys/ directory.
+
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/d441c95e/nifi-registry-web-api/src/test/resources/keys/client-ks.jks
----------------------------------------------------------------------
diff --git a/nifi-registry-web-api/src/test/resources/keys/client-ks.jks b/nifi-registry-web-api/src/test/resources/keys/client-ks.jks
new file mode 100644
index 0000000..f2e0a1a
Binary files /dev/null and b/nifi-registry-web-api/src/test/resources/keys/client-ks.jks differ
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/d441c95e/nifi-registry-web-api/src/test/resources/keys/localhost-ks.jks
----------------------------------------------------------------------
diff --git a/nifi-registry-web-api/src/test/resources/keys/localhost-ks.jks b/nifi-registry-web-api/src/test/resources/keys/localhost-ks.jks
new file mode 100644
index 0000000..7421aaa
Binary files /dev/null and b/nifi-registry-web-api/src/test/resources/keys/localhost-ks.jks differ
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/d441c95e/nifi-registry-web-api/src/test/resources/keys/localhost-ts.jks
----------------------------------------------------------------------
diff --git a/nifi-registry-web-api/src/test/resources/keys/localhost-ts.jks b/nifi-registry-web-api/src/test/resources/keys/localhost-ts.jks
new file mode 100644
index 0000000..21eb2c0
Binary files /dev/null and b/nifi-registry-web-api/src/test/resources/keys/localhost-ts.jks differ