Introduce security admin services
authorMathieu Baudier <mbaudier@argeo.org>
Thu, 17 Mar 2011 13:42:34 +0000 (13:42 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Thu, 17 Mar 2011 13:42:34 +0000 (13:42 +0000)
git-svn-id: https://svn.argeo.org/commons/trunk@4313 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

security/modules/org.argeo.security.services.admin/.project [new file with mode: 0644]
security/modules/org.argeo.security.services.admin/META-INF/MANIFEST.MF [new file with mode: 0644]
security/modules/org.argeo.security.services.admin/META-INF/spring/osgi.xml [new file with mode: 0644]
security/modules/org.argeo.security.services.admin/META-INF/spring/services.xml [new file with mode: 0644]
security/modules/org.argeo.security.services.admin/build.properties [new file with mode: 0644]

diff --git a/security/modules/org.argeo.security.services.admin/.project b/security/modules/org.argeo.security.services.admin/.project
new file mode 100644 (file)
index 0000000..fc06e31
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.argeo.security.services.admin</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+       </natures>
+</projectDescription>
diff --git a/security/modules/org.argeo.security.services.admin/META-INF/MANIFEST.MF b/security/modules/org.argeo.security.services.admin/META-INF/MANIFEST.MF
new file mode 100644 (file)
index 0000000..cfaa87b
--- /dev/null
@@ -0,0 +1,12 @@
+Bundle-SymbolicName: org.argeo.security.services.admin
+Bundle-Version: 0.2.3.SNAPSHOT
+Import-Package: org.argeo.security,
+ org.argeo.security.core,
+ org.springframework.beans.factory.config;specification-version="2.5.6.SEC01",
+ org.springframework.security;specification-version="2.0.4.A",
+ org.springframework.security.adapters;specification-version="2.0.6.RELEASE",
+ org.springframework.security.providers;specification-version="2.0.6.RELEASE",
+ org.springframework.security.providers.anonymous;specification-version="2.0.6.RELEASE",
+ org.springframework.security.providers.encoding;specification-version="2.0.6.RELEASE",
+ org.springframework.security.providers.rememberme;specification-version="2.0.6.RELEASE"
+Bundle-Name: Security Admin Services
diff --git a/security/modules/org.argeo.security.services.admin/META-INF/spring/osgi.xml b/security/modules/org.argeo.security.services.admin/META-INF/spring/osgi.xml
new file mode 100644 (file)
index 0000000..6822ed7
--- /dev/null
@@ -0,0 +1,30 @@
+<?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
+       <!-- REFERENCES -->\r
+       <reference id="passwordEncoder"\r
+               interface="org.springframework.security.providers.encoding.PasswordEncoder" />\r
+\r
+       <reference id="securityDao" interface="org.argeo.security.ArgeoSecurityDao" />\r
+\r
+       <list id="authenticationProviders"\r
+               interface="org.springframework.security.providers.AuthenticationProvider"\r
+               cardinality="0..N">\r
+               <listener ref="authenticationManager" bind-method="register"\r
+                       unbind-method="unregister" />\r
+       </list>\r
+\r
+       <!-- SERVICES -->\r
+<!--   <service ref="securityService" interface="org.argeo.security.ArgeoSecurityService" /> -->\r
+       <service ref="securityService" interface="org.argeo.security.CurrentUserService" />\r
+       <service ref="securityService" interface="org.argeo.security.UserAdminService" />\r
+       <service ref="systemExecutionService" interface="org.argeo.security.SystemExecutionService" />\r
+\r
+       <service ref="authenticationManager"\r
+               interface="org.springframework.security.AuthenticationManager" />\r
+</beans:beans>
\ No newline at end of file
diff --git a/security/modules/org.argeo.security.services.admin/META-INF/spring/services.xml b/security/modules/org.argeo.security.services.admin/META-INF/spring/services.xml
new file mode 100644 (file)
index 0000000..c602a6b
--- /dev/null
@@ -0,0 +1,48 @@
+<?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">
+
+       <bean
+               class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+               <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
+               <property name="locations">
+                       <value>osgibundle:security.properties
+                       </value>
+               </property>
+       </bean>
+
+       <bean id="securityService" class="org.argeo.security.core.DefaultSecurityService">
+               <property name="securityDao" ref="securityDao" />
+               <property name="passwordEncoder" ref="passwordEncoder" />
+               <property name="authenticationManager" ref="authenticationManager" />
+               <property name="systemAuthenticationKey" value="${argeo.security.systemKey}" />
+       </bean>
+
+       <bean id="systemExecutionService" class="org.argeo.security.core.KeyBasedSystemExecutionService">
+               <property name="authenticationManager" ref="authenticationManager" />
+               <property name="systemAuthenticationKey" value="${argeo.security.systemKey}" />
+       </bean>
+
+       <bean id="authenticationManager" class="org.argeo.security.core.ArgeoAuthenticationManager">
+               <property name="providers">
+                       <list>
+                               <bean class="org.springframework.security.adapters.AuthByAdapterProvider">
+                                       <property name="key" value="${argeo.security.systemKey}" />
+                               </bean>
+                               <bean
+                                       class="org.springframework.security.providers.anonymous.AnonymousAuthenticationProvider">
+                                       <property name="key" value="${argeo.security.systemKey}" />
+                               </bean>
+                       </list>
+               </property>
+       </bean>
+
+
+       <!-- <bean id="rememberMeAuthenticationProvider" -->
+       <!-- class="org.springframework.security.providers.rememberme.RememberMeAuthenticationProvider"> -->
+       <!-- <property name="key" value="${argeo.security.systemKey}" /> -->
+       <!-- </bean> -->
+
+</beans>
\ No newline at end of file
diff --git a/security/modules/org.argeo.security.services.admin/build.properties b/security/modules/org.argeo.security.services.admin/build.properties
new file mode 100644 (file)
index 0000000..5f22cdd
--- /dev/null
@@ -0,0 +1 @@
+bin.includes = META-INF/