[jboss-cvs] JBossAS SVN: r61942 - in trunk/testsuite: src/resources/security and 5 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Mar 31 04:08:09 EDT 2007


Author: anil.saldhana at jboss.com
Date: 2007-03-31 04:08:09 -0400 (Sat, 31 Mar 2007)
New Revision: 61942

Added:
   trunk/testsuite/src/resources/web/custom-principal/
   trunk/testsuite/src/resources/web/custom-principal/WEB-INF/
   trunk/testsuite/src/resources/web/custom-principal/WEB-INF/jboss-web.xml
   trunk/testsuite/src/resources/web/custom-principal/WEB-INF/web.xml
   trunk/testsuite/src/resources/web/custom-principal/index.jsp
   trunk/testsuite/src/resources/web/custom-principal/login.jsp
   trunk/testsuite/src/resources/web/custom-principal/loginError.jsp
Removed:
   trunk/testsuite/src/resources/security/custom-principal/
Modified:
   trunk/testsuite/imports/sections/security.xml
   trunk/testsuite/src/resources/security/META-INF/application-jaas.xml
   trunk/testsuite/src/resources/security/META-INF/ejb-jar.xml
   trunk/testsuite/src/resources/security/META-INF/jboss.xml
   trunk/testsuite/src/resources/security/service-inf/jaas-test-config.xml
Log:
fix the resources for the custom principal propagation test case

Modified: trunk/testsuite/imports/sections/security.xml
===================================================================
--- trunk/testsuite/imports/sections/security.xml	2007-03-31 07:16:14 UTC (rev 61941)
+++ trunk/testsuite/imports/sections/security.xml	2007-03-31 08:08:09 UTC (rev 61942)
@@ -165,6 +165,18 @@
          </fileset>
       </jar>
 
+      <!-- Test Custom Principal Propagation -->
+      <war destfile="${build.lib}/custom-principal.war"
+         webxml="${build.resources}/web/custom-principal/WEB-INF/web.xml">
+         <webinf dir="${build.resources}/web/custom-principal/WEB-INF/">
+            <include name="jboss-web.xml"/>
+         </webinf> 
+         <fileset dir="${build.resources}/web/custom-principal">
+            <include name="**/*.html"/>
+            <include name="**/*.jsp"/>
+         </fileset>
+      </war>
+
       <!-- build security-jaas.jar -->
       <jar destfile="${build.lib}/security-jaas.sar">
          <metainf dir="${build.resources}/security/service-inf"/>
@@ -197,24 +209,13 @@
             <include name="security-jaas.jar"/>
             <include name="security-jaas.sar"/>
             <include name="security-jaas.war"/>
+            <include name="custom-principal.war"/>
          </fileset>
          <zipfileset dir="${build.resources}/security" prefix="security">
             <include name="roles.properties"/>
             <include name="users.properties"/>
          </zipfileset>
       </ear>
-      <!-- Test Custom Principal Propagation -->
-      <war destfile="${build.lib}/custom-principal.war"
-         webxml="${build.resources}/security/custom-principal/WEB-INF/web.xml">
-         <webinf dir="${build.resources}/security/custom-principal/WEB-INF/">
-            <include name="jboss-web.xml"/>
-         </webinf> 
-         <fileset dir="${build.resources}/security/custom-principal">
-            <include name="**/*.html"/>
-            <include name="**/*.jsp"/>
-         </fileset>
-      </war>
-
       <!-- build security-incpt.jar -->
       <jar destfile="${build.lib}/security-incpt.jar">
          <fileset dir="${build.classes}">

Modified: trunk/testsuite/src/resources/security/META-INF/application-jaas.xml
===================================================================
--- trunk/testsuite/src/resources/security/META-INF/application-jaas.xml	2007-03-31 07:16:14 UTC (rev 61941)
+++ trunk/testsuite/src/resources/security/META-INF/application-jaas.xml	2007-03-31 08:08:09 UTC (rev 61942)
@@ -13,6 +13,13 @@
        </web>
     </module>
 
+    <module>
+       <web>
+           <web-uri>custom-principal.war</web-uri>
+           <context-root>/custom-principal</context-root>
+       </web>
+    </module>
+
    <module>
       <ejb>security-jaas.jar</ejb>
    </module>

