Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9FD796BFD for ; Wed, 3 Aug 2011 01:34:28 +0000 (UTC) Received: (qmail 75049 invoked by uid 500); 3 Aug 2011 01:34:27 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 74686 invoked by uid 500); 3 Aug 2011 01:34:26 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 74676 invoked by uid 99); 3 Aug 2011 01:34:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Aug 2011 01:34:26 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Aug 2011 01:34:24 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id B4D1A23888C2 for ; Wed, 3 Aug 2011 01:34:04 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1153318 - in /tomcat/tc6.0.x/trunk: java/org/apache/catalina/ha/session/DeltaRequest.java java/org/apache/catalina/ha/session/DeltaSession.java webapps/docs/changelog.xml Date: Wed, 03 Aug 2011 01:34:04 -0000 To: dev@tomcat.apache.org From: kfujino@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110803013404.B4D1A23888C2@eris.apache.org> Author: kfujino Date: Wed Aug 3 01:34:02 2011 New Revision: 1153318 URL: http://svn.apache.org/viewvc?rev=1153318&view=rev Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50771 Ensure HttpServletRequest#getAuthType() returns the name of the authentication scheme if request has already been authenticated. Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/session/DeltaRequest.java tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/session/DeltaSession.java tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/session/DeltaRequest.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/session/DeltaRequest.java?rev=1153318&r1=1153317&r2=1153318&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/session/DeltaRequest.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/session/DeltaRequest.java Wed Aug 3 01:34:02 2011 @@ -53,6 +53,7 @@ public class DeltaRequest implements Ext public static final int TYPE_PRINCIPAL = 1; public static final int TYPE_ISNEW = 2; public static final int TYPE_MAXINTERVAL = 3; + public static final int TYPE_AUTHTYPE = 4; public static final int ACTION_SET = 0; public static final int ACTION_REMOVE = 1; @@ -60,6 +61,7 @@ public class DeltaRequest implements Ext public static final String NAME_PRINCIPAL = "__SET__PRINCIPAL__"; public static final String NAME_MAXINTERVAL = "__SET__MAXINTERVAL__"; public static final String NAME_ISNEW = "__SET__ISNEW__"; + public static final String NAME_AUTHTYPE = "__SET__AUTHTYPE__"; private String sessionId; private LinkedList actions = new LinkedList(); @@ -118,6 +120,11 @@ public class DeltaRequest implements Ext addAction(TYPE_ISNEW,action,NAME_ISNEW,new Boolean(n)); } + public void setAuthType(String authType) { + int action = (authType==null)?ACTION_REMOVE:ACTION_SET; + addAction(TYPE_AUTHTYPE,action,NAME_AUTHTYPE, authType); + } + protected void addAction(int type, int action, String name, @@ -188,6 +195,14 @@ public class DeltaRequest implements Ext session.setPrincipal(p,false); break; }//case + case TYPE_AUTHTYPE: { + String authType = null; + if ( info.getAction() == ACTION_SET ) { + authType = (String)info.getValue(); + } + session.setAuthType(authType,false); + break; + }//case default : throw new java.lang.IllegalArgumentException("Invalid attribute info type="+info); }//switch }//for Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/session/DeltaSession.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/session/DeltaSession.java?rev=1153318&r1=1153317&r2=1153318&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/session/DeltaSession.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/session/DeltaSession.java Wed Aug 3 01:34:02 2011 @@ -335,6 +335,28 @@ public class DeltaSession extends Standa } /** + * Set the authentication type used to authenticate our cached + * Principal, if any. + * + * @param authType The new cached authentication type + */ + @Override + public void setAuthType(String authType) { + setAuthType(authType, true); + } + + public void setAuthType(String authType, boolean addDeltaRequest) { + try { + lock(); + super.setAuthType(authType); + if (addDeltaRequest && (deltaRequest != null)) + deltaRequest.setAuthType(authType); + } finally { + unlock(); + } + } + + /** * Return the isValid flag for this session. */ public boolean isValid() { Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=1153318&r1=1153317&r2=1153318&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Wed Aug 3 01:34:02 2011 @@ -262,6 +262,11 @@ (markt) + 50771: Ensure HttpServletRequest#getAuthType() returns the + name of the authentication scheme if request has already been + authenticated. (kfujino) + + 50950: Correct possible NotSerializableException for an authenticated session when running with a security manager. (markt) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org