You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jg...@apache.org on 2019/05/29 10:02:05 UTC

[tomee] branch tomee-7.1.x updated (e34a4d2 -> f8218b8)

This is an automated email from the ASF dual-hosted git repository.

jgallimore pushed a change to branch tomee-7.1.x
in repository https://gitbox.apache.org/repos/asf/tomee.git.


    from e34a4d2  Merge branch 'tomee-7.1.x' of github.com:apache/tomee into tomee-7.1.x t push
     new c85ac3a  For review; We shouldn't use javax.security.jacc.policy.provider here, because the System policy will already be set. We need to ensure that our policy provider is used, which will delegate to the system policy as appropriate
     new 0b71eec  Only check JACC permissions here
     new 7b9d81b  Check for case where policy is specified but not loaded, e.g. system.properties. Include the remote-secpol profile for all arquillian tests.
     new ed11248  Adding test
     new 5a50e88  Adding test
     new 8fe1b94  Fix test
     new f8218b8  Merge remote-tracking branch 'apache/tomee-7.1.x' into tomee-7.1.x

The 7 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../src/test/resources/arquillian.xml              | 15 +++++++
 .../src/test/resources/arquillian.xml              | 17 ++++++++
 .../src/test/resources/arquillian.xml              | 15 +++++++
 .../src/test/resources/arquillian.xml              | 15 +++++++
 .../src/test/resources/arquillian.xml              | 24 +++++++++++
 .../src/test/resources/arquillian.xml              | 23 +++++++++++
 arquillian/arquillian-tomee-tests/pom.xml          | 17 ++++++++
 .../core/security/AbstractSecurityService.java     | 15 ++++++-
 .../core/security/jacc/BasicJaccProvider.java      | 18 ++++++++-
 ...ServiceTest.java => BasicJaccProviderTest.java} | 46 +++++++++++++++++-----
 10 files changed, 194 insertions(+), 11 deletions(-)
 copy container/openejb-core/src/test/java/org/apache/openejb/core/security/{AbstractSecurityServiceTest.java => BasicJaccProviderTest.java} (51%)


[tomee] 02/07: Only check JACC permissions here

Posted by jg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jgallimore pushed a commit to branch tomee-7.1.x
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit 0b71eec6e8a18a80fa3296a998523fec2024a21a
Author: Jonathan Gallimore <jo...@jrg.me.uk>
AuthorDate: Tue Aug 21 22:39:10 2018 +0100

    Only check JACC permissions here
---
 .../src/test/resources/arquillian.xml              | 23 ++++++++++++++++++++++
 arquillian/arquillian-tomee-tests/pom.xml          | 17 ++++++++++++++++
 .../core/security/jacc/BasicJaccProvider.java      | 18 ++++++++++++++++-
 3 files changed, 57 insertions(+), 1 deletion(-)

diff --git a/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/resources/arquillian.xml b/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/resources/arquillian.xml
index fb0f5fd..8640e8e 100644
--- a/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/resources/arquillian.xml
+++ b/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/resources/arquillian.xml
@@ -113,6 +113,29 @@
       </property>
     </configuration>
   </container>
+  <container qualifier="tomee-remote-secpol">
+    <configuration>
+      <property name="httpPort">-1</property>
+      <property name="ajpPort">-1</property>
+      <property name="stopPort">-1</property>
+      <property name="dir">target/tomee-remote</property>
+      <property name="appWorkingDir">target/arquillian-remote-working-dir</property>
+      <property name="portRange">33001-36000</property>
+      <property name="cleanOnStartUp">true</property>
+      <property name="properties">
+        My\ DataSource.JdbcUrl = jdbc:hsqldb:mem:hsqldb
+        My\ Unmanaged\ DataSource.JdbcUrl = jdbc:hsqldb:mem:hsqldb
+        openejb.classloader.forced-load=org.apache.openejb.arquillian.tests
+        openejb.ear.use-as-webcontext-base=true
+        embedded = false
+
+        # try to save some permgen mem
+        openejb.cdi.activated-on-ejb = false
+        openejb.descriptors.output = true
+        javax.security.jacc.policy.provider=sun.security.provider.PolicyFile
+      </property>
+    </configuration>
+  </container>
   <container qualifier="tomee-webapp">
     <configuration>
       <property name="httpPort">-1</property>
