summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.junit.http/src
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2017-03-31 14:49:30 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2017-03-31 14:50:20 +0900
commitda6fa14fd180ddeb6c678118ffaae0211bbe9a57 (patch)
tree4c8e1e5ec42cfeb8a3ad6b9ef3c0368e897b02a4 /org.eclipse.jgit.junit.http/src
parent7f013924a8ec8fac49e8c0b4d30e28bc0c3f10e4 (diff)
downloadjgit-da6fa14fd180ddeb6c678118ffaae0211bbe9a57.tar.gz
jgit-da6fa14fd180ddeb6c678118ffaae0211bbe9a57.zip
Revert "Update Jetty to 9.4.1.v20170120"
This reverts commit e05caf91f1df86a95d3e0454000d345bb90a415e. Change-Id: Ia4287f130034a790759b5035505a093b4616a05a
Diffstat (limited to 'org.eclipse.jgit.junit.http/src')
-rw-r--r--org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java32
-rw-r--r--org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java4
2 files changed, 20 insertions, 16 deletions
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 09754317ed..44c1977171 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,30 +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);
@@ -230,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 c7545a94b4..7600843d23 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 {
@@ -155,8 +154,7 @@ public class RecordingLogger implements Logger {
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)));
}
}