From 8e61aa3c43dcf7fb32d7607278d8c85869600c2e Mon Sep 17 00:00:00 2001
From: Matt Gilman
Date: Wed, 15 Mar 2017 13:06:26 -0400
Subject: [PATCH] NIFI-3361: - Upgrading to the latest Jetty version.
---
.../standard/util/TestInvokeHttpCommon.java | 19 ++++++++-----------
.../resources/TestInvokeHttp/realm.properties | 17 +++++++++++++++++
.../nifi-websocket-services-jetty/pom.xml | 2 +-
pom.xml | 3 ++-
4 files changed, 28 insertions(+), 13 deletions(-)
create mode 100644 nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/resources/TestInvokeHttp/realm.properties
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/util/TestInvokeHttpCommon.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/util/TestInvokeHttpCommon.java
index 5d460fee43..a35dfd98b5 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/util/TestInvokeHttpCommon.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/util/TestInvokeHttpCommon.java
@@ -33,7 +33,6 @@ import org.eclipse.jetty.server.Authentication;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.handler.AbstractHandler;
-import org.eclipse.jetty.util.security.Password;
import org.junit.Assert;
import org.junit.Test;
@@ -705,14 +704,12 @@ public abstract class TestInvokeHttpCommon {
final String response = bundle.getAttribute(InvokeHTTP.RESPONSE_BODY);
assertEquals("\n" +
"\n" +
- "\n" +
- "Error 401 \n" +
+ "\n" +
+ "Error 401 Unauthorized\n" +
"\n" +
- "\n" +
- "HTTP ERROR: 401
\n" +
+ "HTTP ERROR 401
\n" +
"Problem accessing /status/200. Reason:\n" +
- "
Unauthorized
\n" +
- "
Powered by Jetty:// 9.3.9.v20160517
\n" +
+ " Unauthorized
Powered by Jetty:// 9.4.2.v20170220
\n\n" +
"\n" +
"\n", response);
}
@@ -1787,18 +1784,18 @@ public abstract class TestInvokeHttpCommon {
private DigestAuthenticator digestAuthenticator;
- private DigestAuthHandler() {
+ private DigestAuthHandler() throws Exception {
digestAuthenticator = new DigestAuthenticator();
ConstraintSecurityHandler securityHandler = new ConstraintSecurityHandler();
- HashLoginService hashLoginService = new HashLoginService("realm");
- hashLoginService.putUser("basic_user", new Password("basic_password"), new String[]{"realm"});
+ final HashLoginService hashLoginService = new HashLoginService("realm", "src/test/resources/TestInvokeHttp/realm.properties");
+ hashLoginService.start();
+
securityHandler.setLoginService(hashLoginService);
securityHandler.setIdentityService(new DefaultIdentityService());
digestAuthenticator.setConfiguration(securityHandler);
}
-
@Override
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse
response)throws IOException, ServletException {
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/resources/TestInvokeHttp/realm.properties b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/resources/TestInvokeHttp/realm.properties
new file mode 100644
index 0000000000..79ddc3b79c
--- /dev/null
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/resources/TestInvokeHttp/realm.properties
@@ -0,0 +1,17 @@
+# 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.
+
+# user: password -> MD5 of basic_user:realm:basic_password
+basic_user: MD5:e051f90f38b54dece2c113f5751dc417
\ No newline at end of file
diff --git a/nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-services-jetty/pom.xml b/nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-services-jetty/pom.xml
index 131d74e726..2db59d9505 100644
--- a/nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-services-jetty/pom.xml
+++ b/nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-services-jetty/pom.xml
@@ -29,7 +29,7 @@
org.eclipse.jetty.websocket
websocket-server
- 9.3.13.v20161014
+ ${jetty.version}
log4j
diff --git a/pom.xml b/pom.xml
index 3fe27dbd59..a436f86929 100644
--- a/pom.xml
+++ b/pom.xml
@@ -92,7 +92,8 @@ language governing permissions and limitations under the License. -->
UTF-8
2014
1.7.12
- 9.3.9.v20160517
+
+ 9.4.2.v20170220
4.10.4
4.2.4.RELEASE
4.0.3.RELEASE