Update servlet:xml:dms to use Spring 6

Issue gh-46
This commit is contained in:
Marcus Da Coregio 2021-12-10 13:38:35 -03:00
parent f4afba567a
commit 7d80162ab9
2 changed files with 29 additions and 39 deletions

View File

@ -9,8 +9,8 @@ repositories {
} }
dependencies { dependencies {
implementation platform("org.springframework.security:spring-security-bom:5.6.0-SNAPSHOT") implementation platform("org.springframework.security:spring-security-bom:6.0.0-SNAPSHOT")
implementation platform("org.springframework:spring-framework-bom:5.3.9") implementation platform("org.springframework:spring-framework-bom:6.0.0-SNAPSHOT")
implementation platform("org.junit:junit-bom:5.7.0") implementation platform("org.junit:junit-bom:5.7.0")
implementation 'org.springframework:spring-beans' implementation 'org.springframework:spring-beans'
@ -19,15 +19,17 @@ dependencies {
implementation "org.springframework.security:spring-security-acl" implementation "org.springframework.security:spring-security-acl"
implementation "org.springframework.security:spring-security-core" implementation "org.springframework.security:spring-security-core"
implementation "org.springframework.security:spring-security-config" implementation "org.springframework.security:spring-security-config"
implementation "org.thymeleaf:thymeleaf-spring5:3.0.11.RELEASE"
implementation 'javax.servlet:jstl:1.2'
implementation 'org.slf4j:slf4j-api:1.7.30' implementation 'org.slf4j:slf4j-api:1.7.30'
implementation 'org.slf4j:slf4j-simple:1.7.30' implementation 'org.slf4j:slf4j-simple:1.7.30'
providedCompile "jakarta.servlet:jakarta.servlet-api:5.0.0"
providedCompile "org.glassfish.web:jakarta.servlet.jsp.jstl:2.0.0"
runtimeOnly 'net.sf.ehcache:ehcache:2.10.5' runtimeOnly 'net.sf.ehcache:ehcache:2.10.5'
runtimeOnly 'org.hsqldb:hsqldb:2.5.0' runtimeOnly 'org.hsqldb:hsqldb:2.5.0'
runtimeOnly 'org.springframework:spring-context-support' runtimeOnly 'org.springframework:spring-context-support'
testImplementation 'org.mockito:mockito-core:3.12.4'
testImplementation "org.springframework:spring-test" testImplementation "org.springframework:spring-test"
testImplementation "org.springframework.security:spring-security-test" testImplementation "org.springframework.security:spring-security-test"
testImplementation("org.junit.jupiter:junit-jupiter-api") testImplementation("org.junit.jupiter:junit-jupiter-api")

View File

@ -62,23 +62,11 @@
<bean id="daoAuthenticationProvider" class="org.springframework.security.authentication.dao.DaoAuthenticationProvider"> <bean id="daoAuthenticationProvider" class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">
<property name="userDetailsService" ref="jdbcDaoImpl"/> <property name="userDetailsService" ref="jdbcDaoImpl"/>
<property name="userCache" ref="userCache"/>
<property name="passwordEncoder"> <property name="passwordEncoder">
<bean class="org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder"/> <bean class="org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder"/>
</property> </property>
</bean> </bean>
<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"/>
<bean id="userCacheBackend" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
<property name="cacheManager" ref="cacheManager"/>
<property name="cacheName" value="userCache"/>
</bean>
<bean id="userCache" class="org.springframework.security.core.userdetails.cache.EhCacheBasedUserCache">
<property name="cache" ref="userCacheBackend"/>
</bean>
<!-- Automatically receives AuthenticationEvent messages --> <!-- Automatically receives AuthenticationEvent messages -->
<bean id="loggerListener" class="org.springframework.security.authentication.event.LoggerListener"/> <bean id="loggerListener" class="org.springframework.security.authentication.event.LoggerListener"/>
@ -139,32 +127,32 @@
</bean> </bean>
<!-- ========= ACCESS CONTROL LIST LOOKUP MANAGER DEFINITIONS ========= --> <!-- ========= ACCESS CONTROL LIST LOOKUP MANAGER DEFINITIONS ========= -->
<bean id="cacheManager" class="org.springframework.cache.concurrent.ConcurrentMapCacheManager"/>
<bean id="userCacheBackend" class="org.springframework.cache.concurrent.ConcurrentMapCache">
<constructor-arg name="name" value="userCache"/>
</bean>
<bean id="aclCache" class="org.springframework.security.acls.domain.EhCacheBasedAclCache"> <bean id="aclCache" class="org.springframework.security.acls.domain.SpringCacheBasedAclCache">
<constructor-arg name="cache" ref="userCacheBackend"/>
<constructor-arg> <constructor-arg>
<bean class="org.springframework.cache.ehcache.EhCacheFactoryBean"> <bean class="org.springframework.security.acls.domain.DefaultPermissionGrantingStrategy">
<property name="cacheManager" ref="cacheManager"/> <constructor-arg>
<property name="cacheName" value="aclCache"/> <bean class="org.springframework.security.acls.domain.ConsoleAuditLogger"/>
</bean> </constructor-arg>
</bean>
</constructor-arg>
<constructor-arg>
<bean class="org.springframework.security.acls.domain.AclAuthorizationStrategyImpl">
<constructor-arg>
<list>
<bean class="org.springframework.security.core.authority.SimpleGrantedAuthority">
<constructor-arg value="ROLE_ACL_ADMIN"/>
</bean>
</list>
</constructor-arg>
</bean>
</constructor-arg> </constructor-arg>
<constructor-arg>
<bean class="org.springframework.security.acls.domain.DefaultPermissionGrantingStrategy">
<constructor-arg>
<bean class="org.springframework.security.acls.domain.ConsoleAuditLogger"/>
</constructor-arg>
</bean>
</constructor-arg>
<constructor-arg>
<bean class="org.springframework.security.acls.domain.AclAuthorizationStrategyImpl">
<constructor-arg>
<list>
<bean class="org.springframework.security.core.authority.SimpleGrantedAuthority">
<constructor-arg value="ROLE_ACL_ADMIN"/>
</bean>
</list>
</constructor-arg>
</bean>
</constructor-arg>
</bean> </bean>
<bean id="lookupStrategy" class="org.springframework.security.acls.jdbc.BasicLookupStrategy"> <bean id="lookupStrategy" class="org.springframework.security.acls.jdbc.BasicLookupStrategy">