Modified: trunk/testsuite/src/resources/security/META-INF/ejb-jar.xml
===================================================================
--- trunk/testsuite/src/resources/security/META-INF/ejb-jar.xml	2007-03-31 07:16:14 UTC (rev 61941)
+++ trunk/testsuite/src/resources/security/META-INF/ejb-jar.xml	2007-03-31 08:08:09 UTC (rev 61942)
@@ -25,6 +25,16 @@
          <session-type>Stateless</session-type>
          <transaction-type>Container</transaction-type>
       </session>
+
+      <session>
+         <description>A secured project repository stateful session bean</description>
+         <ejb-name>CustomPrincipalPropagation</ejb-name>
+         <home>org.jboss.test.security.interfaces.CustomPrincipalHome</home>
+         <remote>org.jboss.test.security.interfaces.CustomPrincipal</remote>
+         <ejb-class>org.jboss.test.security.ejb.CustomPrincipalBean</ejb-class>
+         <session-type>Stateless</session-type>
+         <transaction-type>Container</transaction-type>
+      </session>
    </enterprise-beans>
 
    <assembly-descriptor>

Modified: trunk/testsuite/src/resources/security/META-INF/jboss.xml
===================================================================
--- trunk/testsuite/src/resources/security/META-INF/jboss.xml	2007-03-31 07:16:14 UTC (rev 61941)
+++ trunk/testsuite/src/resources/security/META-INF/jboss.xml	2007-03-31 08:08:09 UTC (rev 61942)
@@ -18,6 +18,12 @@
          <jndi-name>jaas.CustomPrincipal2Home</jndi-name>
          <configuration-name>CustomLoginModule Session</configuration-name>
       </session>
+
+      <session>
+         <ejb-name>CustomPrincipalPropagation</ejb-name>
+         <jndi-name>jaas.CustomPrincipalPropagation</jndi-name>
+         <configuration-name>CustomLoginModulePropagation Session</configuration-name>
+      </session>
    </enterprise-beans>
 
    <container-configurations>
@@ -25,5 +31,9 @@
          <container-name>CustomLoginModule Session</container-name>
          <security-domain>java:/jaas/jaas-test2</security-domain>
       </container-configuration>
+      <container-configuration extends="Standard Stateless SessionBean">
+         <container-name>CustomLoginModulePropagation Session</container-name>
+         <security-domain>java:/jaas/jaas-testpropagation</security-domain>
+      </container-configuration>
    </container-configurations>
 </jboss>

Modified: trunk/testsuite/src/resources/security/service-inf/jaas-test-config.xml
===================================================================
--- trunk/testsuite/src/resources/security/service-inf/jaas-test-config.xml	2007-03-31 07:16:14 UTC (rev 61941)
+++ trunk/testsuite/src/resources/security/service-inf/jaas-test-config.xml	2007-03-31 08:08:09 UTC (rev 61942)
@@ -31,4 +31,19 @@
       </authentication>
    </application-policy>
 
+   <application-policy name = "jaas-testpropagation">
+      <authentication>
+         <login-module code = "org.jboss.test.security.ejb.CustomPrincipalLoginModule"
+            flag = "required">
+            <module-option name = "unauthenticatedIdentity">anonymous</module-option>
+            <module-option name="usersProperties">security/users.properties</module-option>
+            <module-option name="rolesProperties">security/roles.properties</module-option>
+            <module-option name="password-stacking">useFirstPass</module-option>
+         </login-module>
+         <login-module code = "org.jboss.security.ClientLoginModule" flag="required">
+            <module-option name="password-stacking">useFirstPass</module-option>
+         </login-module>
+      </authentication>
+   </application-policy>
+
 </policy>

Added: trunk/testsuite/src/resources/web/custom-principal/WEB-INF/jboss-web.xml
===================================================================
--- trunk/testsuite/src/resources/web/custom-principal/WEB-INF/jboss-web.xml	                        (rev 0)
+++ trunk/testsuite/src/resources/web/custom-principal/WEB-INF/jboss-web.xml	2007-03-31 08:08:09 UTC (rev 61942)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE jboss-web
+   PUBLIC "-//JBoss//DTD Web Application 2.4//EN"
+   "http://www.jboss.org/j2ee/dtds/jboss-web_4_0.dtd">
+<jboss-web>
+   <security-domain>java:/jaas/jaas-testpropagation</security-domain>
+</jboss-web>

