From d29b5d3a4ed5ad9865f3e086479f52587cf58a4d Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Wed, 13 May 2009 03:09:01 +0000 Subject: [PATCH] 275396 Added Authentication.Wrapped to allow JSAPI wrapping git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@210 7e9141cc-0065-0410-87d8-b60c137991c4 --- VERSION.txt | 1 + .../org/eclipse/jetty/security/SecurityHandler.java | 5 +++++ .../java/org/eclipse/jetty/server/Authentication.java | 11 +++++++++++ 3 files changed, 17 insertions(+) diff --git a/VERSION.txt b/VERSION.txt index dfd08003eef..745921fcab3 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -10,6 +10,7 @@ jetty-7.0.0.M2-SNAPSHOT + JETTY-1014 Enable start-stop-daemon by default on jetty.sh (START_STOP_DAEMON=1) + JETTY-1015 Reduce BayeuxClient and HttpClient lock contention + 275396 Added ScopedHandler to set servlet scope before security handler + + 275396 Added Authentication.Wrapped to allow JSAPI wrapping jetty-6.1.17 30 April 2009 + JETTY-936 Make optional dispatching to welcome files as servlets diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/SecurityHandler.java b/jetty-security/src/main/java/org/eclipse/jetty/security/SecurityHandler.java index b42d527aa36..97c7cca9e35 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/SecurityHandler.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/SecurityHandler.java @@ -415,6 +415,11 @@ public abstract class SecurityHandler extends HandlerWrapper implements Authenti if (authentication==null || authentication==Authentication.NOT_CHECKED) authentication=authenticator.validateRequest(request, response, isAuthMandatory); + if (authentication instanceof Authentication.Wrapped) + { + request=((Authentication.Wrapped)authentication).getHttpServletRequest(); + response=((Authentication.Wrapped)authentication).getHttpServletResponse(); + } if (authentication instanceof Authentication.ResponseSent) { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Authentication.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Authentication.java index 14b723bd569..cdef79f32bb 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Authentication.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Authentication.java @@ -15,6 +15,8 @@ package org.eclipse.jetty.server; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; /* ------------------------------------------------------------ */ @@ -41,6 +43,15 @@ public interface Authentication void logout(); } + /* ------------------------------------------------------------ */ + /** A wrapped authentication with methods provide the + * wrapped request/response for use by the application + */ + public interface Wrapped extends Authentication + { + HttpServletRequest getHttpServletRequest(); + HttpServletResponse getHttpServletResponse(); + } /* ------------------------------------------------------------ */ /** A deferred authentication with methods to progress