weaver 2005/01/21 08:45:20 Modified: portal/src/java/org/apache/jetspeed/security/impl AbstractSecurityValve.java SecurityValveImpl.java Log: Allow Excpetions to be thrown up throw the security valves Revision Changes Path 1.2 +14 -6 jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/security/impl/AbstractSecurityValve.java Index: AbstractSecurityValve.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/security/impl/AbstractSecurityValve.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- AbstractSecurityValve.java 30 Nov 2004 20:22:21 -0000 1.1 +++ AbstractSecurityValve.java 21 Jan 2005 16:45:19 -0000 1.2 @@ -40,7 +40,7 @@ * @param request * @return Subject */ - protected abstract Subject getSubject(RequestContext request); + protected abstract Subject getSubject(RequestContext request) throws Exception; /** * @@ -51,8 +51,9 @@ * the Subject returned from <code>getSubject()</code> * @param request * @return Principal + * @throws Exception */ - protected abstract Principal getUserPrincipal(RequestContext request); + protected abstract Principal getUserPrincipal(RequestContext request) throws Exception; /** * @@ -64,7 +65,7 @@ * @return javax.security.Subject or <code>null</code> if there is no servlet session attribute defined * for the key <code>org.apache.jetspeed.PortalReservedParameters.SESSION_KEY_SUBJECT</code>. */ - protected final Subject getSubjectFromSession(RequestContext request) + protected final Subject getSubjectFromSession(RequestContext request) throws Exception { return (Subject) request.getRequest().getSession().getAttribute(PortalReservedParameters.SESSION_KEY_SUBJECT); } @@ -89,8 +90,15 @@ public void invoke( RequestContext request, ValveContext context ) throws PipelineException { // initialize/validate security subject - Subject subject = getSubject(request); - + Subject subject; + try + { + subject = getSubject(request); + } + catch (Exception e1) + { + throw new PipelineException(e1.getMessage(), e1); + } request.getRequest().setAttribute(PortalReservedParameters.SESSION_KEY_SUBJECT, subject); // set request context subject request.setSubject(subject); 1.13 +3 -2 jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/security/impl/SecurityValveImpl.java Index: SecurityValveImpl.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/security/impl/SecurityValveImpl.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- SecurityValveImpl.java 30 Nov 2004 20:22:21 -0000 1.12 +++ SecurityValveImpl.java 21 Jan 2005 16:45:20 -0000 1.13 @@ -68,8 +68,9 @@ * not match * @param request * @return + * @throws Exception */ - protected final Subject getSubject(RequestContext request) + protected final Subject getSubject(RequestContext request) throws Exception { HttpSession session = request.getRequest().getSession(); Principal userPrincipal = getUserPrincipal(request);
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]