ci: shiro redisson version

This commit is contained in:
CaptainB 2024-02-29 15:36:59 +08:00 committed by 刘瑞斌
parent f545fb9ccb
commit f1981d1baa
4 changed files with 32 additions and 17 deletions

View File

@ -30,6 +30,26 @@
<version>${quartz-starter.version}</version> <version>${quartz-starter.version}</version>
</dependency> </dependency>
<!-- start shiro --> <!-- start shiro -->
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring-boot-web-starter</artifactId>
<version>${shiro.version}</version>
<classifier>jakarta</classifier>
<exclusions>
<exclusion>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring-boot-starter</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-web</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency> <dependency>
<groupId>org.apache.shiro</groupId> <groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring-boot-starter</artifactId> <artifactId>shiro-spring-boot-starter</artifactId>

View File

@ -1,13 +1,11 @@
package io.metersphere.system.config; package io.metersphere.system.config;
import io.metersphere.sdk.util.FilterChainUtils;
import io.metersphere.system.security.ApiKeyFilter; import io.metersphere.system.security.ApiKeyFilter;
import io.metersphere.system.security.CsrfFilter; import io.metersphere.system.security.CsrfFilter;
import io.metersphere.system.security.MsPermissionAnnotationMethodInterceptor; import io.metersphere.system.security.MsPermissionAnnotationMethodInterceptor;
import io.metersphere.system.security.realm.LocalRealm; import io.metersphere.system.security.realm.LocalRealm;
import io.metersphere.sdk.util.FilterChainUtils;
import jakarta.servlet.DispatcherType;
import jakarta.servlet.Filter;
import org.apache.shiro.aop.AnnotationResolver; import org.apache.shiro.aop.AnnotationResolver;
import org.apache.shiro.authz.aop.*; import org.apache.shiro.authz.aop.*;
import org.apache.shiro.cache.CacheManager; import org.apache.shiro.cache.CacheManager;
@ -22,12 +20,13 @@ import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
import org.apache.shiro.web.mgt.DefaultWebSecurityManager; import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
import org.apache.shiro.web.session.mgt.ServletContainerSessionManager; import org.apache.shiro.web.session.mgt.ServletContainerSessionManager;
import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator; import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn; import org.springframework.context.annotation.DependsOn;
import java.util.*; import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Configuration @Configuration
public class ShiroConfig { public class ShiroConfig {
@ -54,13 +53,6 @@ public class ShiroConfig {
return shiroFilterFactoryBean; return shiroFilterFactoryBean;
} }
@Bean(name = "shiroFilter")
public FilterRegistrationBean<Filter> shiroFilter(ShiroFilterFactoryBean shiroFilterFactoryBean) throws Exception {
FilterRegistrationBean<Filter> registration = new FilterRegistrationBean<>();
registration.setFilter((Filter) Objects.requireNonNull(shiroFilterFactoryBean.getObject()));
registration.setDispatcherTypes(EnumSet.allOf(DispatcherType.class));
return registration;
}
@Bean @Bean
public MemoryConstrainedCacheManager memoryConstrainedCacheManager() { public MemoryConstrainedCacheManager memoryConstrainedCacheManager() {

View File

@ -1,15 +1,15 @@
package io.metersphere.system.controller.handler; package io.metersphere.system.controller.handler;
import io.metersphere.sdk.exception.IResultCode; import io.metersphere.sdk.exception.IResultCode;
import io.metersphere.system.controller.handler.result.MsHttpResultCode;
import io.metersphere.sdk.exception.MSException; import io.metersphere.sdk.exception.MSException;
import io.metersphere.system.utils.ServiceUtils;
import io.metersphere.sdk.util.Translator; import io.metersphere.sdk.util.Translator;
import io.metersphere.system.controller.handler.result.MsHttpResultCode;
import io.metersphere.system.utils.ServiceUtils;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.ShiroException;
import org.apache.shiro.authz.UnauthorizedException; import org.apache.shiro.authz.UnauthorizedException;
import org.apache.shiro.lang.ShiroException;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.validation.FieldError; import org.springframework.validation.FieldError;
@ -51,6 +51,7 @@ public class RestControllerExceptionHandler {
/** /**
* http 状态码返回405 * http 状态码返回405
*
* @param exception 异常信息 * @param exception 异常信息
* @return * @return
*/ */
@ -96,6 +97,7 @@ public class RestControllerExceptionHandler {
/** /**
* 当抛出 NOT_FOUND拼接资源名称 * 当抛出 NOT_FOUND拼接资源名称
*
* @param message * @param message
* @return * @return
*/ */
@ -134,6 +136,7 @@ public class RestControllerExceptionHandler {
/** /**
* 格式化异常信息 * 格式化异常信息
* 当出现未知异常时将错误栈信息格式化返回 * 当出现未知异常时将错误栈信息格式化返回
*
* @param e * @param e
* @return * @return
*/ */

View File

@ -21,7 +21,7 @@
<revision>3.x</revision> <revision>3.x</revision>
<java.version>21</java.version> <java.version>21</java.version>
<platform-plugin-sdk.version>1.5.0</platform-plugin-sdk.version> <platform-plugin-sdk.version>1.5.0</platform-plugin-sdk.version>
<shiro.version>1.13.0</shiro.version> <shiro.version>2.0.0</shiro.version>
<java-websocket.version>1.5.4</java-websocket.version> <java-websocket.version>1.5.4</java-websocket.version>
<easyexcel.version>3.3.3</easyexcel.version> <easyexcel.version>3.3.3</easyexcel.version>
<dom4j.version>2.1.4</dom4j.version> <dom4j.version>2.1.4</dom4j.version>
@ -30,7 +30,7 @@
<metersphere-jmeter-functions.version>3.0</metersphere-jmeter-functions.version> <metersphere-jmeter-functions.version>3.0</metersphere-jmeter-functions.version>
<metersphere-jmeter-assertions.version>1.0.2</metersphere-jmeter-assertions.version> <metersphere-jmeter-assertions.version>1.0.2</metersphere-jmeter-assertions.version>
<quartz-starter.version>1.0.7</quartz-starter.version> <quartz-starter.version>1.0.7</quartz-starter.version>
<redisson-starter.version>3.27.0</redisson-starter.version> <redisson-starter.version>3.27.1</redisson-starter.version>
<mybatis-starter.version>3.0.3</mybatis-starter.version> <mybatis-starter.version>3.0.3</mybatis-starter.version>
<reflections.version>0.10.2</reflections.version> <reflections.version>0.10.2</reflections.version>
<commons-io.version>2.15.1</commons-io.version> <commons-io.version>2.15.1</commons-io.version>