geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r670972 - in /geronimo/server/trunk/testsuite/enterprise-testsuite/sec-tests: sec-ear/src/test/java/org/apache/geronimo/testsuite/security/ sec-ejb/src/main/java/org/apache/geronimo/itest/ sec-ejb/src/main/resources/META-INF/
Date Mon, 23 Jun 2008 23:55:51 GMT
Author: djencks
Date: Mon Jun 23 16:55:50 2008
New Revision: 670972

URL: http://svn.apache.org/viewvc?rev=670972&view=rev
Log:
GERONIMO-4124 fix run-as tests by defining 3rd role.  Results are more plausible but still
a bit odd

Modified:
    geronimo/server/trunk/testsuite/enterprise-testsuite/sec-tests/sec-ear/src/test/java/org/apache/geronimo/testsuite/security/RunAsTest.java
    geronimo/server/trunk/testsuite/enterprise-testsuite/sec-tests/sec-ejb/src/main/java/org/apache/geronimo/itest/TestSessionBean.java
    geronimo/server/trunk/testsuite/enterprise-testsuite/sec-tests/sec-ejb/src/main/resources/META-INF/openejb-jar.xml

Modified: geronimo/server/trunk/testsuite/enterprise-testsuite/sec-tests/sec-ear/src/test/java/org/apache/geronimo/testsuite/security/RunAsTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/enterprise-testsuite/sec-tests/sec-ear/src/test/java/org/apache/geronimo/testsuite/security/RunAsTest.java?rev=670972&r1=670971&r2=670972&view=diff
==============================================================================
--- geronimo/server/trunk/testsuite/enterprise-testsuite/sec-tests/sec-ear/src/test/java/org/apache/geronimo/testsuite/security/RunAsTest.java
(original)
+++ geronimo/server/trunk/testsuite/enterprise-testsuite/sec-tests/sec-ear/src/test/java/org/apache/geronimo/testsuite/security/RunAsTest.java
Mon Jun 23 16:55:50 2008
@@ -35,7 +35,11 @@
             "TestServlet isUserInRole foo: true\n" +
             "TestServlet isUserInRole bar: false\n" +
             "TestServlet isUserInRole baz: false";
-    private static final String SERVLET_BAZ = "TestServlet principal: baz\n" +
+    private static final String SERVLET_BAR = "TestServlet principal: foo\n" +
+            "TestServlet isUserInRole foo: false\n" +
+            "TestServlet isUserInRole bar: true\n" +
+            "TestServlet isUserInRole baz: false";
+    private static final String SERVLET_BAZ = "TestServlet principal: foo\n" +
             "TestServlet isUserInRole foo: false\n" +
             "TestServlet isUserInRole bar: false\n" +
             "TestServlet isUserInRole baz: true";
@@ -102,15 +106,12 @@
     @Test
     public void testForwardRunAsServlet() throws Exception {
         String path = "/sec/forwardRunAsServlet";
-//        testPath(path, SERVLET_FOO + "\n" + SERVLET_BAZ + EJB_BAZ + SERVLET_BAZ + "\n"
+ SERVLET_FOO);
-        //currently
-        testPath(path, SERVLET_FOO + "\n" + SERVLET_FOO + EJB_FOO + SERVLET_FOO + "\n" +
SERVLET_FOO);
+        testPath(path, SERVLET_FOO + "\n" + SERVLET_FOO + EJB_BAZ + SERVLET_FOO + "\n" +
SERVLET_FOO);
     }
     @Test
     public void testForwardRunAsServletToRunAs() throws Exception {
         String path = "/sec/forwardRunAsServletToRunAs";
-//        testPath(path, SERVLET_FOO + "\n" + SERVLET_BAZ + EJB_BAR + SERVLET_BAZ + "\n"
+ SERVLET_FOO);
-        testPath(path, SERVLET_FOO + "\n" + SERVLET_FOO + EJB_BAR + SERVLET_FOO + "\n" +
SERVLET_FOO);
+        testPath(path, SERVLET_FOO + "\n" + SERVLET_BAZ + EJB_BAR + SERVLET_BAZ + "\n" +
SERVLET_FOO);
     }
 
 

Modified: geronimo/server/trunk/testsuite/enterprise-testsuite/sec-tests/sec-ejb/src/main/java/org/apache/geronimo/itest/TestSessionBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/enterprise-testsuite/sec-tests/sec-ejb/src/main/java/org/apache/geronimo/itest/TestSessionBean.java?rev=670972&r1=670971&r2=670972&view=diff
==============================================================================
--- geronimo/server/trunk/testsuite/enterprise-testsuite/sec-tests/sec-ejb/src/main/java/org/apache/geronimo/itest/TestSessionBean.java
(original)
+++ geronimo/server/trunk/testsuite/enterprise-testsuite/sec-tests/sec-ejb/src/main/java/org/apache/geronimo/itest/TestSessionBean.java
Mon Jun 23 16:55:50 2008
@@ -24,7 +24,7 @@
 /**
  * @version $Rev$ $Date$
  */
-@DeclareRoles({"foo", "bar"})
+@DeclareRoles({"foo", "bar", "baz"})
 public class TestSessionBean implements SessionBean {
 
     SessionContext sessionContext;

Modified: geronimo/server/trunk/testsuite/enterprise-testsuite/sec-tests/sec-ejb/src/main/resources/META-INF/openejb-jar.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/enterprise-testsuite/sec-tests/sec-ejb/src/main/resources/META-INF/openejb-jar.xml?rev=670972&r1=670971&r2=670972&view=diff
==============================================================================
--- geronimo/server/trunk/testsuite/enterprise-testsuite/sec-tests/sec-ejb/src/main/resources/META-INF/openejb-jar.xml
(original)
+++ geronimo/server/trunk/testsuite/enterprise-testsuite/sec-tests/sec-ejb/src/main/resources/META-INF/openejb-jar.xml
Mon Jun 23 16:55:50 2008
@@ -51,6 +51,13 @@
                 </s:run-as-subject>
                 <s:principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal"
name="bar"/>
             </s:role>
+            <s:role role-name="baz">
+                <s:run-as-subject>
+                    <s:realm>test-realm</s:realm>
+                    <s:id>baz-subject</s:id>
+                </s:run-as-subject>
+                <s:principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal"
name="baz"/>
+            </s:role>
         </s:role-mappings>
     </s:security>
     <gbean name="test-realm"
@@ -61,7 +68,7 @@
                 <lc:login-module control-flag="REQUIRED" wrap-principals="false">
                     <lc:login-domain-name>test-domain</lc:login-domain-name>
                     <lc:login-module-class>org.apache.geronimo.itest.TestLoginModule</lc:login-module-class>
-                    <lc:option name="users">foo,bar</lc:option>
+                    <lc:option name="users">foo,bar,baz</lc:option>
                 </lc:login-module>
             </lc:login-config>
         </xml-reference>
@@ -95,6 +102,17 @@
                             <value>bar</value>
                         </credential>
                     </subject>
+                    <subject>
+                        <id>baz-subject</id>
+                        <credential>
+                            <type>org.apache.geronimo.security.credentialstore.NameCallbackHandler</type>
+                            <value>baz</value>
+                        </credential>
+                        <credential>
+                            <type>org.apache.geronimo.security.credentialstore.PasswordCallbackHandler</type>
+                            <value>baz</value>
+                        </credential>
+                    </subject>
                 </realm>
             </credential-store>
         </xml-attribute>



Mime
View raw message