geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r366121 - /geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
Date Thu, 05 Jan 2006 08:28:54 GMT
Author: djencks
Date: Thu Jan  5 00:28:53 2006
New Revision: 366121

URL: http://svn.apache.org/viewcvs?rev=366121&view=rev
Log:
GERONIMO-1012 finally completed.  jgenender pointed out how to add the DefaultSubjectValve
after the default valves tomcat adds, so default subject is set only when there is no authenticated
subject.

Modified:
    geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java

Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java?rev=366121&r1=366120&r2=366121&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
(original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
Thu Jan  5 00:28:53 2006
@@ -134,20 +134,6 @@
 
                 PolicyContextValve policyValve = new PolicyContextValve(securityHolder.getPolicyContextID());
                 addValve(policyValve);
-
-                //This is definitely a hack, but I don't see a reasonable way to install
the defaultSubject.
-                //Obviously this won't work if there are permissions.  Setting the default
subject if there are
-                //permissions breaks authentication.
-                boolean hasPermissions = securityHolder.getChecked().elements().hasMoreElements()
||
-                        securityHolder.getExcluded().elements().hasMoreElements();
-                Valve defaultSubjectValve;
-                if (!hasPermissions && defaultSubject != null) {
-                    defaultSubjectValve = new DefaultSubjectValve(defaultSubject);
-                } else {
-                    //this will clear the thread of any read subject added by some other
web app
-                    defaultSubjectValve = new DefaultSubjectValve(null);
-                }
-                addValve(defaultSubjectValve);
             }
         }
 
@@ -184,7 +170,11 @@
         if (pipelineInitialized) {
             try {
                 Valve valve = getFirst();
-                    valve.invoke(null, null);
+                valve.invoke(null, null);
+                //Install the DefaultSubjectValve after the authentication valve so the default
subject is supplied
+                //only if no real subject is authenticated.
+                Valve defaultSubjectValve = new DefaultSubjectValve(defaultSubject);
+                addValve(defaultSubjectValve);
             } catch (IOException e) {
                 if (e.getCause() instanceof LifecycleException) {
                     throw (LifecycleException) e.getCause();
@@ -217,8 +207,8 @@
 
         ClassLoader cl = this.getParentClassLoader();
 
-        Class baseServletClass = null;
-        Class servletClass = null;
+        Class baseServletClass;
+        Class servletClass;
         try {
             baseServletClass = cl.loadClass(Servlet.class.getName());
             servletClass = cl.loadClass(servletClassName);
@@ -229,7 +219,7 @@
                     StoredObject storedObject = (StoredObject) webServiceMap.get(wrapper.getName());
 
                     if (storedObject != null) {
-                        WebServiceContainer webServiceContainer = null;
+                        WebServiceContainer webServiceContainer;
                         try {
                             webServiceContainer = (WebServiceContainer) storedObject.getObject(cl);
                         } catch (IOException io) {



Mime
View raw message