Created
July 11, 2016 12:34
-
-
Save jerboaa/d8f6b00e21f175b7518a8400cad57567 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/pom.xml b/pom.xml | |
--- a/pom.xml | |
+++ b/pom.xml | |
@@ -273,7 +273,7 @@ | |
<httpcomponents.core.version>4.3.2</httpcomponents.core.version> | |
<httpcomponents.client.version>4.3.4</httpcomponents.client.version> | |
<gson.version>2.2.2</gson.version> | |
- <jetty.version>9.1.0.v20131115</jetty.version> | |
+ <jetty.version>9.4.0.M0</jetty.version> | |
<jetty-schemas.version>3.1.M0</jetty-schemas.version> | |
<!-- web-endpoint-plugin requires the javax.servlet bundle to be started. | |
Jetty 9 drags in version 3.1.0. That is, if you change the jetty | |
diff --git a/web/server/src/test/java/com/redhat/thermostat/web/server/WebStorageEndpointTest.java b/web/server/src/test/java/com/redhat/thermostat/web/server/WebStorageEndpointTest.java | |
--- a/web/server/src/test/java/com/redhat/thermostat/web/server/WebStorageEndpointTest.java | |
+++ b/web/server/src/test/java/com/redhat/thermostat/web/server/WebStorageEndpointTest.java | |
@@ -85,11 +85,9 @@ | |
import org.apache.commons.codec.binary.Base64; | |
import org.eclipse.jetty.jaas.JAASLoginService; | |
-import org.eclipse.jetty.security.DefaultUserIdentity; | |
+import org.eclipse.jetty.security.HashLoginService; | |
import org.eclipse.jetty.security.LoginService; | |
-import org.eclipse.jetty.security.MappedLoginService; | |
import org.eclipse.jetty.server.Server; | |
-import org.eclipse.jetty.server.UserIdentity; | |
import org.eclipse.jetty.util.component.LifeCycle; | |
import org.eclipse.jetty.util.component.LifeCycle.Listener; | |
import org.eclipse.jetty.util.security.Password; | |
@@ -1728,7 +1726,7 @@ | |
} | |
} | |
- private static class TestLoginService extends MappedLoginService { | |
+ private static class TestLoginService extends HashLoginService { | |
private final String[] roleNames; | |
private final String username; | |
@@ -1742,15 +1740,16 @@ | |
} | |
@Override | |
- protected void loadUsers() throws IOException { | |
- putUser(username, new Password(password), | |
- roleNames); | |
+ protected String[] loadRoleInfo(UserPrincipal p) { | |
+ if (username.equals(p.getName())) { | |
+ return roleNames; | |
+ } | |
+ return super.loadRoleInfo(p); | |
} | |
@Override | |
- protected UserIdentity loadUser(String username) { | |
- return new DefaultUserIdentity(null, null, | |
- roleNames); | |
+ protected UserPrincipal loadUserInfo(String username) { | |
+ return new UserPrincipal(username, new Password(password)); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment