Skip to content
Browse files

Merge pull request #1 from sonatype/NEXUS-4852-update-to-jetty7

NEXUS-4852: update testsuite to Eclipse/Jetty 7.6
  • Loading branch information...
2 parents 319aed7 + 2c6fb1c commit 4272b2c9d19d6ba324a83da97ce8af9bed889b34 @mcculls mcculls committed
View
2 harness-runner/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>hth-parent</artifactId>
<groupId>org.sonatype.http-testing-harness</groupId>
- <version>0.4.4-SNAPSHOT</version>
+ <version>0.5.0-SNAPSHOT</version>
</parent>
<artifactId>harness-runner</artifactId>
View
2 hth-api/pom.xml
@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.sonatype.http-testing-harness</groupId>
- <version>0.4.4-SNAPSHOT</version>
+ <version>0.5.0-SNAPSHOT</version>
<artifactId>hth-parent</artifactId>
</parent>
<artifactId>hth-api</artifactId>
View
2 junit-runner/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>hth-parent</artifactId>
<groupId>org.sonatype.http-testing-harness</groupId>
- <version>0.4.4-SNAPSHOT</version>
+ <version>0.5.0-SNAPSHOT</version>
</parent>
<artifactId>junit-runner</artifactId>
View
2 pom.xml
@@ -9,7 +9,7 @@
</parent>
<groupId>org.sonatype.http-testing-harness</groupId>
- <version>0.4.4-SNAPSHOT</version>
+ <version>0.5.0-SNAPSHOT</version>
<artifactId>hth-parent</artifactId>
<packaging>pom</packaging>
View
9 server-provider/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>org.sonatype.http-testing-harness</groupId>
- <version>0.4.4-SNAPSHOT</version>
+ <version>0.5.0-SNAPSHOT</version>
<artifactId>hth-parent</artifactId>
</parent>
@@ -11,6 +11,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <jetty.version>7.6.0.v20120127</jetty.version>
</properties>
<name>Jetty Server Provider</name>
@@ -31,17 +32,17 @@
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
- <version>7.0.0.v20091005</version>
+ <version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-security</artifactId>
- <version>7.0.0.v20091005</version>
+ <version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
- <version>7.0.0.v20091005</version>
+ <version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
View
2 server-provider/src/main/java/org/sonatype/tests/http/server/jetty/behaviour/BasicAuth.java
@@ -19,7 +19,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.eclipse.jetty.http.security.B64Code;
+import org.eclipse.jetty.util.B64Code;
import org.sonatype.tests.http.server.api.Behaviour;
/**
View
2 server-provider/src/main/java/org/sonatype/tests/http/server/jetty/behaviour/NTLMAuth.java
@@ -27,7 +27,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.eclipse.jetty.http.security.B64Code;
+import org.eclipse.jetty.util.B64Code;
import org.eclipse.jetty.util.log.Log;
import org.sonatype.tests.http.server.api.Behaviour;
View
2 server-provider/src/main/java/org/sonatype/tests/http/server/jetty/behaviour/ProxyAuth.java
@@ -19,7 +19,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.eclipse.jetty.http.security.B64Code;
+import org.eclipse.jetty.util.B64Code;
import org.eclipse.jetty.util.log.Log;
import org.sonatype.tests.http.server.api.Behaviour;
View
2 ...n/java/org/sonatype/tests/http/server/jetty/configurations/CertAuthSuiteConfigurator.java
@@ -13,7 +13,7 @@
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
*/
-import org.eclipse.jetty.http.security.Constraint;
+import org.eclipse.jetty.util.security.Constraint;
import org.sonatype.tests.http.server.api.ServerProvider;
/**
View
8 ...der/src/main/java/org/sonatype/tests/http/server/jetty/impl/FixedDigestAuthenticator.java
@@ -8,9 +8,6 @@
import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.http.HttpHeaders;
-import org.eclipse.jetty.http.security.B64Code;
-import org.eclipse.jetty.http.security.Constraint;
-import org.eclipse.jetty.http.security.Credential;
import org.eclipse.jetty.security.ServerAuthException;
import org.eclipse.jetty.security.UserAuthentication;
import org.eclipse.jetty.security.authentication.LoginAuthenticator;
@@ -18,10 +15,13 @@
import org.eclipse.jetty.server.Authentication.User;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.UserIdentity;
+import org.eclipse.jetty.util.B64Code;
import org.eclipse.jetty.util.QuotedStringTokenizer;
import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.TypeUtil;
import org.eclipse.jetty.util.log.Log;
+import org.eclipse.jetty.util.security.Constraint;
+import org.eclipse.jetty.util.security.Credential;
/**
* @version $Rev: 4793 $ $Date: 2009-03-19 00:00:01 +0100 (Thu, 19 Mar 2009) $
@@ -141,7 +141,7 @@ else if ( "response".equalsIgnoreCase( name ) )
UserIdentity user = _loginService.login( digest.username, digest );
if ( user != null )
{
- return new UserAuthentication( this, user );
+ return new UserAuthentication( getAuthMethod(), user );
}
}
else if ( n == 0 )
View
147 ...ider/src/main/java/org/sonatype/tests/http/server/jetty/impl/FixedSslSocketConnector.java
@@ -1,147 +0,0 @@
-package org.sonatype.tests.http.server.jetty.impl;
-
-/*
- * Copyright (c) 2010-2011 Sonatype, Inc. All rights reserved.
- *
- * This program is licensed to you under the Apache License Version 2.0,
- * and you may not use this file except in compliance with the Apache License Version 2.0.
- * You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the Apache License Version 2.0 is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
- */
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.security.KeyStore;
-import java.security.SecureRandom;
-
-import javax.net.ssl.KeyManager;
-import javax.net.ssl.KeyManagerFactory;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLServerSocketFactory;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.TrustManagerFactory;
-
-import org.eclipse.jetty.server.ssl.SslSocketConnector;
-import org.eclipse.jetty.util.resource.Resource;
-
-
-/**
- * A SSL connector that doesn't leak file handles when loading the key stores (cf. JETTY-1292).
- */
-class FixedSslSocketConnector
- extends SslSocketConnector
-{
- private transient String _password;
-
- private transient String _keyPassword;
-
- private transient String _trustPassword;
-
- @Override
- public void setPassword( String password )
- {
- _password = password;
- super.setPassword( password );
- }
-
- @Override
- public void setTrustPassword( String password )
- {
- _trustPassword = password;
- super.setTrustPassword( password );
- }
-
- @Override
- public void setKeyPassword( String password )
- {
- _keyPassword = password;
- super.setKeyPassword( password );
- }
-
- @Override
- protected SSLServerSocketFactory createFactory()
- throws Exception
- {
-
- return getSslContext().getServerSocketFactory();
- }
-
- @Override
- protected SSLContext createSSLContext()
- throws Exception
- {
- String _protocol = getProtocol();
- String _provider = getProvider();
- String _secureRandomAlgorithm = getSecureRandomAlgorithm();
- String _sslKeyManagerFactoryAlgorithm = getSslKeyManagerFactoryAlgorithm();
- String _sslTrustManagerFactoryAlgorithm = getSslTrustManagerFactoryAlgorithm();
-
- String _keystore = getKeystore();
- String _keystoreType = getKeystoreType();
- String _truststore = getTruststore();
- String _truststoreType = getTruststoreType();
-
- if ( _truststore == null )
- {
- _truststore = _keystore;
- _truststoreType = _keystoreType;
- }
-
- KeyManager[] keyManagers = null;
- InputStream keystoreInputStream = null;
- if ( _keystore != null )
- {
- keystoreInputStream = Resource.newResource( _keystore ).getInputStream();
- }
- KeyStore keyStore = KeyStore.getInstance( _keystoreType );
- keyStore.load( keystoreInputStream, _password == null ? null : _password.toString().toCharArray() );
- close( keystoreInputStream );
-
- KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance( _sslKeyManagerFactoryAlgorithm );
- keyManagerFactory.init( keyStore, _keyPassword == null ? null : _keyPassword.toString().toCharArray() );
- keyManagers = keyManagerFactory.getKeyManagers();
-
- TrustManager[] trustManagers = null;
- InputStream truststoreInputStream = null;
- if ( _truststore != null )
- {
- truststoreInputStream = Resource.newResource( _truststore ).getInputStream();
- }
- KeyStore trustStore = KeyStore.getInstance( _truststoreType );
- trustStore.load( truststoreInputStream, _trustPassword == null ? null : _trustPassword.toString().toCharArray() );
- close( truststoreInputStream );
-
- TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance( _sslTrustManagerFactoryAlgorithm );
- trustManagerFactory.init( trustStore );
- trustManagers = trustManagerFactory.getTrustManagers();
-
- SecureRandom secureRandom =
- _secureRandomAlgorithm == null ? null : SecureRandom.getInstance( _secureRandomAlgorithm );
-
- SSLContext context =
- _provider == null ? SSLContext.getInstance( _protocol ) : SSLContext.getInstance( _protocol, _provider );
-
- context.init( keyManagers, trustManagers, secureRandom );
- setSslContext( context );
- return context;
- }
-
- private void close( InputStream is )
- {
- if ( is != null )
- {
- try
- {
- is.close();
- }
- catch ( IOException e )
- {
- // we tried
- }
- }
- }
-}
View
9 ...provider/src/main/java/org/sonatype/tests/http/server/jetty/impl/JettyServerProvider.java
@@ -27,15 +27,13 @@
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
+
import javax.net.ssl.KeyManager;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
-import org.eclipse.jetty.http.security.B64Code;
-import org.eclipse.jetty.http.security.Constraint;
-import org.eclipse.jetty.http.security.Password;
import org.eclipse.jetty.security.ConstraintMapping;
import org.eclipse.jetty.security.ConstraintSecurityHandler;
import org.eclipse.jetty.security.HashLoginService;
@@ -49,6 +47,9 @@
import org.eclipse.jetty.server.ssl.SslSocketConnector;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
+import org.eclipse.jetty.util.B64Code;
+import org.eclipse.jetty.util.security.Constraint;
+import org.eclipse.jetty.util.security.Password;
import org.sonatype.tests.http.server.api.Behaviour;
import org.sonatype.tests.http.server.api.ServerProvider;
import org.sonatype.tests.http.server.api.TestServlet;
@@ -424,7 +425,7 @@ protected Connector connector()
protected Connector sslConnector()
{
- SslSocketConnector connector = new FixedSslSocketConnector();
+ SslSocketConnector connector = new SslSocketConnector();
String keystore;
try
{
View
2 ...er-provider/src/main/java/org/sonatype/tests/http/server/jetty/impl/ProxyTestServlet.java
@@ -21,7 +21,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.eclipse.jetty.http.security.B64Code;
+import org.eclipse.jetty.util.B64Code;
import org.eclipse.jetty.util.log.Log;
import org.sonatype.tests.http.server.api.TestServlet;
View
2 testng-runner/pom.xml
@@ -3,7 +3,7 @@
<parent>
<artifactId>hth-parent</artifactId>
<groupId>org.sonatype.http-testing-harness</groupId>
- <version>0.4.4-SNAPSHOT</version>
+ <version>0.5.0-SNAPSHOT</version>
</parent>
<artifactId>testng-runner</artifactId>

0 comments on commit 4272b2c

Please sign in to comment.
Something went wrong with that request. Please try again.