2019-04-19 13:55:38 +00:00
|
|
|
--- a/apps/jetty/java/src/net/i2p/jetty/JettyXmlConfigurationParser.java
|
|
|
|
+++ b/apps/jetty/java/src/net/i2p/jetty/JettyXmlConfigurationParser.java
|
|
|
|
@@ -43,9 +43,9 @@
|
|
|
|
private static XmlParser initParser()
|
|
|
|
{
|
|
|
|
XmlParser parser = new XmlParser();
|
|
|
|
- URL config60 = Loader.getResource(XmlConfiguration.class, "org/eclipse/jetty/xml/configure_6_0.dtd");
|
|
|
|
- URL config76 = Loader.getResource(XmlConfiguration.class,"org/eclipse/jetty/xml/configure_7_6.dtd");
|
|
|
|
- URL config90 = Loader.getResource(XmlConfiguration.class,"org/eclipse/jetty/xml/configure_9_0.dtd");
|
|
|
|
+ URL config60 = Loader.getResource("org/eclipse/jetty/xml/configure_6_0.dtd");
|
|
|
|
+ URL config76 = Loader.getResource("org/eclipse/jetty/xml/configure_7_6.dtd");
|
|
|
|
+ URL config90 = Loader.getResource("org/eclipse/jetty/xml/configure_9_0.dtd");
|
|
|
|
parser.redirectEntity("configure.dtd",config90);
|
|
|
|
parser.redirectEntity("configure_1_0.dtd",config60);
|
|
|
|
parser.redirectEntity("configure_1_1.dtd",config60);
|
|
|
|
--- a/apps/jetty/java/src/net/i2p/servlet/I2PDefaultServlet.java
|
|
|
|
+++ b/apps/jetty/java/src/net/i2p/servlet/I2PDefaultServlet.java
|
|
|
|
@@ -132,7 +132,6 @@
|
|
|
|
*
|
|
|
|
* Get the resource list as a HTML directory listing.
|
|
|
|
*/
|
|
|
|
- @Override
|
|
|
|
protected void sendDirectory(HttpServletRequest request,
|
|
|
|
HttpServletResponse response,
|
|
|
|
Resource resource,
|
|
|
|
--- a/apps/routerconsole/java/src/net/i2p/router/web/RouterConsoleRunner.java
|
|
|
|
+++ b/apps/routerconsole/java/src/net/i2p/router/web/RouterConsoleRunner.java
|
2020-05-27 17:19:16 +00:00
|
|
|
@@ -49,6 +50,7 @@
|
2019-04-19 13:55:38 +00:00
|
|
|
import org.eclipse.jetty.security.HashLoginService;
|
|
|
|
import org.eclipse.jetty.security.ConstraintMapping;
|
|
|
|
import org.eclipse.jetty.security.ConstraintSecurityHandler;
|
|
|
|
+import org.eclipse.jetty.security.UserStore;
|
|
|
|
import org.eclipse.jetty.security.authentication.DigestAuthenticator;
|
|
|
|
import org.eclipse.jetty.server.AbstractConnector;
|
|
|
|
import org.eclipse.jetty.server.ConnectionFactory;
|
2020-05-27 17:19:16 +00:00
|
|
|
@@ -972,6 +974,8 @@
|
2019-04-19 13:55:38 +00:00
|
|
|
} else {
|
|
|
|
HashLoginService realm = new CustomHashLoginService(JETTY_REALM, context.getContextPath(),
|
|
|
|
ctx.logManager().getLog(RouterConsoleRunner.class));
|
|
|
|
+ UserStore userStore = new UserStore();
|
|
|
|
+ realm.setUserStore(userStore);
|
|
|
|
sec.setLoginService(realm);
|
|
|
|
sec.setAuthenticator(authenticator);
|
|
|
|
String[] role = new String[] {JETTY_ROLE};
|
2020-05-27 17:19:16 +00:00
|
|
|
@@ -979,7 +983,7 @@
|
2019-04-19 13:55:38 +00:00
|
|
|
String user = e.getKey();
|
|
|
|
String pw = e.getValue();
|
|
|
|
Credential cred = Credential.getCredential(MD5_CREDENTIAL_TYPE + pw);
|
|
|
|
- realm.putUser(user, cred, role);
|
|
|
|
+ userStore.addUser(user, cred, role);
|
|
|
|
Constraint constraint = new Constraint(user, JETTY_ROLE);
|
|
|
|
constraint.setAuthenticate(true);
|
|
|
|
ConstraintMapping cm = new ConstraintMapping();
|
2020-05-27 17:19:16 +00:00
|
|
|
@@ -999,7 +1003,7 @@
|
2019-04-19 13:55:38 +00:00
|
|
|
try {
|
|
|
|
// each char truncated to 8 bytes
|
|
|
|
String user2 = new String(b2, "ISO-8859-1");
|
|
|
|
- realm.putUser(user2, cred, role);
|
|
|
|
+ userStore.addUser(user2, cred, role);
|
|
|
|
constraint = new Constraint(user2, JETTY_ROLE);
|
|
|
|
constraint.setAuthenticate(true);
|
|
|
|
cm = new ConstraintMapping();
|
2020-05-27 17:19:16 +00:00
|
|
|
@@ -1010,7 +1014,7 @@
|
2019-04-19 13:55:38 +00:00
|
|
|
// each UTF-8 byte as a char
|
|
|
|
// this is what chrome does
|
|
|
|
String user3 = new String(b1, "ISO-8859-1");
|
|
|
|
- realm.putUser(user3, cred, role);
|
|
|
|
+ userStore.addUser(user3, cred, role);
|
|
|
|
constraint = new Constraint(user3, JETTY_ROLE);
|
|
|
|
constraint.setAuthenticate(true);
|
|
|
|
cm = new ConstraintMapping();
|
|
|
|
--- a/apps/routerconsole/java/src/net/i2p/router/web/LocaleWebAppHandler.java
|
|
|
|
+++ b/apps/routerconsole/java/src/net/i2p/router/web/LocaleWebAppHandler.java
|
|
|
|
@@ -85,9 +85,9 @@
|
|
|
|
String testPath = pathInContext.substring(0, len - 4) + '_' + lang + ".jsp";
|
|
|
|
// Do we have a servlet for the new path that isn't the catchall *.jsp?
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
|
|
- Map.Entry servlet = _wac.getServletHandler().getHolderEntry(testPath);
|
|
|
|
+ org.eclipse.jetty.http.pathmap.MappedResource servlet = _wac.getServletHandler().getMappedServlet(testPath);
|
|
|
|
if (servlet != null) {
|
|
|
|
- String servletPath = (String) servlet.getKey();
|
|
|
|
+ String servletPath = servlet.getPathSpec().getDeclaration();
|
|
|
|
if (servletPath != null && !servletPath.startsWith("*")) {
|
|
|
|
// success!!
|
|
|
|
//System.err.println("Servlet is: " + servletPath);
|