Added: trunk/testsuite/src/resources/web/custom-principal/WEB-INF/web.xml
===================================================================
--- trunk/testsuite/src/resources/web/custom-principal/WEB-INF/web.xml	                        (rev 0)
+++ trunk/testsuite/src/resources/web/custom-principal/WEB-INF/web.xml	2007-03-31 08:08:09 UTC (rev 61942)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE web-app
+  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
+  "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+  <display-name>Custom Principal Propagation Test</display-name>
+  <welcome-file-list>
+    <welcome-file>index.jsp</welcome-file>
+  </welcome-file-list>
+
+  <security-constraint>
+    <web-resource-collection>
+      <web-resource-name>allJspPages</web-resource-name>
+      <description>All JSP Pages</description>
+      <url-pattern>*.jsp</url-pattern>
+      <http-method>GET</http-method>
+      <http-method>POST</http-method>
+    </web-resource-collection>
+    <auth-constraint>
+      <role-name>Echo</role-name>
+    </auth-constraint>
+    <user-data-constraint>
+      <description>no description</description>
+      <transport-guarantee>NONE</transport-guarantee>
+    </user-data-constraint>
+  </security-constraint>
+
+  <login-config>
+    <auth-method>FORM</auth-method>
+    <realm-name>CustomPrincipalPropagation</realm-name>
+    <form-login-config>
+      <form-login-page>/login.jsp</form-login-page>
+      <form-error-page>/loginError.jsp</form-error-page>
+    </form-login-config>
+  </login-config>
+
+  <security-role>
+    <role-name>Echo</role-name>
+  </security-role>
+</web-app>

Added: trunk/testsuite/src/resources/web/custom-principal/index.jsp
===================================================================
--- trunk/testsuite/src/resources/web/custom-principal/index.jsp	                        (rev 0)
+++ trunk/testsuite/src/resources/web/custom-principal/index.jsp	2007-03-31 08:08:09 UTC (rev 61942)
@@ -0,0 +1,23 @@
+<%@page import="javax.naming.InitialContext,javax.rmi.PortableRemoteObject,org.jboss.test.security.interfaces.CustomPrincipalHome,org.jboss.test.security.interfaces.CustomPrincipal,org.jboss.test.security.ejb.CustomPrincipalImpl"
+%>
+
+<%
+   boolean isCustomType = false;
+   try
+   {
+     InitialContext ic = new InitialContext();
+     Object obj = ic.lookup("jaas.CustomPrincipalPropagation");
+     obj = PortableRemoteObject.narrow(obj, CustomPrincipalHome.class);
+     CustomPrincipalHome home = (CustomPrincipalHome) obj;
+     CustomPrincipal bean = home.create();
+     isCustomType = bean.validateCallerPrincipal(CustomPrincipalImpl.class);
+     bean.remove();
+   }
+   catch(Exception e)
+   {
+     throw new IllegalStateException(e.getMessage());
+   }
+   if(!isCustomType)
+       throw new IllegalStateException("Custom Principal not seen");
+   out.println("Propagation Success");
+%>

Added: trunk/testsuite/src/resources/web/custom-principal/login.jsp
===================================================================
--- trunk/testsuite/src/resources/web/custom-principal/login.jsp	                        (rev 0)
+++ trunk/testsuite/src/resources/web/custom-principal/login.jsp	2007-03-31 08:08:09 UTC (rev 61942)
@@ -0,0 +1,15 @@
+<html>
+<body>
+    <form action="j_security_check" method="post" id="login">
+        <p>
+          User ID: <input type="text" size="20" name="j_username" id="user
+name_id"/>
+         <br>
+          Password: <input type="password" size="20" name="j_password"/>
+         <br>
+         <br>
+        <input type="submit" value="submit">
+        </p>
+     </form>
+</body>
+</html>

Added: trunk/testsuite/src/resources/web/custom-principal/loginError.jsp
===================================================================
--- trunk/testsuite/src/resources/web/custom-principal/loginError.jsp	                        (rev 0)
+++ trunk/testsuite/src/resources/web/custom-principal/loginError.jsp	2007-03-31 08:08:09 UTC (rev 61942)
@@ -0,0 +1 @@
+Encountered a login error!!




More information about the jboss-cvs-commits mailing list