Security
authorMathieu Baudier <mbaudier@argeo.org>
Fri, 3 Jul 2009 17:00:57 +0000 (17:00 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Fri, 3 Jul 2009 17:00:57 +0000 (17:00 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@2693 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

17 files changed:
demo/site/org.argeo.slc.demo.ant/META-INF/MANIFEST.MF
demo/site/org.argeo.slc.demo.ant/conf/ant.xml
demo/site/org.argeo.slc.demo.ant/conf/imports.xml
demo/site/org.argeo.slc.demo.ant/conf/osgi.xml
demo/site/org.argeo.slc.demo.basic/META-INF/MANIFEST.MF
demo/site/org.argeo.slc.demo.basic/conf/imports.xml
demo/site/org.argeo.slc.demo.log4j/log4j.properties
demo/site/org.argeo.slc.demo.minimal/META-INF/MANIFEST.MF
modules/server/org.argeo.slc.webapp.war/META-INF/MANIFEST.MF
modules/server/org.argeo.slc.webapp.war/WEB-INF/security.xml
runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/DefaultExecutionSpec.java
runtime/org.argeo.slc.core/src/main/resources/org/argeo/slc/core/test/spring.xml [new file with mode: 0644]
runtime/org.argeo.slc.core/src/main/resources/org/argeo/slc/core/test/spring/applicationContext.xml
server/org.argeo.slc.ria/pom.xml
server/org.argeo.slc.ria/src/WEB-INF/applicationContext.xml [new file with mode: 0644]
server/org.argeo.slc.ria/src/WEB-INF/security.xml [new file with mode: 0644]
server/org.argeo.slc.ria/src/WEB-INF/web.xml

index fdc1904d372650c0cae40eb61ea5426ed98ecd3a..27a4ecff44632221711fd3778331042ce7250c00 100644 (file)
@@ -1,8 +1,4 @@
 Manifest-Version: 1.0\r
-Require-Bundle: org.argeo.slc.support.osgi,\r
- org.argeo.slc.specs,\r
- org.argeo.slc.core,\r
- org.argeo.slc.support.ant\r
 Bundle-Version: 0.11.4.SNAPSHOT\r
 Bundle-Name: SLC Demo Ant\r
 Bundle-Description: Demonstrate Ant support\r
@@ -13,6 +9,13 @@ Import-Package: net.sf.cglib.core,
  net.sf.cglib.reflect,\r
  org.aopalliance.aop,\r
  org.apache.commons.logging,\r
+ org.argeo.slc.ant,\r
+ org.argeo.slc.core.execution,\r
+ org.argeo.slc.core.execution.tasks,\r
+ org.argeo.slc.execution,\r
+ org.argeo.slc.osgi,\r
+ org.argeo.slc.osgi.execution,\r
+ org.argeo.slc.structure,\r
  org.springframework.aop,\r
  org.springframework.aop.framework,\r
  org.springframework.aop.scope,\r
index 826c185ed8b90ffc80bfccfd1ac27e33d6c08623..7985043dd368a68a1f227d496ada5a0a3f7b3abf 100644 (file)
@@ -7,7 +7,7 @@
        http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd\r
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">\r
 \r
-       <bean id="hello" parent="slcTemplate.simpleFlow">\r
+       <bean id="main" parent="slcTemplate.simpleFlow">\r
                <property name="executables">\r
                        <list>\r
                                <bean class="org.argeo.slc.ant.AntRun">\r
index 6bff52fb1dcdce99b64fdd9c869bd31b96d7b305..c5f6e3aceed8b385ec0216d2c92134b8e64357f1 100644 (file)
@@ -5,8 +5,4 @@
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
 
        <import resource="classpath:org/argeo/slc/core/execution/spring.xml" />
-
-       <import
-               resource="classpath:/org/argeo/slc/core/test/spring/applicationContext.xml" />
-
 </beans>
\ No newline at end of file
index a6f9740efab9b7db90a4f09da346455062f5787b..74b537da90f00aa429c11aad2032ff62be21f7ac 100644 (file)
@@ -7,8 +7,4 @@
        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
 \r
        <beans:import resource="classpath:org/argeo/slc/osgi/execution/spring.xml" />\r
-\r
-       <reference id="attachmentUploader" interface="org.argeo.slc.core.attachment.AttachmentUploader" />\r
-\r
-       <list id="resultListeners" interface="org.argeo.slc.core.test.tree.TreeTestResultListener" />\r
 </beans:beans>
\ No newline at end of file
index ee988146b13d0aa96273005e2777a570bdd1e403..f26a85e8dbca8fe749485e008e5ab2545deb9ea3 100644 (file)
@@ -4,11 +4,19 @@ Bundle-Version: 0.11.4.SNAPSHOT
 Bundle-Name: SLC Demo Basic\r
 Bundle-Description: Test of basic features\r
 Spring-Context: conf/*,conf/testCases/*\r
-Require-Bundle: \r
- org.argeo.slc.specs,\r
- org.argeo.slc.core,\r
- org.argeo.slc.support.osgi\r
 Import-Package: \r
+ org.argeo.slc.core.test,\r
+ org.argeo.slc.core.attachment,\r
+ org.argeo.slc.core.execution,\r
+ org.argeo.slc.core.execution.tasks,\r
+ org.argeo.slc.core.test.context,\r
+ org.argeo.slc.core.test.tree,\r
+ org.argeo.slc.core.structure.tree,\r
+ org.argeo.slc.test,\r
+ org.argeo.slc.execution,\r
+ org.argeo.slc.osgi,\r
+ org.argeo.slc.osgi.execution,\r
+ org.argeo.slc.structure,\r
  net.sf.cglib.core,\r
  net.sf.cglib.proxy,\r
  net.sf.cglib.reflect,\r
index 6bff52fb1dcdce99b64fdd9c869bd31b96d7b305..dc44a31c37e9d7a7e59e89d6188348bf1730e4b1 100644 (file)
@@ -6,7 +6,6 @@
 
        <import resource="classpath:org/argeo/slc/core/execution/spring.xml" />
 
-       <import
-               resource="classpath:/org/argeo/slc/core/test/spring/applicationContext.xml" />
+       <import resource="classpath:/org/argeo/slc/core/test/spring.xml" />
 
 </beans>
\ No newline at end of file
index 64433ee53dfc19e0af99bd268efeb23e5df72356..875e36cef584e2d49675059785c2451491f6213f 100644 (file)
@@ -13,7 +13,7 @@ log4j.logger.org.hibernate=WARN
 
 log4j.logger.org.springframework=WARN
 log4j.logger.org.springframework.jms=WARN
-log4j.logger.org.springframework.security=INFO
+log4j.logger.org.springframework.security=WARN
 
 log4j.logger.org.apache.activemq=WARN
 log4j.logger.org.apache.activemq.transport=WARN
index 4e59d7e4ad8736a5b424f1e48ad7c31a09763b61..ba406292b5caee3742620be4205c5e17578b4222 100644 (file)
@@ -4,16 +4,18 @@ Bundle-Version: 0.11.4.SNAPSHOT
 Bundle-Name: SLC Demo Minimal Module\r
 Bundle-Description: Minimal functioning execution module\r
 Spring-Context: slc/*\r
-Require-Bundle: \r
- org.argeo.slc.specs,\r
- org.argeo.slc.core,\r
- org.argeo.slc.support.osgi\r
 Import-Package: \r
  net.sf.cglib.core,\r
  net.sf.cglib.proxy,\r
  net.sf.cglib.reflect,\r
  org.aopalliance.aop,\r
  org.apache.commons.logging,\r
+ org.argeo.slc.core.execution,\r
+ org.argeo.slc.core.execution.tasks,\r
+ org.argeo.slc.execution,\r
+ org.argeo.slc.osgi,\r
+ org.argeo.slc.osgi.execution,\r
+ org.argeo.slc.structure,\r
  org.springframework.aop,\r
  org.springframework.aop.framework,\r
  org.springframework.aop.scope,\r
index bd110b5a9473d8d4bddda292a82b92e988967ed6..83da4bfa0492b8df3afce5ec8f242b4e4473851f 100644 (file)
@@ -47,4 +47,5 @@ Import-Package: net.sf.cglib.core,
  org.springframework.web.filter,\r
  org.springframework.web.servlet,\r
  org.springframework.web.servlet.handler,\r
- org.springframework.web.servlet.mvc\r
+ org.springframework.web.servlet.mvc,\r
+ org.springframework.security.context\r
index fbf7439ca2e8910b5d3b71f18b500212066ac173..457d698c9bbbf214d0ed25fb08a157d335d8f6b7 100644 (file)
@@ -3,8 +3,8 @@
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
               http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.4.xsd">
 
-       <http>
-               <intercept-url pattern="/**" access="ROLE_USER" />
+       <http realm="User Interface" >
+               <intercept-url pattern="/**" access="ROLE_USER,ROLE_ANONYMOUS" />
                <http-basic />
                <anonymous />
        </http>
index d9038197df2e2564d1135e1d93b1b114a359373b..1f66686f5680d89d47c85c32d74217e0c77c87fe 100644 (file)
@@ -79,7 +79,7 @@ public class DefaultExecutionSpec implements ExecutionSpec, BeanNameAware,
                                RefSpecAttribute rsa = (RefSpecAttribute) attr;
                                if (rsa.getChoices() == null) {
                                        List<RefValueChoice> choices = buildRefValueChoices(rsa);
-                                       if (log.isDebugEnabled())
+                                       if (log.isTraceEnabled())
                                                log.debug("Found " + choices.size() + " choices for "
                                                                + rsa + " in spec " + name);
 
diff --git a/runtime/org.argeo.slc.core/src/main/resources/org/argeo/slc/core/test/spring.xml b/runtime/org.argeo.slc.core/src/main/resources/org/argeo/slc/core/test/spring.xml
new file mode 100644 (file)
index 0000000..20c8214
--- /dev/null
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"
+    default-lazy-init="true">
+
+    <bean id="slcDefault.test.resultLogger"
+        class="org.argeo.slc.core.test.tree.TreeTestResultLogger">
+    </bean>
+
+    <bean name="slcDefault.test.testRun"
+        class="org.argeo.slc.core.test.SimpleTestRun"
+        scope="prototype">
+    </bean>
+
+    <bean name="slcDefault.test.uuid" class="java.util.UUID"
+        factory-method="randomUUID" scope="prototype">
+    </bean>
+
+    <bean id="slcDefault.test.basicTreeTestResult"
+        class="org.argeo.slc.core.test.tree.TreeTestResult"
+        abstract="true" destroy-method="close">
+        <property name="uuid">
+            <bean factory-bean="slcDefault.test.uuid"
+                factory-method="toString">
+            </bean>
+        </property>
+        <property name="listeners">
+            <list>
+                <ref bean="slcDefault.test.resultLogger" />
+            </list>
+        </property>
+    </bean>
+
+    <bean id="slcDefault.test.basicSimpleTestResult"
+        class="org.argeo.slc.core.test.SimpleTestResult"
+        abstract="true">
+        <property name="uuid">
+            <bean factory-bean="slcDefault.test.uuid"
+                factory-method="toString">
+            </bean>
+        </property>
+    </bean>
+
+</beans>
\ No newline at end of file
index 20c821401fc56ef375b24afc97fc2ac40158839c..d5e7e2cc2255946add5c10dcb0633aa2c6991522 100644 (file)
@@ -1,45 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns="http://www.springframework.org/schema/beans"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"
-    default-lazy-init="true">
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"
+       default-lazy-init="true">
 
-    <bean id="slcDefault.test.resultLogger"
-        class="org.argeo.slc.core.test.tree.TreeTestResultLogger">
-    </bean>
-
-    <bean name="slcDefault.test.testRun"
-        class="org.argeo.slc.core.test.SimpleTestRun"
-        scope="prototype">
-    </bean>
-
-    <bean name="slcDefault.test.uuid" class="java.util.UUID"
-        factory-method="randomUUID" scope="prototype">
-    </bean>
-
-    <bean id="slcDefault.test.basicTreeTestResult"
-        class="org.argeo.slc.core.test.tree.TreeTestResult"
-        abstract="true" destroy-method="close">
-        <property name="uuid">
-            <bean factory-bean="slcDefault.test.uuid"
-                factory-method="toString">
-            </bean>
-        </property>
-        <property name="listeners">
-            <list>
-                <ref bean="slcDefault.test.resultLogger" />
-            </list>
-        </property>
-    </bean>
-
-    <bean id="slcDefault.test.basicSimpleTestResult"
-        class="org.argeo.slc.core.test.SimpleTestResult"
-        abstract="true">
-        <property name="uuid">
-            <bean factory-bean="slcDefault.test.uuid"
-                factory-method="toString">
-            </bean>
-        </property>
-    </bean>
+       <description>Deprecated</description>
 
+       <import resource="../spring.xml" />
 </beans>
\ No newline at end of file
index da8dc1f54e2d79b013c0aefb957c67ef0fb1430c..9a42a88dedb38cc6b37a750394a5c4c579f840c6 100644 (file)
                                                        javax.servlet.jsp.jstl.core,
                                                        javax.servlet.jsp.jstl.fmt,
                                                        javax.servlet.jsp.jstl.tlv,
-                                                       javax.servlet.resources
+                                                       javax.servlet.resources,
+                                                       org.springframework.security.ui.webapp,
+                                                       org.springframework.security.userdetails.memory,
+                                                       org.springframework.web.context,
+                                                       org.springframework.osgi.web.context.support,
+                                                       org.springframework.web.filter
                                                </Import-Package>
                                                <Web-ContextPath>org.argeo.slc.ria</Web-ContextPath>
                                        </instructions>
diff --git a/server/org.argeo.slc.ria/src/WEB-INF/applicationContext.xml b/server/org.argeo.slc.ria/src/WEB-INF/applicationContext.xml
new file mode 100644 (file)
index 0000000..415bdc3
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
+       xmlns:tx="http://www.springframework.org/schema/tx"
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
+       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
+
+       <import resource="security.xml" />
+
+</beans>
\ No newline at end of file
diff --git a/server/org.argeo.slc.ria/src/WEB-INF/security.xml b/server/org.argeo.slc.ria/src/WEB-INF/security.xml
new file mode 100644 (file)
index 0000000..dcd6e8c
--- /dev/null
@@ -0,0 +1,20 @@
+<beans:beans xmlns="http://www.springframework.org/schema/security"
+       xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+              http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.4.xsd">
+
+       <http realm="User Interface">
+               <intercept-url pattern="/**" access="ROLE_USER" />
+               <http-basic />
+               <anonymous />
+       </http>
+
+       <authentication-provider>
+               <user-service>
+                       <user name="mbaudier" password="mbaudier" authorities="ROLE_USER,ROLE_ADMIN" />
+                       <user name="cdujeu" password="cdujeu" authorities="ROLE_USER" />
+                       <user name="test" password="test" authorities="ROLE_USER" />
+               </user-service>
+       </authentication-provider>
+
+</beans:beans>
index f46cd1782efed735ac3011737860ff46e7476e31..dc1ae6e70030db59fb916a9b045355fc3328754e 100644 (file)
@@ -4,4 +4,32 @@
        version="2.5">
 
        <display-name>SLC Web UI</display-name>
+
+       <!-- General -->
+       <context-param>
+               <param-name>contextConfigLocation</param-name>
+               <param-value>/WEB-INF/applicationContext.xml</param-value>
+       </context-param>
+
+       <listener>
+               <display-name>Spring Context</display-name>
+               <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+       </listener>
+       <context-param>
+               <param-name>contextClass</param-name>
+               <param-value>org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext</param-value>
+       </context-param>
+
+       <!--  Security -->
+       <filter>
+               <filter-name>springSecurityFilterChain</filter-name>
+               <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
+       </filter>
+
+       <filter-mapping>
+               <filter-name>springSecurityFilterChain</filter-name>
+               <url-pattern>/*</url-pattern>
+       </filter-mapping>
+
+
 </web-app>