You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by dd...@apache.org on 2005/07/23 05:53:43 UTC

svn commit: r224437 - in /portals/pluto/trunk/portal: ./ src/java/org/apache/pluto/portalImpl/om/servlet/impl/ src/resources/ src/webapp/WEB-INF/ src/webapp/WEB-INF/aggregation/ src/webapp/WEB-INF/data/xml/

Author: ddewolf
Date: Fri Jul 22 20:53:33 2005
New Revision: 224437

URL: http://svn.apache.org/viewcvs?rev=224437&view=rev
Log:
1) Resolving PLUTO-131 - Broken Loging Link.  
2) Adding basic support for multiple security constraint elements.
3) Updating Tomcat server.xml on deploy to support emptySessionPath.

Added:
    portals/pluto/trunk/portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/SecurityConstraintImpl.java
    portals/pluto/trunk/portal/src/resources/server.xml
Modified:
    portals/pluto/trunk/portal/maven.xml
    portals/pluto/trunk/portal/project.properties
    portals/pluto/trunk/portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/WebApplicationDefinitionImpl.java
    portals/pluto/trunk/portal/src/webapp/WEB-INF/aggregation/Banner.jsp
    portals/pluto/trunk/portal/src/webapp/WEB-INF/data/xml/servletdefinitionmapping.xml
    portals/pluto/trunk/portal/src/webapp/WEB-INF/web.xml

Modified: portals/pluto/trunk/portal/maven.xml
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/portal/maven.xml?rev=224437&r1=224436&r2=224437&view=diff
==============================================================================
--- portals/pluto/trunk/portal/maven.xml (original)
+++ portals/pluto/trunk/portal/maven.xml Fri Jul 22 20:53:33 2005
@@ -128,5 +128,8 @@
         <copy file="${maven.tomcat.context.config}"
               todir="${maven.tomcat.home}/conf/Catalina/${maven.tomcat.host}"/>
 	</j:if>
+
+	<copy file="${maven.tomcat.server.config}"
+		  todir="${maven.tomcat.home}/conf"/>
   </goal>
 </project>

Modified: portals/pluto/trunk/portal/project.properties
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/portal/project.properties?rev=224437&r1=224436&r2=224437&view=diff
==============================================================================
--- portals/pluto/trunk/portal/project.properties (original)
+++ portals/pluto/trunk/portal/project.properties Fri Jul 22 20:53:33 2005
@@ -35,3 +35,4 @@
 maven.tomcat.host=localhost
 maven.tomcat.context.config=pluto.xml
 maven.tomcat.deploy=exploded
+maven.tomcat.server.config=src/resources/server.xml

Added: portals/pluto/trunk/portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/SecurityConstraintImpl.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/SecurityConstraintImpl.java?rev=224437&view=auto
==============================================================================
--- portals/pluto/trunk/portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/SecurityConstraintImpl.java (added)
+++ portals/pluto/trunk/portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/SecurityConstraintImpl.java Fri Jul 22 20:53:33 2005
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.portalImpl.om.servlet.impl;
+
+/**
+ * Security Constraint Mapping
+ *
+ * @author ddewolf@apache.org
+ * @since Jul 22, 2005
+ */
+public class SecurityConstraintImpl {
+
+}

Modified: portals/pluto/trunk/portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/WebApplicationDefinitionImpl.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/WebApplicationDefinitionImpl.java?rev=224437&r1=224436&r2=224437&view=diff
==============================================================================
--- portals/pluto/trunk/portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/WebApplicationDefinitionImpl.java (original)
+++ portals/pluto/trunk/portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/WebApplicationDefinitionImpl.java Fri Jul 22 20:53:33 2005
@@ -57,12 +57,12 @@
     public String errorPage = null;
     public String taglib = null;
     public String resourceRef = null;
-    public String securityConstraint = null;
     public String loginConfig = null;
     public String securityRole = null;
     public String envEntry = null;
     public String ejbRef = null;
     private Collection castorMimeMappings = new ArrayList();    // </not used variables - only for castor>
+    private Collection securityConstraints = new ArrayList();
 
 
     private String contextPath = null;        
@@ -345,12 +345,20 @@
     {
         return castorMimeMappings;
     }
-    
+
+    public Collection getSecurityConstraints() {
+        return securityConstraints;
+    }
+
     /**
      * @param castorMimeMappings The castorMimeMappings to set.
      */
     public void setCastorMimeMappings(Collection castorMimeMappings) 
     {
         this.castorMimeMappings = castorMimeMappings;
+    }
+
+    public void setSecurityConstraints(Collection securityConstraints) {
+        this.securityConstraints = securityConstraints;
     }
 }

