diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2017-04-02 13:56:32 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2017-04-02 15:45:00 +0200 |
commit | 6d5d3e45847d611ea57606e744b909406371d392 (patch) | |
tree | 61260d1a9e79e7a0a4afa54f94960a242f0e3bfd /org.eclipse.jgit.junit.http | |
parent | b65a764b6bc5d28f59084a3af98df04fdf6373ba (diff) | |
parent | 1b45b06116eee607152822d58103f5e4973d27b8 (diff) | |
download | jgit-6d5d3e45847d611ea57606e744b909406371d392.tar.gz jgit-6d5d3e45847d611ea57606e744b909406371d392.zip |
Merge branch 'stable-4.6'
* stable-4.6:
Update Jetty to 9.3.17.v20170317
Revert "Update Jetty to 9.4.1.v20170120 in buck build"
Revert "Update Jetty to 9.4.1.v20170120"
Change-Id: I9193b568cce9c72da899a8f3eaaf833956438e13
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.junit.http')
4 files changed, 32 insertions, 33 deletions
diff --git a/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF b/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF index 836ab8a2c8..188f62a1ee 100644 --- a/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF @@ -10,16 +10,16 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: javax.servlet;version="[2.5.0,3.2.0)", javax.servlet.http;version="[2.5.0,3.2.0)", org.apache.commons.logging;version="[1.1.1,2.0.0)", - org.eclipse.jetty.http;version="[9.3.0,10.0.0)", - org.eclipse.jetty.security;version="[9.3.0,10.0.0)", - org.eclipse.jetty.security.authentication;version="[9.3.0,10.0.0)", - org.eclipse.jetty.server;version="[9.3.0,10.0.0)", - org.eclipse.jetty.server.handler;version="[9.3.0,10.0.0)", - org.eclipse.jetty.server.nio;version="[9.3.0,10.0.0)", - org.eclipse.jetty.servlet;version="[9.3.0,10.0.0)", - org.eclipse.jetty.util.component;version="[9.3.0,10.0.0)", - org.eclipse.jetty.util.log;version="[9.3.0,10.0.0)", - org.eclipse.jetty.util.security;version="[9.3.0,10.0.0)", + org.eclipse.jetty.http;version="[9.0.0,9.4.0)", + org.eclipse.jetty.security;version="[9.0.0,9.4.0)", + org.eclipse.jetty.security.authentication;version="[9.0.0,9.4.0)", + org.eclipse.jetty.server;version="[9.0.0,9.4.0)", + org.eclipse.jetty.server.handler;version="[9.0.0,9.4.0)", + org.eclipse.jetty.server.nio;version="[9.0.0,9.4.0)", + org.eclipse.jetty.servlet;version="[9.0.0,9.4.0)", + org.eclipse.jetty.util.component;version="[9.0.0,9.4.0)", + org.eclipse.jetty.util.log;version="[9.0.0,9.4.0)", + org.eclipse.jetty.util.security;version="[9.0.0,9.4.0)", org.eclipse.jgit.errors;version="[4.7.0,4.8.0)", org.eclipse.jgit.http.server;version="[4.7.0,4.8.0)", org.eclipse.jgit.internal.storage.file;version="[4.7.0,4.8.0)", @@ -28,8 +28,7 @@ Import-Package: javax.servlet;version="[2.5.0,3.2.0)", org.eclipse.jgit.revwalk;version="[4.7.0,4.8.0)", org.eclipse.jgit.transport;version="[4.7.0,4.8.0)", org.eclipse.jgit.transport.resolver;version="[4.7.0,4.8.0)", - org.junit;version="[4.0.0,5.0.0)", - org.slf4j.helpers;version="[1.7.2,2.0.0)" + org.junit;version="[4.0.0,5.0.0)" Export-Package: org.eclipse.jgit.junit.http;version="4.7.0"; uses:="org.eclipse.jgit.transport, org.eclipse.jgit.junit, diff --git a/org.eclipse.jgit.junit.http/pom.xml b/org.eclipse.jgit.junit.http/pom.xml index abfe04380f..6a9464498b 100644 --- a/org.eclipse.jgit.junit.http/pom.xml +++ b/org.eclipse.jgit.junit.http/pom.xml @@ -93,11 +93,6 @@ <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-servlet</artifactId> </dependency> - - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-security</artifactId> - </dependency> </dependencies> <build> diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java index e9480fa9ff..a66348452c 100644 --- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java +++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java @@ -46,6 +46,7 @@ package org.eclipse.jgit.junit.http; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import java.io.IOException; import java.net.InetAddress; import java.net.URI; import java.net.URISyntaxException; @@ -53,21 +54,21 @@ import java.net.UnknownHostException; import java.util.ArrayList; import java.util.List; -import org.eclipse.jetty.security.AbstractLoginService; import org.eclipse.jetty.security.Authenticator; import org.eclipse.jetty.security.ConstraintMapping; import org.eclipse.jetty.security.ConstraintSecurityHandler; +import org.eclipse.jetty.security.MappedLoginService; import org.eclipse.jetty.security.authentication.BasicAuthenticator; import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.HttpConfiguration; import org.eclipse.jetty.server.HttpConnectionFactory; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; +import org.eclipse.jetty.server.UserIdentity; import org.eclipse.jetty.server.handler.ContextHandlerCollection; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.util.security.Constraint; -import org.eclipse.jetty.util.security.Credential; -import org.eclipse.jetty.util.security.Credential.Crypt; +import org.eclipse.jetty.util.security.Password; import org.eclipse.jgit.transport.URIish; /** @@ -167,29 +168,36 @@ public class AppServer { return ctx; } - static class TestLoginService extends AbstractLoginService { - + static class TestMappedLoginService extends MappedLoginService { private String role; - TestLoginService(String role) { + TestMappedLoginService(String role) { this.role = role; } + @Override - protected String[] loadRoleInfo(UserPrincipal user) { - return new String[] { role }; + protected UserIdentity loadUser(String who) { + return null; } @Override - protected UserPrincipal loadUserInfo(String name) { - return new UserPrincipal(username, - Credential.getCredential(Crypt.crypt(username, password))); + protected void loadUsers() throws IOException { + putUser(username, new Password(password), new String[] { role }); + } + + protected String[] loadRoleInfo(KnownUser user) { + return null; + } + + protected KnownUser loadUserInfo(String usrname) { + return null; } } private void auth(ServletContextHandler ctx, Authenticator authType) { final String role = "can-access"; - TestLoginService users = new TestLoginService(role); + MappedLoginService users = new TestMappedLoginService(role); ConstraintMapping cm = new ConstraintMapping(); cm.setConstraint(new Constraint()); cm.getConstraint().setAuthenticate(true); @@ -229,7 +237,6 @@ public class AppServer { public void tearDown() throws Exception { RecordingLogger.clear(); log.clear(); - server.setStopTimeout(0); server.stop(); } diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java index f28ef893bb..415398da26 100644 --- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java +++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java @@ -49,7 +49,6 @@ import java.util.Collections; import java.util.List; import org.eclipse.jetty.util.log.Logger; -import org.slf4j.helpers.MessageFormatter; /** Logs warnings into an array for later inspection. */ public class RecordingLogger implements Logger { @@ -162,8 +161,7 @@ public class RecordingLogger implements Logger { @Override public void warn(String msg, Object... args) { synchronized (warnings) { - warnings.add(new Warning( - MessageFormatter.format(msg, args).getMessage())); + warnings.add(new Warning(MessageFormat.format(msg, args))); } } |