Security structure
authorMathieu Baudier <mbaudier@argeo.org>
Tue, 15 Sep 2009 13:53:14 +0000 (13:53 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Tue, 15 Sep 2009 13:53:14 +0000 (13:53 +0000)
git-svn-id: https://svn.argeo.org/commons/trunk@2917 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

security/demo/pom.xml [new file with mode: 0644]
security/modules/org.argeo.security.webapp/META-INF/MANIFEST.MF [new file with mode: 0644]
security/modules/org.argeo.security.webapp/WEB-INF/applicationContext.xml [new file with mode: 0644]
security/modules/org.argeo.security.webapp/WEB-INF/osgi.xml [new file with mode: 0644]
security/modules/org.argeo.security.webapp/WEB-INF/security.xml [new file with mode: 0644]
security/modules/org.argeo.security.webapp/WEB-INF/web.xml [new file with mode: 0644]
security/modules/pom.xml [new file with mode: 0644]
security/pom.xml

diff --git a/security/demo/pom.xml b/security/demo/pom.xml
new file mode 100644 (file)
index 0000000..10fbcb5
--- /dev/null
@@ -0,0 +1,180 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+       <modelVersion>4.0.0</modelVersion>
+       <parent>
+               <groupId>org.argeo.commons</groupId>
+               <version>0.1.1-SNAPSHOT</version>
+               <artifactId>security</artifactId>
+               <relativePath>..</relativePath>
+       </parent>
+       <groupId>org.argeo.security</groupId>
+       <artifactId>demo</artifactId>
+       <packaging>bundles</packaging>
+       <name>Commons Security Demo</name>
+       <build>
+               <plugins>
+                       <plugin>
+                               <groupId>org.argeo.maven.plugins</groupId>
+                               <artifactId>maven-argeo-osgi-plugin</artifactId>
+                               <extensions>true</extensions>
+                               <configuration>
+                                       <bundlesPomArtifactId>org.argeo.security.demo</bundlesPomArtifactId>
+                               </configuration>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.argeo.maven.plugins</groupId>
+                               <artifactId>maven-argeo-osgi-plugin</artifactId>
+                               <configuration>
+                                       <execDir>target/exec/server</execDir>
+                                       <osgiBootArtifactId>org.argeo.osgi.boot</osgiBootArtifactId>
+                                       <systemProperties>
+                                               <slc.osgi.start>
+                                                       org.springframework.osgi.extender,
+                                                       org.springframework.osgi.web.extender,
+                                                       org.argeo.dep.osgi.catalina.start,
+                                                       org.argeo.server.security.webapp
+                                               </slc.osgi.start>
+                                               <slc.osgi.bundles>
+                                                       ${basedir};in=*;ex=pom.xml;ex=target;ex=.*,
+                                                       ${basedir}/../modules;in=*;ex=pom.xml;ex=target;ex=.*,
+                                               </slc.osgi.bundles>
+                                       </systemProperties>
+                               </configuration>
+                       </plugin>
+               </plugins>
+       </build>
+       <dependencies>
+               <!--  Third Parties -->
+
+               <!-- OSGi -->
+               <dependency>
+                       <groupId>org.eclipse.osgi</groupId>
+                       <artifactId>org.eclipse.osgi</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.argeo.commons.osgi</groupId>
+                       <artifactId>org.argeo.osgi.boot</artifactId>
+                       <version>0.1.1-SNAPSHOT</version>
+               </dependency>
+
+               <!-- Logging -->
+               <dependency>
+                       <groupId>org.slf4j</groupId>
+                       <artifactId>com.springsource.slf4j.org.apache.commons.logging</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.apache.log4j</groupId>
+                       <artifactId>com.springsource.org.apache.log4j</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.slf4j</groupId>
+                       <artifactId>com.springsource.slf4j.log4j</artifactId>
+               </dependency>
+
+               <!-- Spring -->
+               <dependency>
+                       <groupId>org.springframework.osgi</groupId>
+                       <artifactId>org.springframework.osgi.web.extender</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.springframework.osgi</groupId>
+                       <artifactId>org.springframework.osgi.extender</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.springframework.osgi</groupId>
+                       <artifactId>org.springframework.osgi.web</artifactId>
+               </dependency>
+
+               <!-- JEE -->
+               <dependency>
+                       <groupId>javax.servlet</groupId>
+                       <artifactId>com.springsource.javax.servlet</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>javax.annotation</groupId>
+                       <artifactId>com.springsource.javax.annotation</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>javax.persistence</groupId>
+                       <artifactId>com.springsource.javax.persistence</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>javax.activation</groupId>
+                       <artifactId>com.springsource.javax.activation</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.apache.geronimo.specs</groupId>
+                       <artifactId>com.springsource.javax.management.j2ee</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>javax.ejb</groupId>
+                       <artifactId>com.springsource.javax.ejb</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>javax.xml.rpc</groupId>
+                       <artifactId>com.springsource.javax.xml.rpc</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>javax.xml.soap</groupId>
+                       <artifactId>com.springsource.javax.xml.soap</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>javax.transaction</groupId>
+                       <artifactId>com.springsource.javax.transaction</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>javax.xml.stream</groupId>
+                       <artifactId>com.springsource.javax.xml.stream</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>javax.servlet</groupId>
+                       <artifactId>com.springsource.javax.servlet.jsp</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>javax.servlet</groupId>
+                       <artifactId>com.springsource.javax.servlet.jsp.jstl</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>javax.el</groupId>
+                       <artifactId>com.springsource.javax.el</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>javax.xml.ws</groupId>
+                       <artifactId>com.springsource.javax.xml.ws</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>javax.xml.bind</groupId>
+                       <artifactId>com.springsource.javax.xml.bind</artifactId>
+               </dependency>
+
+               <!-- Taglibs
+               <dependency>
+                       <groupId>org.apache.taglibs</groupId>
+                       <artifactId>com.springsource.org.apache.taglibs.standard</artifactId>
+               </dependency> -->
+
+
+               <!-- Tomcat -->
+               <dependency>
+                       <groupId>org.argeo.dep.osgi</groupId>
+                       <artifactId>org.argeo.dep.osgi.catalina.start</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.apache.catalina</groupId>
+                       <artifactId>com.springsource.org.apache.catalina</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.apache.jasper</groupId>
+                       <artifactId>com.springsource.org.apache.jasper</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.apache.el</groupId>
+                       <artifactId>com.springsource.org.apache.el</artifactId>
+               </dependency>
+
+               <!--
+                       ActiveMQ <dependency> <groupId>org.argeo.dep.osgi</groupId>
+                       <artifactId>org.argeo.dep.osgi.activemq</artifactId> </dependency>
+               -->
+       </dependencies>
+</project>
\ No newline at end of file
diff --git a/security/modules/org.argeo.security.webapp/META-INF/MANIFEST.MF b/security/modules/org.argeo.security.webapp/META-INF/MANIFEST.MF
new file mode 100644 (file)
index 0000000..e17384c
--- /dev/null
@@ -0,0 +1,6 @@
+Web-ContextPath: org.argeo.security.webapp
+Bundle-SymbolicName: org.argeo.security.webapp
+Bundle-Version: 0.1.1.SNAPSHOT
+Import-Package: javax.servlet,
+ javax.servlet.http,
+ javax.servlet.resources
diff --git a/security/modules/org.argeo.security.webapp/WEB-INF/applicationContext.xml b/security/modules/org.argeo.security.webapp/WEB-INF/applicationContext.xml
new file mode 100644 (file)
index 0000000..2ad009d
--- /dev/null
@@ -0,0 +1,24 @@
+<?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="classpath:/org/argeo/slc/server/spring/jmx.xml" />
+       -->
+       <import resource="security.xml" />
+
+       <import resource="osgi.xml" />
+
+       <!--  Properties -->
+       <bean
+               class="org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer"
+               lazy-init="false">
+               <property name="contextOverride" value="true" />
+               <property name="ignoreUnresolvablePlaceholders" value="true" />
+       </bean>
+</beans>
\ No newline at end of file
diff --git a/security/modules/org.argeo.security.webapp/WEB-INF/osgi.xml b/security/modules/org.argeo.security.webapp/WEB-INF/osgi.xml
new file mode 100644 (file)
index 0000000..1b46c0e
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
+       xsi:schemaLocation="http://www.springframework.org/schema/osgi  \r
+       http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
+       http://www.springframework.org/schema/beans   \r
+       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
+\r
+</beans:beans>
\ No newline at end of file
diff --git a/security/modules/org.argeo.security.webapp/WEB-INF/security.xml b/security/modules/org.argeo.security.webapp/WEB-INF/security.xml
new file mode 100644 (file)
index 0000000..35397ad
--- /dev/null
@@ -0,0 +1,21 @@
+<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,ROLE_ADMIN" />
+               <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 name="demo" password="demo" authorities="ROLE_USER" />
+               </user-service>
+       </authentication-provider>
+
+</beans:beans>
diff --git a/security/modules/org.argeo.security.webapp/WEB-INF/web.xml b/security/modules/org.argeo.security.webapp/WEB-INF/web.xml
new file mode 100644 (file)
index 0000000..1ea484f
--- /dev/null
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+       version="2.5">
+
+       <display-name>Argeo Security Web Application</display-name>
+
+       <!-- SECURITY servlet -->
+       <servlet>
+               <servlet-name>security</servlet-name>
+               <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+               <init-param>
+                       <param-name>contextClass</param-name>
+                       <param-value>org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext</param-value>
+               </init-param>
+               <load-on-startup>1</load-on-startup>
+       </servlet>
+       <servlet-mapping>
+               <servlet-name>security</servlet-name>
+               <url-pattern>*.security</url-pattern>
+       </servlet-mapping>
+
+       <!-- 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>
diff --git a/security/modules/pom.xml b/security/modules/pom.xml
new file mode 100644 (file)
index 0000000..a435223
--- /dev/null
@@ -0,0 +1,25 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+       <modelVersion>4.0.0</modelVersion>
+       <parent>
+               <groupId>org.argeo.commons</groupId>
+               <version>0.1.1-SNAPSHOT</version>
+               <artifactId>server</artifactId>
+               <relativePath>..</relativePath>
+       </parent>
+       <groupId>org.argeo.security</groupId>
+       <artifactId>modules</artifactId>
+       <packaging>bundles</packaging>
+       <name>Commons Server Modules</name>
+       <build>
+               <plugins>
+                       <plugin>
+                               <groupId>org.argeo.maven.plugins</groupId>
+                               <artifactId>maven-argeo-osgi-plugin</artifactId>
+                               <extensions>true</extensions>
+                               <configuration>
+                                       <bundlesPomArtifactId>org.argeo.security.modules</bundlesPomArtifactId>
+                               </configuration>
+                       </plugin>
+               </plugins>
+       </build>
+</project>
\ No newline at end of file
index 01cb721b842d16dc0f8fecba98a3756a163f52ff..e644ebec0f0b5bfd995c1102eeb28f2a209ebb41 100644 (file)
@@ -13,5 +13,7 @@
        <packaging>pom</packaging>
        <modules>
                <module>runtime</module>
+               <module>modules</module>
+               <module>demo</module>
        </modules>
 </project>
\ No newline at end of file