Added: portals/pluto/trunk/portal/src/resources/server.xml
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/portal/src/resources/server.xml?rev=224437&view=auto
==============================================================================
--- portals/pluto/trunk/portal/src/resources/server.xml (added)
+++ portals/pluto/trunk/portal/src/resources/server.xml Fri Jul 22 20:53:33 2005
@@ -0,0 +1,58 @@
+<Server port="8005" shutdown="SHUTDOWN">
+
+  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
+  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
+  <Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
+
+  <GlobalNamingResources>
+
+    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
+
+    <Resource name="UserDatabase" auth="Container"
+              type="org.apache.catalina.UserDatabase"
+       description="User database that can be updated and saved"
+           factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
+          pathname="conf/tomcat-users.xml" />
+
+  </GlobalNamingResources>
+
+  <Service name="Catalina">
+
+    <Connector port="8080" maxHttpHeaderSize="8192"
+               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
+               enableLookups="false" redirectPort="8443" acceptCount="100"
+			   connectionTimeout="20000" disableUploadTimeout="true"
+			   emptySessionPath="true" />
+
+	<!--
+    <Connector port="8443" maxHttpHeaderSize="8192"
+               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
+               enableLookups="false" disableUploadTimeout="true"
+               acceptCount="100" scheme="https" secure="true"
+			   clientAuth="false" sslProtocol="TLS"
+			   emptySessionPath="true" />
+	-->
+
+    <Connector port="8009" 
+               enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
+
+
+    <Engine name="Catalina" defaultHost="localhost">
+
+      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
+             resourceName="UserDatabase"/>
+
+      <Host name="localhost" appBase="webapps"
+       unpackWARs="true" autoDeploy="true"
+       xmlValidation="false" xmlNamespaceAware="false">
+
+        <!--
+        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
+        -->
+      </Host>
+
+    </Engine>
+
+  </Service>
+
+</Server>

Modified: portals/pluto/trunk/portal/src/webapp/WEB-INF/aggregation/Banner.jsp
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/portal/src/webapp/WEB-INF/aggregation/Banner.jsp?rev=224437&r1=224436&r2=224437&view=diff
==============================================================================
Binary files - no diff available.

Modified: portals/pluto/trunk/portal/src/webapp/WEB-INF/data/xml/servletdefinitionmapping.xml
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/portal/src/webapp/WEB-INF/data/xml/servletdefinitionmapping.xml?rev=224437&r1=224436&r2=224437&view=diff
==============================================================================
--- portals/pluto/trunk/portal/src/webapp/WEB-INF/data/xml/servletdefinitionmapping.xml (original)
+++ portals/pluto/trunk/portal/src/webapp/WEB-INF/data/xml/servletdefinitionmapping.xml Fri Jul 22 20:53:33 2005
@@ -76,7 +76,11 @@
 
   </class>
 
-  <class name="org.apache.pluto.portalImpl.om.common.impl.DescriptionImpl">
+  <class name="org.apache.pluto.portalImpl.om.servlet.impl.SecurityConstraintImpl">
+
+  </class>
+
+    <class name="org.apache.pluto.portalImpl.om.common.impl.DescriptionImpl">
 
     <field name="description" type="java.lang.String">
         <bind-xml node="text"/>
@@ -262,9 +266,14 @@
         <bind-xml name="error-page" node="element"/>
     </field>
     
-    <field name="securityConstraint" transient="true" direct="true">
-        <bind-xml name="security-constraint" node="element"/>
-    </field>
+      <field name="securityConstraints"
+          transient="true"
+          required="false"
+          type="org.apache.pluto.portalImpl.om.servlet.impl.SecurityConstraintImpl"
+          collection="collection">
+          <bind-xml name="security-constraint" node="element"/>
+      </field>
+
     <field name="loginConfig" transient="true" direct="true">
         <bind-xml name="login-config" node="element"/>
     </field>

Modified: portals/pluto/trunk/portal/src/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/portal/src/webapp/WEB-INF/web.xml?rev=224437&r1=224436&r2=224437&view=diff
==============================================================================
--- portals/pluto/trunk/portal/src/webapp/WEB-INF/web.xml (original)
+++ portals/pluto/trunk/portal/src/webapp/WEB-INF/web.xml Fri Jul 22 20:53:33 2005
@@ -92,6 +92,10 @@
        <url-pattern>/portal/*</url-pattern>
     </servlet-mapping>
     <servlet-mapping>
+       <servlet-name>pluto</servlet-name>
+       <url-pattern>/privileged/*</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
       <servlet-name>pluto</servlet-name>
       <url-pattern>/secure/*</url-pattern>
     </servlet-mapping>
@@ -137,7 +141,20 @@
      <user-data-constraint>
        <transport-guarantee>CONFIDENTIAL</transport-guarantee>
      </user-data-constraint>
-  </security-constraint>
+   </security-constraint>
+
+    <security-constraint>
+      <web-resource-collection>
+       <web-resource-name/>
+       <url-pattern>/privileged/*</url-pattern>
+       <http-method>GET</http-method>
+       <http-method>POST</http-method>
+       <http-method>PUT</http-method>
+     </web-resource-collection>
+     <auth-constraint>
+       <role-name>tomcat</role-name>
+     </auth-constraint>
+   </security-constraint>
 
   <login-config>
     <auth-method>FORM</auth-method>