Skip to content

Commit

Permalink
this branch generates a jar which uses jetty 9.4.48.v20220622 by defa…
Browse files Browse the repository at this point in the history
…ult instead of 9.3.30
  • Loading branch information
eyedeekay committed Mar 31, 2023
1 parent 0d4eec7 commit 7c948ad
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion apps/jetty/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<property name="jetty.branch" value="stable-9" />
<property name="jetty.base" value="jetty-distribution-${jetty.ver}" />
<property name="jetty.sha1" value="e9f176730aea36a69c24eeba77dd0880a30492dc" />
<property name="jetty.sha1" value="30d18c360af4637cf1fa4b1c9a1e26b64fbe9253" />
<property name="jetty.filename" value="${jetty.base}.zip" />
<property name="jetty.url" value="https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-distribution/${jetty.ver}/${jetty.filename}" />
<property name="verified.filename" value="verified.txt" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public class JettyXmlConfigurationParser
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);
Expand Down
1 change: 0 additions & 1 deletion apps/jetty/java/src/net/i2p/servlet/I2PDefaultServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ private boolean getInitBoolean(String name, boolean dft)
*
* Get the resource list as a HTML directory listing.
*/
@Override
protected void sendDirectory(HttpServletRequest request,
HttpServletResponse response,
Resource resource,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ public void handle(String pathInContext,
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
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;
Expand Down Expand Up @@ -987,14 +988,16 @@ static void initialize(RouterContext ctx, WebAppContext context) {
} 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};
for (Map.Entry<String, String> e : userpw.entrySet()) {
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();
Expand All @@ -1014,7 +1017,7 @@ static void initialize(RouterContext ctx, WebAppContext context) {
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();
Expand All @@ -1025,7 +1028,7 @@ static void initialize(RouterContext ctx, WebAppContext context) {
// 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();
Expand Down
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
and checksum in apps/jetty/build.xml
and versions in gradle.properties and apps/jetty/build.gradle
-->
<property name="jetty.ver" value="9.3.30.v20211001" />
<property name="jetty.ver" value="9.4.48.v20220622" />
<property name="tomcat.ver" value="9.0.62" />

<!-- You probably don't want to change anything from here down -->
Expand Down

0 comments on commit 7c948ad

Please sign in to comment.