diff --git a/arquillian/arquillian-tomee-tests/pom.xml b/arquillian/arquillian-tomee-tests/pom.xml
index 310fbf8..5799e29 100644
--- a/arquillian/arquillian-tomee-tests/pom.xml
+++ b/arquillian/arquillian-tomee-tests/pom.xml
@@ -268,6 +268,23 @@
                 </configuration>
               </execution>
               <execution>
+                <id>test-tomee-remote-secpol</id>
+                <phase>test</phase>
+                <goals>
+                  <goal>test</goal>
+                </goals>
+                <configuration>
+                  <skip>${skip.remote.webprofile}</skip>
+                  <systemPropertyVariables>
+                    <openejb.arquillian.debug>true</openejb.arquillian.debug>
+                    <tomee.version>${project.version}</tomee.version>
+                    <tomee.classifier>webprofile</tomee.classifier>
+                    <arquillian.launch>tomee-remote-secpol</arquillian.launch>
+                    <openejb.arquillian.adapter>tomee-remote</openejb.arquillian.adapter>
+                  </systemPropertyVariables>
+                </configuration>
+              </execution>
+              <execution>
                 <id>test-tomee-embedded</id>
                 <phase>test</phase>
                 <goals>
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/security/jacc/BasicJaccProvider.java b/container/openejb-core/src/main/java/org/apache/openejb/core/security/jacc/BasicJaccProvider.java
index 4d59fa1..a77c46c 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/core/security/jacc/BasicJaccProvider.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/core/security/jacc/BasicJaccProvider.java
@@ -19,20 +19,36 @@ package org.apache.openejb.core.security.jacc;
 
 import org.apache.openejb.core.security.JaccProvider;
 
+import javax.security.jacc.EJBMethodPermission;
+import javax.security.jacc.EJBRoleRefPermission;
 import javax.security.jacc.PolicyConfiguration;
 import javax.security.jacc.PolicyContext;
 import javax.security.jacc.PolicyContextException;
+import javax.security.jacc.WebResourcePermission;
+import javax.security.jacc.WebRoleRefPermission;
+import javax.security.jacc.WebUserDataPermission;
 import java.security.CodeSource;
 import java.security.Permission;
 import java.security.PermissionCollection;
 import java.security.ProtectionDomain;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Map;
