NIFI-3361:

- Upgrading to the latest Jetty version.
This commit is contained in:
Matt Gilman 2017-03-15 13:06:26 -04:00
parent 552148e9e7
commit 8e61aa3c43
No known key found for this signature in database
GPG Key ID: DF61EC19432AEE37
4 changed files with 28 additions and 13 deletions

View File

@ -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("<html>\n" +
"<head>\n" +
"<meta http-equiv=\"Content-Type\" content=\"text/html;charset=ISO-8859-1\"/>\n" +
"<title>Error 401 </title>\n" +
"<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\"/>\n" +
"<title>Error 401 Unauthorized</title>\n" +
"</head>\n" +
"<body>\n" +
"<h2>HTTP ERROR: 401</h2>\n" +
"<body><h2>HTTP ERROR 401</h2>\n" +
"<p>Problem accessing /status/200. Reason:\n" +
"<pre> Unauthorized</pre></p>\n" +
"<hr /><a href=\"http://eclipse.org/jetty\">Powered by Jetty:// 9.3.9.v20160517</a><hr/>\n" +
"<pre> Unauthorized</pre></p><hr><a href=\"http://eclipse.org/jetty\">Powered by Jetty:// 9.4.2.v20170220</a><hr/>\n\n" +
"</body>\n" +
"</html>\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 {

View File

@ -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

View File

@ -29,7 +29,7 @@
<dependency>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>websocket-server</artifactId>
<version>9.3.13.v20161014</version>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>log4j</groupId>

View File

@ -92,7 +92,8 @@ language governing permissions and limitations under the License. -->
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<inceptionYear>2014</inceptionYear>
<org.slf4j.version>1.7.12</org.slf4j.version>
<jetty.version>9.3.9.v20160517</jetty.version>
<!--<jetty.version>9.3.9.v20160517</jetty.version>-->
<jetty.version>9.4.2.v20170220</jetty.version>
<lucene.version>4.10.4</lucene.version>
<spring.version>4.2.4.RELEASE</spring.version>
<spring.security.version>4.0.3.RELEASE</spring.security.version>