From 8a17563e6b188348adab945c3d07b58b40bdd007 Mon Sep 17 00:00:00 2001 From: Alex Bleasdale Date: Fri, 26 Jan 2018 17:05:08 +0000 Subject: [PATCH 1/2] Fixes #2160 - Digest authentication should use absolute path Modified uri value in Authorized header as per discussion in #2160. Signed-off-by: Alex Bleasdale Reviewed-by: Simone Bordet --- .../org/eclipse/jetty/client/util/DigestAuthentication.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/util/DigestAuthentication.java b/jetty-client/src/main/java/org/eclipse/jetty/client/util/DigestAuthentication.java index 5f89294304e..7a5e16bedcf 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/util/DigestAuthentication.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/util/DigestAuthentication.java @@ -211,7 +211,9 @@ public class DigestAuthentication extends AbstractAuthentication String A1 = user + ":" + realm + ":" + password; String hashA1 = toHexString(digester.digest(A1.getBytes(StandardCharsets.ISO_8859_1))); - URI uri = request.getURI(); + String query = request.getQuery(); + String path = request.getPath(); + String uri = (query == null) ? path : path + "?" + query; String A2 = request.getMethod() + ":" + uri; if ("auth-int".equals(qop)) A2 += ":" + toHexString(digester.digest(content)); From c07bab5e30a0b85a0ba7ca718b7740fb9883ec98 Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Tue, 30 Jan 2018 13:07:40 +0100 Subject: [PATCH 2/2] Update OSGi doc for spifly and fix errors. --- .../asciidoc/development/frameworks/osgi.adoc | 47 ++++++++++--------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/jetty-documentation/src/main/asciidoc/development/frameworks/osgi.adoc b/jetty-documentation/src/main/asciidoc/development/frameworks/osgi.adoc index e14645f9cc6..9466d4f2918 100644 --- a/jetty-documentation/src/main/asciidoc/development/frameworks/osgi.adoc +++ b/jetty-documentation/src/main/asciidoc/development/frameworks/osgi.adoc @@ -30,7 +30,7 @@ You will need to install some jetty jars into your OSGi container. You can always find the Jetty jars either in the Maven Central repository, or you can link:https://www.eclipse.org/jetty/download.html[download] a distribution of Jetty. Here's the absolute minimal set of Jetty jars: -.Bundle Name Mapping +.Minimal Bundles [cols=",",options="header",] |=================================================== |Jar |Bundle Symbolic Name @@ -43,12 +43,26 @@ Here's the absolute minimal set of Jetty jars: |jetty-webapp |org.eclipse.jetty.webapp |jetty-deploy |org.eclipse.jetty.deploy |jetty-xml |org.eclipse.jetty.xml -|jetty-osgi-servlet-api |org.eclipse.jetty.toolchain +|jetty-osgi-servlet-api |org.eclipse.jetty.osgi-servlet-api |=================================================== +You *should also install the Aries SpiFly bundles*, because many parts of jetty - for example ALPN, websocket, annotations - use the ServiceLoader mechanism, which requires an OSGi Service Loader Mediator like SpiFly: + +[[spifly]] +.SpiFly Bundles +[cols=",,",options="header",] +|======================================================================= +|Jar |Bundle Symbolic Name |Location +|org.apache.aries.spifly:org.apache.aries.spifly.dynamic.bundle-1.0.1.jar |org.apache.aries.spifly.dynamic.bundle +|http://central.maven.org/maven2/org/apache/aries/spifly/org.apache.aries.spifly.dynamic.bundle/[Maven central] +|org.apache.aries:org.apache.aries.util-1.0.1.jar |org.apache.aries.util +|http://central.maven.org/maven2/org/apache/aries/org.apache.aries.util/[Maven +central] +|======================================================================= + ____ [NOTE] -We recommend that you also deploy the link:#osgi-annotations[annotation-related] jars also, as the Servlet Specification increasingly relies on annotations for functionality. +We strongly recommend that you also deploy the link:#osgi-annotations[annotation-related] jars also, as the Servlet Specification increasingly relies on annotations for functionality. ____ You will also need the **OSGi Event Management service** and the **OSGi Configuration Management service**. @@ -650,6 +664,8 @@ In order to use JSPs with your webapps and bundles you will need to install the Some you will find in the Jetty distribution, whereas others you will need to download from http://central.maven.org/maven2/org/eclipse/jetty/orbit/[Maven central]. Here is the list of recommended jars (NOTE the version numbers may change in future): +[[osgi-jsp]] + .Jars Required for JSP [cols=",,",options="header",] |======================================================================= @@ -670,8 +686,7 @@ Here is the list of recommended jars (NOTE the version numbers may change in fut |org.eclipse.jetty.osgi:jetty-osgi-boot-jsp |org.eclipse.jetty.osgi.boot.jsp -|http://central.maven.org/maven2/org/eclipse/jetty/osgi/jetty-osgi-boot-jsp[Maven -central] +|http://central.maven.org/maven2/org/eclipse/jetty/osgi/jetty-osgi-boot-jsp[Maven central] |======================================================================= ____ @@ -688,14 +703,12 @@ For the JSTL library, we recommend the use of the implementation from Glassfish, .Jars Required for Glassfish JSTL [cols=",,",options="header",] |======================================================================= -|Jar |Bundle Symbolic Name |Location -|The jsp jars | | +|Jar |Bundle Symbolic Name +|The link:#osgi-jsp[jsp jars]| -|org.eclipse.jetty.orbit:javax.servlet.jsp.jstl-1.2.0.v201105211821.jar -|javax.servlet.jsp.jstl |Distribution lib/jsp +|org.eclipse.jetty.orbit:javax.servlet.jsp.jstl-1.2.0.v201105211821.jar| javax.servlet.jsp.jstl -|org.glassfish.web:javax.servlet.jsp.jstl-1.2.2.jar -|org.glassfish.web.javax.servlet.jsp.jstl |Distribution lib/jsp +|org.glassfish.web:javax.servlet.jsp.jstl-1.2.2.jar|org.glassfish.web.javax.servlet.jsp.jstl |======================================================================= However, if you wish, you may use the JSTL implementation from Apache instead, although you will need to source some dependency jars with suitable OSGi manifests: @@ -704,7 +717,7 @@ However, if you wish, you may use the JSTL implementation from Apache instead, a [cols=",,",options="header",] |======================================================================= |Jar |Bundle Symbolic Name |Location -|The jsp jars | | +|The link:#osgi-jsp[jsp jars] | | |org.apache.taglibs:taglibs-standard-spec:jar:1.2.1 |org.apache.taglibs.taglibs-standard-spec |Distribution lib/apache-jstl @@ -819,6 +832,7 @@ In order to use them with Jetty in OSGi, you will need to deploy some extra jars [cols=",,",options="header",] |======================================================================= |Jar |Bundle Symbolic Name |Location +|The link:#spifly[spifly jars] | | |org.ow2.asm:asm-5.0.1.jar |org.objectweb.asm |http://central.maven.org/maven2/org/ow2/asm/asm[Maven central] @@ -828,15 +842,6 @@ In order to use them with Jetty in OSGi, you will need to deploy some extra jars |org.ow2.asm:asm-tree-5.0.1.jar |org.objectweb.asm.tree |http://central.maven.org/maven2/org/ow2/asm/asm-tree[Maven central] -|org.apache.aries:org.apache.aries.util-1.0.1.jar |org.apache.aries.util -|http://central.maven.org/maven2/org/apache/aries/org.apache.aries.util/[Maven -central] - -|org.apache.aries.spifly:org.apache.aries.spifly.dynamic.bundle-1.0.1.jar -|org.apache.aries.spifly.dynamic.bundle -|http://central.maven.org/maven2/org/apache/aries/spifly/org.apache.aries.spifly.dynamic.bundle/[Maven -central] - |javax.annotation:javax.annotation-api-1.2.jar |javax.annotation-api |http://central.maven.org/maven2/javax/annotation/javax.annotation-api/[Maven central]