+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-
- <hibernate-mapping>
-
- <class name="org.wamblee.security.authorization.AbstractAuthorizationRule"
- table="AUTHORIZATION_RULES"
- select-before-update="true"
- lazy="false">
- <id name="primaryKey" column="ID" type="long">
- <generator class="native"/>
- </id>
- <discriminator column="TYPE" type="string"/>
- <version name="persistedVersion" column="VERSION"/>
-
- <subclass name="org.wamblee.security.authorization.UrlAuthorizationRule"
- discriminator-value="ISINGROUP"
- lazy="false">
- <property name="authorizationResultString" column="RESULT"/>
- <property name="resourceClassName" column="RESOURCE_CLASSNAME"/>
- <many-to-one name="userCondition"
- class="org.wamblee.security.authorization.AbstractUserCondition"
- column="USERCONDITION_ID"
- cascade="all"
- lazy="false"/>
- <many-to-one name="pathCondition"
- class="org.wamblee.security.authorization.AbstractPathCondition"
- column="PATHCONDITION_ID"
- cascade="all"
- lazy="false"/>
- <many-to-one name="operationCondition"
- class="org.wamblee.security.authorization.AbstractOperationCondition"
- column="OPERATIONCONDITION_ID"
- cascade="all"
- lazy="false"/>
- </subclass>
-
- </class>
-
-
- </hibernate-mapping>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-
- <hibernate-mapping>
-
- <class name="org.wamblee.security.authorization.AbstractAuthorizationService" table="AUTHORIZATION_SERVICE"
- select-before-update="true">
- <id name="primaryKey" column="ID" type="long">
- <generator class="native"/>
- </id>
- <discriminator column="TYPE" type="string"/>
- <version name="persistedVersion" column="VERSION"/>
-
- <subclass name="org.wamblee.security.authorization.DefaultAuthorizationService"
- discriminator-value="DEFAULT">
-
- <property name="name" column="NAME"/>
-
- <list name="mappedRules" table="AUTHORIZATION_SERVICE_RULES" lazy="false" cascade="all-delete-orphan">
- <key column="ID"/>
- <index column="POSITION"/>
- <many-to-many class="org.wamblee.security.authorization.AbstractAuthorizationRule"
- column="RULE_ID"/>
- </list>
- </subclass>
-
- </class>
-
- <query name="findAuthorizationServiceByName">
- select service
- from org.wamblee.security.authorization.AbstractAuthorizationService service
- where service.name = :name
- </query>
-
- </hibernate-mapping>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-
-<hibernate-mapping>
-
- <class name="org.wamblee.usermgt.Group" table="GROUPS" select-before-update="true">
- <id name="primaryKey" column="ID" type="long">
- <generator class="native"/>
- </id>
- <version name="persistedVersion" column="VERSION"/>
- <property name="name" column="NAME" unique="true"/>
- </class>
-
- <query name="findGroupByName">
- from org.wamblee.usermgt.Group grp where grp.name = :name
- </query>
-
- <query name="countGroups">
- select count(*)
- from org.wamblee.usermgt.Group group
- </query>
-
-</hibernate-mapping>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-
- <hibernate-mapping>
-
- <class name="org.wamblee.security.authorization.AbstractOperationCondition" table="OPERATION_CONDITIONS"
- select-before-update="true"
- lazy="false">
- <id name="primaryKey" column="ID" type="long">
- <generator class="native"/>
- </id>
- <discriminator column="TYPE" type="string"/>
- <version name="persistedVersion" column="VERSION"/>
-
- <subclass name="org.wamblee.security.authorization.IsaOperationCondition"
- discriminator-value="ISA"
- lazy="false">
- <property name="operationString" column="OPERATION"/>
- </subclass>
-
- </class>
-
-
- </hibernate-mapping>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-
- <hibernate-mapping>
-
- <class name="org.wamblee.security.authorization.AbstractPathCondition" table="PATH_CONDITIONS"
- select-before-update="true"
- lazy="false">
- <id name="primaryKey" column="ID" type="long">
- <generator class="native"/>
- </id>
- <discriminator column="TYPE" type="string"/>
- <version name="persistedVersion" column="VERSION"/>
-
- <subclass name="org.wamblee.security.authorization.StartsWithPathCondition"
- discriminator-value="STARTS_WITH"
- lazy="false">
- <property name="path" column="PATH"/>
- </subclass>
-
- </class>
-
-
- </hibernate-mapping>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-
- <hibernate-mapping>
-
- <class name="org.wamblee.security.authorization.AbstractPathCondition" table="PATH_CONDITIONS"
- select-before-update="true"
- lazy="false">
- <id name="primaryKey" column="ID" type="long">
- <generator class="native"/>
- </id>
- <discriminator column="TYPE" type="string"/>
- <version name="persistedVersion" column="VERSION"/>
-
- <subclass name="org.wamblee.security.authorization.RegexpPathCondition"
- discriminator-value="REGEXP"
- lazy="false">
- <property name="pattern" column="PATTERN"/>
-
- <subclass name="org.wamblee.security.authorization.StartsWithPathCondition"
- discriminator-value="STARTS_WITH"
- lazy="false">
- </subclass>
-
- </subclass>
-
- </class>
-
-
- </hibernate-mapping>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-
- <hibernate-mapping>
- <subclass name="org.wamblee.security.authorization.TestAuthorizationRule"
- extends="org.wamblee.security.authorization.UrlAuthorizationRule"
- discriminator-value="TEST"
- lazy="false"/>
-
- </hibernate-mapping>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-
-<hibernate-mapping>
-
-
- <class name="org.wamblee.usermgt.User" table="USERS" select-before-update="true">
- <id name="primaryKey" column="ID" type="long">
- <generator class="native"/>
- </id>
- <version name="persistedVersion" column="VERSION"/>
- <property name="name" column="NAME" unique="true"/>
- <property name="passwordString" column="PASSWORD"/>
- <set name="groupSet" table="USER_GROUPS" lazy="false">
- <key column="USER_ID"/>
- <many-to-many class="org.wamblee.usermgt.Group" column="GROUP_ID"/>
- </set>
- </class>
-
- <query name="findUserByName">
- from org.wamblee.usermgt.User user where user.name = :name
- </query>
-
- <query name="findUserByGroupName">
- select user
- from org.wamblee.usermgt.User user
- join user.groupSet grp
- where grp.name = :name
- </query>
-
- <query name="countUsers">
- select count(*)
- from org.wamblee.usermgt.User user
- </query>
-
-
-</hibernate-mapping>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-
- <hibernate-mapping>
-
- <class name="org.wamblee.security.authorization.AbstractUserCondition" table="USER_CONDITIONS"
- select-before-update="true"
- lazy="false">
- <id name="primaryKey" column="ID" type="long">
- <generator class="native"/>
- </id>
- <discriminator column="TYPE" type="string"/>
- <version name="persistedVersion" column="VERSION"/>
-
- <subclass name="org.wamblee.security.authorization.GroupUserCondition"
- discriminator-value="URL"
- lazy="false">
- <property name="group" column="GROUPNAME"/>
- </subclass>
-
- <subclass name="org.wamblee.security.authorization.AnyUserCondition"
- discriminator-value="ANY"
- lazy="false">
- </subclass>
-
- </class>
-
-
- </hibernate-mapping>
\ No newline at end of file
+++ /dev/null
-<ehcache>
-
- <!-- Sets the path to the directory where cache .data files are created.
-
- If the path is a Java System Property it is replaced by
- its value in the running VM.
-
- The following properties are translated:
- user.home - User's home directory
- user.dir - User's current working directory
- java.io.tmpdir - Default temp file path -->
- <diskStore path="java.io.tmpdir"/>
-
-
- <!--Default Cache configuration. These will applied to caches programmatically created through
- the CacheManager.
-
- The following attributes are required:
-
- maxElementsInMemory - Sets the maximum number of objects that will be created in memory
- eternal - Sets whether elements are eternal. If eternal, timeouts are ignored and the
- element is never expired.
- overflowToDisk - Sets whether elements can overflow to disk when the in-memory cache
- has reached the maxInMemory limit.
-
- The following attributes are optional:
- timeToIdleSeconds - Sets the time to idle for an element before it expires.
- i.e. The maximum amount of time between accesses before an element expires
- Is only used if the element is not eternal.
- Optional attribute. A value of 0 means that an Element can idle for infinity.
- The default value is 0.
- timeToLiveSeconds - Sets the time to live for an element before it expires.
- i.e. The maximum time between creation time and when an element expires.
- Is only used if the element is not eternal.
- Optional attribute. A value of 0 means that and Element can live for infinity.
- The default value is 0.
- diskPersistent - Whether the disk store persists between restarts of the Virtual Machine.
- The default value is false.
- diskExpiryThreadIntervalSeconds- The number of seconds between runs of the disk expiry thread. The default value
- is 120 seconds.
- -->
-
- <defaultCache
- maxElementsInMemory="10000"
- eternal="false"
- overflowToDisk="false"
- timeToIdleSeconds="120"
- timeToLiveSeconds="120"
- diskPersistent="false"
- diskExpiryThreadIntervalSeconds="120"
- />
-
- <cache
- name="users"
- maxElementsInMemory="10000"
- eternal="false"
- overflowToDisk="false"
- timeToIdleSeconds="120"
- timeToLiveSeconds="120"
- diskPersistent="false"
- diskExpiryThreadIntervalSeconds="120"
- />
-
- <cache
- name="photos"
- maxElementsInMemory="1000"
- eternal="false"
- overflowToDisk="false"
- timeToIdleSeconds="120"
- timeToLiveSeconds="120"
- diskPersistent="false"
- diskExpiryThreadIntervalSeconds="120"
- />
-
-</ehcache>
+++ /dev/null
-
-###################################################################################
-# dialect
-###################################################################################
-hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
-
-###################################################################################
-# debugging settings: Log4j configuration can provide more detail.
-###################################################################################
-hibernate.show_sql=false
-
-###################################################################################
-# hibernate cache provider
-###################################################################################
-hibernate.cache.provider=org.hibernate.cache.EhCacheProvider
-
-###################################################################################
-# query cache
-###################################################################################
-hibernate.cache.use_query_cache=true
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
-
-<beans>
-
- <bean id="org.wamblee.security.authorization.OperationRegistry"
- class="org.wamblee.security.authorization.DefaultOperationRegistry">
- <constructor-arg>
- <list>
- <bean class="org.wamblee.security.authorization.AllOperation"/>
- <bean class="org.wamblee.security.authorization.CreateOperation"/>
- <bean class="org.wamblee.security.authorization.DeleteOperation"/>
- <bean class="org.wamblee.security.authorization.ReadOperation"/>
- <bean class="org.wamblee.security.authorization.WriteOperation"/>
- </list>
- </constructor-arg>
- </bean>
-
- <bean id="org.wamblee.security.authorization.AbstractAuthorizationService"
- class="org.wamblee.security.authorization.hibernate.PersistentAuthorizationService">
- <constructor-arg><value>DEFAULT</value></constructor-arg>
- <constructor-arg><ref bean="org.springframework.orm.hibernate3.HibernateTemplate"/></constructor-arg>
- <constructor-arg><ref bean="org.wamblee.usermgt.UserAccessor"/></constructor-arg>
- <constructor-arg><value type="long">10000</value></constructor-arg>
- </bean>
-
- <!-- any user -->
- <bean id="anyUserCondition" class="org.wamblee.security.authorization.AnyUserCondition">
- </bean>
-
- <!-- administrators -->
- <bean id="adminUserCondition" class="org.wamblee.security.authorization.GroupUserCondition">
- <constructor-arg><value>administrators</value></constructor-arg>
- </bean>
-
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
-
- <beans>
-
- <bean id="cacheConfig" class="org.wamblee.io.ClassPathResource">
- <constructor-arg><value>properties/org.wamblee.security.ehcache.xml</value></constructor-arg>
- </bean>
-
- <bean id="userCache" class="org.wamblee.cache.EhCache">
- <constructor-arg><ref local="cacheConfig"/></constructor-arg>
- <constructor-arg><value>users</value></constructor-arg>
- </bean>
-
-
- <bean id="passwordValidator"
- class="org.wamblee.usermgt.RegexpNameValidator">
- <constructor-arg><value>.{5,}</value></constructor-arg>
- <constructor-arg><value>INVALID_PASSWORD</value></constructor-arg>
- <constructor-arg><value>Password must have at least 5 characters</value></constructor-arg>
- </bean>
-
- <bean id="passwordDigester"
- class="org.wamblee.security.encryption.Md5HexMessageDigester">
- </bean>
-
- <bean id="org.wamblee.usermgt.UserSet"
- class="org.wamblee.usermgt.hibernate.HibernateUserSet">
- <constructor-arg><ref local="userCache"/></constructor-arg>
- <constructor-arg><ref local="passwordValidator"/></constructor-arg>
- <constructor-arg><ref local="passwordDigester"/></constructor-arg>
-
- <property name="sessionFactory"><ref bean="sessionFactory"/></property>
-
- </bean>
-
- <bean id="org.wamblee.usermgt.GroupSet"
- class="org.wamblee.usermgt.hibernate.HibernateGroupSet">
-
- <property name="sessionFactory"><ref bean="sessionFactory"/></property>
- </bean>
-
- </beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
-
- <beans>
-
- <bean id="org.wamblee.usermgt.UserAdministration-target"
- class="org.wamblee.usermgt.UserAdministrationImpl">
-
- <constructor-arg>
- <ref bean="org.wamblee.usermgt.UserSet"/>
- </constructor-arg>
-
- <constructor-arg>
- <ref bean="org.wamblee.usermgt.GroupSet"/>
- </constructor-arg>
-
- <constructor-arg>
- <bean class="org.wamblee.usermgt.RegexpNameValidator">
- <constructor-arg><value>[a-zA-Z]+[a-zA-Z0-9]*</value></constructor-arg>
- <constructor-arg><value>INVALID_USERNAME</value></constructor-arg>
- <constructor-arg><value></value></constructor-arg>
- </bean>
- </constructor-arg>
-
- <constructor-arg>
- <bean class="org.wamblee.usermgt.RegexpNameValidator">
- <constructor-arg><value>[a-zA-Z]+[a-zA-Z0-9]*</value></constructor-arg>
- <constructor-arg><value>INVALID_GROUPNAME</value></constructor-arg>
- <constructor-arg><value></value></constructor-arg>
- </bean>
- </constructor-arg>
-
- </bean>
-
- <bean id="usermanagement-lock" class="org.wamblee.concurrency.JvmLock"/>
-
- <bean id="usermanagement-lock-advice" class="org.wamblee.concurrency.spring.LockAdvice">
- <constructor-arg><ref bean="usermanagement-lock"/></constructor-arg>
- </bean>
-
- <bean id="org.wamblee.usermgt.UserAdministration"
- class="org.springframework.aop.framework.ProxyFactoryBean">
- <property name="proxyInterfaces"><value>org.wamblee.usermgt.UserAdministration</value></property>
- <property name="interceptorNames"><value>usermanagement-lock-advice</value></property>
- <property name="target"><ref bean="org.wamblee.usermgt.UserAdministration-target"/></property>
- </bean>
-
- </beans>
\ No newline at end of file