+import java.util.Set;
 
 /**
  * @version $Rev$ $Date$
  */
 public class BasicJaccProvider extends JaccProvider {
+    private static final Set<Class> JACC_PERMISSIONS = new HashSet<Class>() {
+        {
+            add(EJBMethodPermission.class);
+            add(EJBRoleRefPermission.class);
+            add(WebResourcePermission.class);
+            add(WebRoleRefPermission.class);
+            add(WebUserDataPermission.class);
+        }
+    };
     static {
         // force preloading to avoid to loop under SecurityManager
         try {
@@ -82,7 +98,7 @@ public class BasicJaccProvider extends JaccProvider {
     public boolean implies(final ProtectionDomain domain, final Permission permission) {
         final String contextID = PolicyContext.getContextID();
 
-        if (contextID != null) {
+        if (contextID != null && JACC_PERMISSIONS.contains(permission.getClass())) {
             try {
                 final BasicPolicyConfiguration configuration = configurations.get(contextID);
 


[tomee] 03/07: Check for case where policy is specified but not loaded, e.g. system.properties. Include the remote-secpol profile for all arquillian tests.

Posted by jg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jgallimore pushed a commit to branch tomee-7.1.x
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit 7b9d81b7acae8699fe15ae78698f6c0449a646ce
Author: Jonathan Gallimore <jo...@jrg.me.uk>
AuthorDate: Thu May 23 21:43:02 2019 +0100

    Check for case where policy is specified but not loaded, e.g. system.properties. Include the remote-secpol profile for all arquillian tests.
---
 .../src/test/resources/arquillian.xml              | 15 ++++++++++++++
 .../src/test/resources/arquillian.xml              | 17 +++++++++++++++
 .../src/test/resources/arquillian.xml              | 15 ++++++++++++++
 .../src/test/resources/arquillian.xml              | 15 ++++++++++++++
 .../src/test/resources/arquillian.xml              | 24 ++++++++++++++++++++++
 .../core/security/AbstractSecurityService.java     | 15 +++++++++++++-
 6 files changed, 100 insertions(+), 1 deletion(-)

diff --git a/arquillian/arquillian-tomee-tests/arquillian-tomee-codi-tests/src/test/resources/arquillian.xml b/arquillian/arquillian-tomee-tests/arquillian-tomee-codi-tests/src/test/resources/arquillian.xml
index 7116ee4..7e08f12 100644
--- a/arquillian/arquillian-tomee-tests/arquillian-tomee-codi-tests/src/test/resources/arquillian.xml
+++ b/arquillian/arquillian-tomee-tests/arquillian-tomee-codi-tests/src/test/resources/arquillian.xml
@@ -46,6 +46,21 @@
       </property>
     </configuration>
   </container>
+  <container qualifier="tomee-remote-secpol">
+    <configuration>
+      <property name="httpPort">-1</property>
+      <property name="ajpPort">-1</property>
+      <property name="stopPort">-1</property>
+      <property name="dir">target/apache-tomee-remote</property>
+      <property name="appWorkingDir">target/arquillian-test-working-dir</property>
+      <property name="properties">
+        My\ DataSource.JdbcUrl = jdbc:hsqldb:mem:hsqldb
+        My\ Unmanaged\ DataSource.JdbcUrl = jdbc:hsqldb:mem:hsqldb
+        openejb.classloader.forced-load=org.apache.openejb.arquillian.tests.
+        javax.security.jacc.policy.provider=sun.security.provider.PolicyFile
+      </property>
+    </configuration>
+  </container>
   <container qualifier="tomee-webapp">
     <configuration>
       <property name="httpPort">-1</property>
diff --git a/arquillian/arquillian-tomee-tests/arquillian-tomee-config-tests/src/test/resources/arquillian.xml b/arquillian/arquillian-tomee-tests/arquillian-tomee-config-tests/src/test/resources/arquillian.xml
index 71cdd3b..29949c6 100644
--- a/arquillian/arquillian-tomee-tests/arquillian-tomee-config-tests/src/test/resources/arquillian.xml
+++ b/arquillian/arquillian-tomee-tests/arquillian-tomee-config-tests/src/test/resources/arquillian.xml
@@ -49,6 +49,23 @@
       </property>
     </configuration>
   </container>
+  <container qualifier="tomee-remote-secpol">
+    <configuration>
+      <property name="httpPort">-1</property>
+      <property name="ajpPort">-1</property>
+      <property name="stopPort">-1</property>
+      <property name="dir">target/tomee-remote</property>
+      <property name="appWorkingDir">target/arquillian-remote-working-dir</property>
+      <property name="portRange">20001-30000</property>
+      <property name="cleanOnStartUp">true</property>
+      <property name="properties">
+        My\ DataSource.JdbcUrl = jdbc:hsqldb:mem:hsqldb
+        My\ Unmanaged\ DataSource.JdbcUrl = jdbc:hsqldb:mem:hsqldb
+        openejb.classloader.forced-load=org.apache.openejb.arquillian.tests
+        javax.security.jacc.policy.provider=sun.security.provider.PolicyFile
+      </property>
+    </configuration>
+  </container>
   <container qualifier="tomee-webapp">
     <configuration>
       <property name="httpPort">-1</property>
diff --git a/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/resources/arquillian.xml b/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/resources/arquillian.xml
index f73dc6b..71e9ba0 100644
--- a/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/resources/arquillian.xml
+++ b/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/resources/arquillian.xml
@@ -46,6 +46,21 @@
       </property>
     </configuration>
   </container>
+  <container qualifier="tomee-remote-secpol">
+    <configuration>
+      <property name="httpPort">-1</property>
+      <property name="ajpPort">-1</property>
+      <property name="stopPort">-1</property>
+      <property name="dir">target/apache-tomee-remote</property>
+      <property name="appWorkingDir">target/arquillian-test-working-dir</property>
+      <property name="properties">
+        My\ DataSource.JdbcUrl = jdbc:hsqldb:mem:hsqldb
+        My\ Unmanaged\ DataSource.JdbcUrl = jdbc:hsqldb:mem:hsqldb
+        openejb.classloader.forced-load=org.apache.openejb.arquillian.tests.
+        javax.security.jacc.policy.provider=sun.security.provider.PolicyFile
+      </property>
+    </configuration>
+  </container>
   <container qualifier="tomee-webapp">
     <configuration>
       <property name="httpPort">-1</property>
diff --git a/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxws-tests/src/test/resources/arquillian.xml b/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxws-tests/src/test/resources/arquillian.xml
index 9da1361..bac5665 100644
--- a/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxws-tests/src/test/resources/arquillian.xml
+++ b/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxws-tests/src/test/resources/arquillian.xml
@@ -46,6 +46,21 @@
       </property>
     </configuration>
   </container>
+  <container qualifier="tomee-remote-secpol">
+    <configuration>
+      <property name="httpPort">-1</property>
+      <property name="ajpPort">-1</property>
+      <property name="stopPort">-1</property>
+      <property name="dir">target/apache-tomee-remote</property>
+      <property name="appWorkingDir">target/arquillian-test-working-dir</property>
+      <property name="properties">
+        My\ DataSource.JdbcUrl = jdbc:hsqldb:mem:hsqldb
+        My\ Unmanaged\ DataSource.JdbcUrl = jdbc:hsqldb:mem:hsqldb
+        openejb.classloader.forced-load=org.apache.openejb.arquillian.tests
+        javax.security.jacc.policy.provider=sun.security.provider.PolicyFile
+      </property>
+    </configuration>
+  </container>
   <container qualifier="tomee-webapp">
     <configuration>
       <property name="httpPort">-1</property>
diff --git a/arquillian/arquillian-tomee-tests/arquillian-tomee-jms-tests/src/test/resources/arquillian.xml b/arquillian/arquillian-tomee-tests/arquillian-tomee-jms-tests/src/test/resources/arquillian.xml
index e46822e..4743854 100644
--- a/arquillian/arquillian-tomee-tests/arquillian-tomee-jms-tests/src/test/resources/arquillian.xml
+++ b/arquillian/arquillian-tomee-tests/arquillian-tomee-jms-tests/src/test/resources/arquillian.xml
@@ -51,6 +51,30 @@
       </property>
     </configuration>
   </container>
+  <container qualifier="tomee-remote-secpol">
+    <configuration>
+      <property name="httpPort">-1</property>
+      <property name="ajpPort">-1</property>
+      <property name="stopPort">-1</property>
+      <property name="dir">target/apache-tomee-remote</property>
+      <property name="appWorkingDir">target/arquillian-test-working-dir</property>
+      <property name="properties">
+        My\ DataSource.JdbcUrl = jdbc:hsqldb:mem:hsqldb
+        My\ Unmanaged\ DataSource.JdbcUrl = jdbc:hsqldb:mem:hsqldb
+
+        openejb.classloader.forced-load=org.apache.openejb.arquillian.tests.jms
+
+        AMQResourceAdapter = new://Resource?type=ActiveMQResourceAdapter
+        AMQResourceAdapter.BrokerXmlConfig = broker:(tcp://localhost:61616)?useJmx=false&amp;persistent=false
+        AMQResourceAdapter.ServerUrl = vm://jvm_broker
+        AMQMessageContainer = new://Container?type=MESSAGE
+        AMQMessageContainer.ResourceAdapter = AMQResourceAdapter
+        AMQConnectionFactory = new://Resource?type=javax.jms.ConnectionFactory
+        AMQConnectionFactory.ResourceAdapter = AMQResourceAdapter
+        javax.security.jacc.policy.provider=sun.security.provider.PolicyFile
+      </property>
+    </configuration>
+  </container>
   <container qualifier="tomee-webapp">
     <configuration>
       <property name="httpPort">-1</property>
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/security/AbstractSecurityService.java b/container/openejb-core/src/main/java/org/apache/openejb/core/security/AbstractSecurityService.java
index 82231a9..d671a6e 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/core/security/AbstractSecurityService.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/core/security/AbstractSecurityService.java
@@ -356,7 +356,19 @@ public abstract class AbstractSecurityService implements DestroyableResource, Se
             Thread.currentThread().setContextClassLoader(contextClassLoader);
         }
 
-        final String policyProvider = JaccProvider.Policy.class.getName();
+        // check the system provided provider first - if for some reason it isn't loaded, load it
+        final String systemPolicyProvider = SystemInstance.get().getOptions().getProperties().getProperty("javax.security.jacc.policy.provider");
+        if (systemPolicyProvider != null && Policy.getPolicy() == null) {
+            installPolicy(systemPolicyProvider);
+        }
+
+        if (! JaccProvider.Policy.class.getName().equals(Policy.getPolicy().getClass().getName())) {
+            // this should delegate to the policy installed above
+            installPolicy(JaccProvider.Policy.class.getName());
+        }
+    }
+
+    private static void installPolicy(String policyProvider) {
         try {
             final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
             final Class policyClass = Class.forName(policyProvider, true, classLoader);
@@ -368,6 +380,7 @@ public abstract class AbstractSecurityService implements DestroyableResource, Se
         }
     }
 
+
     protected Subject createSubject(final String name, final String groupName) {
         if (name == null) {
             return null;


[tomee] 06/07: Fix test

Posted by jg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jgallimore pushed a commit to branch tomee-7.1.x
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit 8fe1b94f31e5465687388c399a04e584ae8a4be0
Author: Jonathan Gallimore <jo...@jrg.me.uk>
AuthorDate: Tue May 28 14:09:05 2019 +0100

    Fix test
---
 .../java/org/apache/openejb/core/security/BasicJaccProviderTest.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/container/openejb-core/src/test/java/org/apache/openejb/core/security/BasicJaccProviderTest.java b/container/openejb-core/src/test/java/org/apache/openejb/core/security/BasicJaccProviderTest.java
index 2d9b387..451c105 100644
--- a/container/openejb-core/src/test/java/org/apache/openejb/core/security/BasicJaccProviderTest.java
+++ b/container/openejb-core/src/test/java/org/apache/openejb/core/security/BasicJaccProviderTest.java
@@ -33,7 +33,7 @@ import java.security.Policy;
 @ContainerProperties(
         @ContainerProperties.Property(
                 name = "javax.security.jacc.policy.provider",
-                value = "org.apache.openejb.core.security.BasicJaccProviderTest.MyPolicy"))
+                value = "org.apache.openejb.core.security.BasicJaccProviderTest$MyPolicy"))
 public class BasicJaccProviderTest {
 
     @EJB
@@ -41,6 +41,7 @@ public class BasicJaccProviderTest {
 
     @Test
     public void run() throws Exception {
+        Assert.assertNotNull("Singleton bean could not be created", myBean);
         Assert.assertEquals("tset", myBean.reverse("test"));
     }
 
@@ -67,4 +68,3 @@ public class BasicJaccProviderTest {
         }
     }
 }
-


[tomee] 05/07: Adding test

Posted by jg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jgallimore pushed a commit to branch tomee-7.1.x
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit 5a50e885cef581e12a4161a028f869aa86862fc2
Author: Jonathan Gallimore <jo...@jrg.me.uk>
AuthorDate: Tue May 28 13:02:09 2019 +0100

    Adding test
---
 .../core/security/BasicJaccProviderTest.java       | 44 ++++++++++++++++++----
 1 file changed, 36 insertions(+), 8 deletions(-)

diff --git a/container/openejb-core/src/test/java/org/apache/openejb/core/security/BasicJaccProviderTest.java b/container/openejb-core/src/test/java/org/apache/openejb/core/security/BasicJaccProviderTest.java
index c9d3ce6..2d9b387 100644
--- a/container/openejb-core/src/test/java/org/apache/openejb/core/security/BasicJaccProviderTest.java
+++ b/container/openejb-core/src/test/java/org/apache/openejb/core/security/BasicJaccProviderTest.java
@@ -16,27 +16,55 @@
  */
 package org.apache.openejb.core.security;
 
-import org.apache.openejb.core.security.jacc.BasicJaccProvider;
 import org.apache.openejb.junit.ApplicationComposer;
 import org.apache.openejb.testing.Classes;
 import org.apache.openejb.testing.ContainerProperties;
+import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import static org.junit.Assert.assertTrue;
+import javax.ejb.EJB;
+import javax.ejb.Singleton;
+import java.security.Policy;
 
-@Classes
+
+@Classes(innerClassesAsBean = true)
 @RunWith(ApplicationComposer.class)
 @ContainerProperties(
         @ContainerProperties.Property(
-                name = "org.apache.openejb.core.security.JaccProvider",
-                value = "org.apache.openejb.core.security.AbstractSecurityServiceTest$MyJaacProv"))
+                name = "javax.security.jacc.policy.provider",
+                value = "org.apache.openejb.core.security.BasicJaccProviderTest.MyPolicy"))
 public class BasicJaccProviderTest {
+
+    @EJB
+    private SimpleSingleton myBean;
+
     @Test
-    public void run() {
-        assertTrue(MyJaacProv.class.isInstance(JaccProvider.get()));
+    public void run() throws Exception {
+        Assert.assertEquals("tset", myBean.reverse("test"));
     }
 
-    public static class MyJaacProv extends BasicJaccProvider {
+    public static class MyPolicy extends Policy {
+    }
+
+    @Singleton
+    public static class SimpleSingleton {
+        public String reverse(final String input) {
+            if (input == null) {
+                return null;
+            }
+
+            if (input.length() == 0) {
+                return "";
+            }
+
+            char[] chars = new char[input.length()];
+            for (int i = 0; i < input.length(); i++) {
+                chars[i] = input.charAt((input.length() - 1) - i);
+            }
+
+            return new String(chars);
+        }
     }
 }
+


[tomee] 04/07: Adding test

Posted by jg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jgallimore pushed a commit to branch tomee-7.1.x
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit ed112485e74c1f6f6a12b06449e8ab0cbd29c00a
Author: Jonathan Gallimore <jo...@jrg.me.uk>
AuthorDate: Tue May 28 09:30:50 2019 +0100

    Adding test
---
 .../core/security/BasicJaccProviderTest.java       | 42 ++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/container/openejb-core/src/test/java/org/apache/openejb/core/security/BasicJaccProviderTest.java b/container/openejb-core/src/test/java/org/apache/openejb/core/security/BasicJaccProviderTest.java
new file mode 100644
index 0000000..c9d3ce6
--- /dev/null
+++ b/container/openejb-core/src/test/java/org/apache/openejb/core/security/BasicJaccProviderTest.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.openejb.core.security;
+
+import org.apache.openejb.core.security.jacc.BasicJaccProvider;
+import org.apache.openejb.junit.ApplicationComposer;
+import org.apache.openejb.testing.Classes;
+import org.apache.openejb.testing.ContainerProperties;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.assertTrue;
+
+@Classes
+@RunWith(ApplicationComposer.class)
+@ContainerProperties(
+        @ContainerProperties.Property(
+                name = "org.apache.openejb.core.security.JaccProvider",
+                value = "org.apache.openejb.core.security.AbstractSecurityServiceTest$MyJaacProv"))
+public class BasicJaccProviderTest {
+    @Test
+    public void run() {
+        assertTrue(MyJaacProv.class.isInstance(JaccProvider.get()));
+    }
+
+    public static class MyJaacProv extends BasicJaccProvider {
+    }
+}


[tomee] 01/07: For review; We shouldn't use javax.security.jacc.policy.provider here, because the System policy will already be set. We need to ensure that our policy provider is used, which will delegate to the system policy as appropriate

Posted by jg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jgallimore pushed a commit to branch tomee-7.1.x
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit c85ac3a5dec37fc62a95b04f81b704ec39193b30
Author: Jonathan Gallimore <jo...@jrg.me.uk>
AuthorDate: Wed May 22 11:15:59 2019 +0100

    For review; We shouldn't use javax.security.jacc.policy.provider here, because the System policy will already be set. We need to ensure that our policy provider is used, which will delegate to the system policy as appropriate
---
 .../java/org/apache/openejb/core/security/AbstractSecurityService.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/security/AbstractSecurityService.java b/container/openejb-core/src/main/java/org/apache/openejb/core/security/AbstractSecurityService.java
index 6ac1f41..82231a9 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/core/security/AbstractSecurityService.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/core/security/AbstractSecurityService.java
@@ -356,7 +356,7 @@ public abstract class AbstractSecurityService implements DestroyableResource, Se
             Thread.currentThread().setContextClassLoader(contextClassLoader);
         }
 
-        final String policyProvider = SystemInstance.get().getOptions().get("javax.security.jacc.policy.provider", JaccProvider.Policy.class.getName());
+        final String policyProvider = JaccProvider.Policy.class.getName();
         try {
             final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
             final Class policyClass = Class.forName(policyProvider, true, classLoader);


[tomee] 07/07: Merge remote-tracking branch 'apache/tomee-7.1.x' into tomee-7.1.x

Posted by jg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jgallimore pushed a commit to branch tomee-7.1.x
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit f8218b80bc5332e3aef8a08bbf86bb46b5b4d5df
Merge: 8fe1b94 e34a4d2
Author: Jonathan Gallimore <jo...@jrg.me.uk>
AuthorDate: Wed May 29 11:01:48 2019 +0100

    Merge remote-tracking branch 'apache/tomee-7.1.x' into tomee-7.1.x

 .../config/PersistenceContextAnnFactory.java       |  14 +-
 .../org/apache/openejb/core/TempClassLoader.java   |   6 +-
 .../openejb/core/cmp/cmp2/Cmp1Generator.java       |  10 +-
 .../openejb/core/cmp/cmp2/Cmp2Generator.java       |  12 +-
 .../org/apache/openejb/core/cmp/cmp2/CmpField.java |   2 +-
 .../org/apache/openejb/core/cmp/cmp2/CmrField.java |   2 +-
 .../org/apache/openejb/core/cmp/cmp2/CmrStyle.java |   2 +-
 .../openejb/core/cmp/cmp2/PostCreateGenerator.java |   8 +-
 .../org/apache/openejb/dyni/DynamicSubclass.java   |  20 +-
 .../org/apache/openejb/util/AnnotationFinder.java  |  16 +-
 .../openejb/util/proxy/LocalBeanProxyFactory.java  |  12 +-
 .../apache/openejb/DependenceValidationTest.java   |   4 +-
 .../java/org/apache/openejb/DependencyVisitor.java |  22 +-
 .../openejb/config/ServiceClasspathTest.java       |  16 +-
 .../config/rules/KeysAnnotationVisitor.java        |   8 +-
 .../config/rules/ValidationKeysAuditorTest.java    |   4 +-
 .../org/apache/openejb/core/cmp/jpa/JpaTest.java   |  14 +-
 docs/activemqresourceadapter-config.adoc           |  87 ++++
 docs/bmpentitycontainer-config.adoc                |  55 +++
 docs/cmpentitycontainer-config.adoc                |  53 ++
 docs/comparison.adoc                               | 231 +++++++++
 docs/datasource-config.adoc                        | 535 +++++++++++++++++++++
 docs/initialcontext-config.adoc                    |  44 ++
 docs/installation.adoc                             |  87 ++++
 docs/javamailsession-config.adoc                   |  44 ++
 docs/jmsconnectionfactory-config.adoc              | 104 ++++
 docs/managedcontainer-config.adoc                  |  44 ++
 docs/messagedrivencontainer-config.adoc            |  87 ++++
 docs/orb-config.adoc                               |  42 ++
 docs/proxyfactory-config.adoc                      |  44 ++
 docs/queue-config.adoc                             |  50 ++
 docs/securityservice-config.adoc                   |  52 ++
 docs/singletoncontainer-config.adoc                |  71 +++
 docs/statefulcontainer-config.adoc                 | 167 +++++++
 docs/statelesscontainer-config.adoc                | 445 +++++++++++++++++
 docs/tomee-maven-plugin.adoc                       | 178 +++++++
 docs/topic-config.adoc                             |  50 ++
 docs/transactionmanager-config.adoc                | 183 +++++++
 38 files changed, 2739 insertions(+), 86 deletions(-)