|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<beans xmlns="http://www.springframework.org/schema/beans" |
| 3 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 4 | + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> |
| 5 | + |
| 6 | + <bean id="apiKeyFilter" class="com.mtt.api.security.ApiKeyAuthenticationFilter"/> |
| 7 | + |
| 8 | + <bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean" depends-on="apiKeyRepository"> |
| 9 | + <property name="securityManager" ref="securityManager"/> |
| 10 | + <property name="filterChainDefinitions"> |
| 11 | + <value> |
| 12 | + /api/tasks/** = noSessionCreation, apiKeyFilter |
| 13 | + </value> |
| 14 | + </property> |
| 15 | + </bean> |
| 16 | + |
| 17 | + <bean id="shiroCacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager"> |
| 18 | + <property name="cacheManager" ref="cacheManager"/> |
| 19 | + </bean> |
| 20 | + |
| 21 | + <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"> |
| 22 | + <property name="configLocation" value="classpath:/META-INF/ehcache.xml"/> |
| 23 | + </bean> |
| 24 | + |
| 25 | + <bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager"> |
| 26 | + <property name="realm" ref="platformRealm"/> |
| 27 | + <property name="cacheManager" ref="shiroCacheManager"/> |
| 28 | + </bean> |
| 29 | + |
| 30 | + <bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/> |
| 31 | + |
| 32 | + <bean id="platformRealm" class="com.mtt.api.security.PlatformRealm" depends-on="userRepository"> |
| 33 | + <property name="securityService" ref="securityServiceImpl"/> |
| 34 | + <property name="credentialsMatcher" ref="credentialsMatcher"/> |
| 35 | + <property name="authorizationCachingEnabled" value="${gumtree.api.security.cache.enabled:true}"/> |
| 36 | + </bean> |
| 37 | + |
| 38 | + <bean id="credentialsMatcher" class="org.apache.shiro.authc.credential.AllowAllCredentialsMatcher"/> |
| 39 | + |
| 40 | +<!-- <bean id="credentialsMatcher" class="org.apache.shiro.authc.credential.HashedCredentialsMatcher"> |
| 41 | + <property name="hashAlgorithmName" value="SHA-256"/> |
| 42 | + <property name="storedCredentialsHexEncoded" value="false"/> |
| 43 | + <property name="hashIterations" value="1024"/> |
| 44 | + </bean> |
| 45 | +--> |
| 46 | +</beans> |
0 commit comments