From 3b30a64b8186c23ec95e7adf8b7c35997453a875 Mon Sep 17 00:00:00 2001 From: stylefeng Date: Sat, 3 Aug 2024 18:37:56 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=908.3.0=E3=80=91=E5=8D=87=E7=BA=A7mybati?= =?UTF-8?q?s-plus=E7=89=88=E6=9C=AC=EF=BC=8C=E7=A7=BB=E9=99=A4=E5=A4=B1?= =?UTF-8?q?=E6=95=88=E7=9A=84=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel-d-db/db-api/pom.xml | 2 +- .../mp/datascope/ProjectDataScopeHandler.java | 12 +- kernel-d-security/pom.xml | 1 - .../security-sdk-database-field/README.md | 23 --- .../security-sdk-database-field/pom.xml | 49 ------ .../algorithm/EncryptAlgorithmApi.java | 34 ----- .../impl/AesEncryptAlgorithmApiImpl.java | 29 ---- .../database/annotation/EncryptField.java | 19 --- .../database/annotation/ProtectedData.java | 18 --- .../database/annotation/ProtectedField.java | 19 --- .../interceptor/ParameterInterceptor.java | 90 ----------- .../interceptor/ResultInterceptor.java | 140 ------------------ .../security-spring-boot-starter/pom.xml | 7 - .../EncryptAlgorithmAutoConfiguration.java | 55 ------- kernel-d-wrapper/wrapper-sdk/pom.xml | 2 +- pom.xml | 4 +- 16 files changed, 10 insertions(+), 494 deletions(-) delete mode 100644 kernel-d-security/security-sdk-database-field/README.md delete mode 100644 kernel-d-security/security-sdk-database-field/pom.xml delete mode 100644 kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/algorithm/EncryptAlgorithmApi.java delete mode 100644 kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/algorithm/impl/AesEncryptAlgorithmApiImpl.java delete mode 100644 kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/annotation/EncryptField.java delete mode 100644 kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/annotation/ProtectedData.java delete mode 100644 kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/annotation/ProtectedField.java delete mode 100644 kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/interceptor/ParameterInterceptor.java delete mode 100644 kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/interceptor/ResultInterceptor.java delete mode 100644 kernel-d-security/security-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/security/starter/EncryptAlgorithmAutoConfiguration.java diff --git a/kernel-d-db/db-api/pom.xml b/kernel-d-db/db-api/pom.xml index 35520cef4..bddc6aa22 100644 --- a/kernel-d-db/db-api/pom.xml +++ b/kernel-d-db/db-api/pom.xml @@ -29,7 +29,7 @@ com.baomidou - mybatis-plus-boot-starter + mybatis-plus-spring-boot3-starter diff --git a/kernel-d-db/db-sdk-mp/src/main/java/cn/stylefeng/roses/kernel/db/mp/datascope/ProjectDataScopeHandler.java b/kernel-d-db/db-sdk-mp/src/main/java/cn/stylefeng/roses/kernel/db/mp/datascope/ProjectDataScopeHandler.java index 231c62e4c..61d5abd51 100644 --- a/kernel-d-db/db-sdk-mp/src/main/java/cn/stylefeng/roses/kernel/db/mp/datascope/ProjectDataScopeHandler.java +++ b/kernel-d-db/db-sdk-mp/src/main/java/cn/stylefeng/roses/kernel/db/mp/datascope/ProjectDataScopeHandler.java @@ -16,9 +16,9 @@ import net.sf.jsqlparser.expression.operators.relational.InExpression; import net.sf.jsqlparser.expression.operators.relational.LikeExpression; import net.sf.jsqlparser.schema.Column; import net.sf.jsqlparser.schema.Table; +import net.sf.jsqlparser.statement.select.LateralSubSelect; import net.sf.jsqlparser.statement.select.PlainSelect; -import net.sf.jsqlparser.statement.select.SelectExpressionItem; -import net.sf.jsqlparser.statement.select.SubSelect; +import net.sf.jsqlparser.statement.select.SelectItem; import java.util.stream.Collectors; @@ -202,7 +202,7 @@ public class ProjectDataScopeHandler implements MultiDataPermissionHandler { // 创建 IN 表达式 InExpression inExpression = new InExpression(); inExpression.setLeftExpression(orgIdColumn); - inExpression.setRightItemsList(expressionList); + inExpression.setRightExpression(expressionList); return inExpression; } @@ -220,9 +220,9 @@ public class ProjectDataScopeHandler implements MultiDataPermissionHandler { Column orgIdColumn = new Column(dataScopeConfig.getOrgIdFieldName()); // 创建子查询 select 部分 - SubSelect subSelect = new SubSelect(); + LateralSubSelect subSelect = new LateralSubSelect(); PlainSelect selectBody = new PlainSelect(); - selectBody.setSelectItems(ListUtil.of(new SelectExpressionItem(orgIdColumn))); + selectBody.setSelectItems(ListUtil.of(new SelectItem<>(orgIdColumn))); selectBody.setFromItem(new Table("sys_hr_organization")); // 创建 LIKE 表达式 @@ -240,7 +240,7 @@ public class ProjectDataScopeHandler implements MultiDataPermissionHandler { // 设置子查询的 WHERE 条件 selectBody.setWhere(orExpression); - subSelect.setSelectBody(selectBody); + subSelect.setSelect(selectBody); // 创建 IN 表达式 return new InExpression(orgIdColumn, subSelect); diff --git a/kernel-d-security/pom.xml b/kernel-d-security/pom.xml index 1716ea994..628466f3e 100644 --- a/kernel-d-security/pom.xml +++ b/kernel-d-security/pom.xml @@ -22,7 +22,6 @@ security-sdk-captcha security-sdk-clear-threadlocal security-sdk-count - security-sdk-database-field security-sdk-guomi security-sdk-request-encrypt-and-decode security-sdk-xss diff --git a/kernel-d-security/security-sdk-database-field/README.md b/kernel-d-security/security-sdk-database-field/README.md deleted file mode 100644 index d9cb6f9e9..000000000 --- a/kernel-d-security/security-sdk-database-field/README.md +++ /dev/null @@ -1,23 +0,0 @@ -数据库字段加解密工具 - -注意: - -1.数据库加密字段的类型为String类型 - -2.如果开启功能时数据库对应字段已经有数据,需要对旧数据进行处理,可以通过EncryptAlgorithmApi对字段进行加密 - -说明: - -1.通过mybatis的拦截器,对传入参数和返回结果进行处理 - -2.可以满足对某个数据库字段在入库时加密,在查询时解密的需求 - -3.同时也满足对某个数据库字段在入库时加密,查询时依旧显示密文,只有在需要的时候解密的需求 - -使用方法: - -1.给类添加ProtectedData注解,以标识该类需要进行加解密处理 - -2.在需要加解密的字段上面添加ProtectedField注解,即可实现在入库时加密,查询时解密的功能 - -3.如果不想在查询时解密,则在字段上添加EncryptField注解替换ProtectedField注解,即可实现在入库时该字段加密,查询时不解密的功能 diff --git a/kernel-d-security/security-sdk-database-field/pom.xml b/kernel-d-security/security-sdk-database-field/pom.xml deleted file mode 100644 index 50123da79..000000000 --- a/kernel-d-security/security-sdk-database-field/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - 4.0.0 - - - com.javaguns.roses - kernel-d-security - 8.3.0 - ../pom.xml - - - security-sdk-database-field - - jar - - - - - - com.javaguns.roses - security-api - ${roses.version} - - - - - com.javaguns.roses - scanner-api - ${roses.version} - - - - - org.springframework.boot - spring-boot-starter-web - - - - - com.javaguns.roses - db-api - ${roses.version} - - - - - diff --git a/kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/algorithm/EncryptAlgorithmApi.java b/kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/algorithm/EncryptAlgorithmApi.java deleted file mode 100644 index b1782f7f9..000000000 --- a/kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/algorithm/EncryptAlgorithmApi.java +++ /dev/null @@ -1,34 +0,0 @@ -package cn.stylefeng.roses.kernel.security.database.algorithm; - -import cn.hutool.crypto.symmetric.SymmetricCrypto; - -/** - * 加密算法接口 - *

- * 可根据自身需要自定义实现,默认实现为AES - * - * @author majianguo - * @since 2021/7/3 11:02 - */ -public interface EncryptAlgorithmApi { - - /** - * 加密算法 - * - * @param encryptedData 加密数据 - * @return {@link java.lang.String} - * @author majianguo - * @since 2021/7/3 11:07 - **/ - String encrypt(String encryptedData); - - /** - * 解密算法 - * - * @param cipher 待解密密文 - * @return {@link java.lang.String} - * @author majianguo - * @since 2021/7/3 11:33 - **/ - String decrypt(String cipher); -} diff --git a/kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/algorithm/impl/AesEncryptAlgorithmApiImpl.java b/kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/algorithm/impl/AesEncryptAlgorithmApiImpl.java deleted file mode 100644 index fcad4a10b..000000000 --- a/kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/algorithm/impl/AesEncryptAlgorithmApiImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package cn.stylefeng.roses.kernel.security.database.algorithm.impl; - -import cn.hutool.crypto.symmetric.SymmetricAlgorithm; -import cn.hutool.crypto.symmetric.SymmetricCrypto; -import cn.stylefeng.roses.kernel.security.api.expander.SecurityConfigExpander; -import cn.stylefeng.roses.kernel.security.database.algorithm.EncryptAlgorithmApi; - -import java.nio.charset.StandardCharsets; - -/** - * AES 加密解密实现 - * - * @author majianguo - * @since 2021/7/3 11:43 - */ -public class AesEncryptAlgorithmApiImpl implements EncryptAlgorithmApi { - - @Override - public String encrypt(String encryptedData) { - SymmetricCrypto symmetricCrypto = new SymmetricCrypto(SymmetricAlgorithm.AES, SecurityConfigExpander.getEncryptSecretKey().getBytes(StandardCharsets.UTF_8)); - return symmetricCrypto.encryptHex(encryptedData); - } - - @Override - public String decrypt(String cipher) { - SymmetricCrypto symmetricCrypto = new SymmetricCrypto(SymmetricAlgorithm.AES, SecurityConfigExpander.getEncryptSecretKey().getBytes(StandardCharsets.UTF_8)); - return symmetricCrypto.decryptStr(cipher); - } -} diff --git a/kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/annotation/EncryptField.java b/kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/annotation/EncryptField.java deleted file mode 100644 index 197385ead..000000000 --- a/kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/annotation/EncryptField.java +++ /dev/null @@ -1,19 +0,0 @@ -package cn.stylefeng.roses.kernel.security.database.annotation; - -import java.lang.annotation.*; - -/** - * 需要加密字段注解 - *

- * 该注解作用范围在字段上面(该类需要加 {@link ProtectedData} 注解) - * - * @author majianguo - * @since 2021/7/3 10:57 - */ -@Documented -@Inherited -@Target({ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface EncryptField { - -} diff --git a/kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/annotation/ProtectedData.java b/kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/annotation/ProtectedData.java deleted file mode 100644 index 7b7213f4a..000000000 --- a/kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/annotation/ProtectedData.java +++ /dev/null @@ -1,18 +0,0 @@ -package cn.stylefeng.roses.kernel.security.database.annotation; - -import java.lang.annotation.*; - -/** - * 被保护数据标识注解(标识那个DTO需要加解密) - *

- * 该注解作用范围在类上面 - * - * @author majianguo - * @since 2021/7/3 10:54 - */ -@Inherited -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -public @interface ProtectedData { - -} diff --git a/kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/annotation/ProtectedField.java b/kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/annotation/ProtectedField.java deleted file mode 100644 index 78135e7f7..000000000 --- a/kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/annotation/ProtectedField.java +++ /dev/null @@ -1,19 +0,0 @@ -package cn.stylefeng.roses.kernel.security.database.annotation; - -import java.lang.annotation.*; - -/** - * 需要加解密字段注解(该字段自动加解密,数据库是密文,查看时是明文) - *

- * 该注解作用范围在字段上面(该类需要加 {@link ProtectedData} 注解) - * - * @author majianguo - * @since 2021/7/5 9:18 - */ -@Documented -@Inherited -@Target({ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface ProtectedField { - -} diff --git a/kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/interceptor/ParameterInterceptor.java b/kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/interceptor/ParameterInterceptor.java deleted file mode 100644 index c36f15bcd..000000000 --- a/kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/interceptor/ParameterInterceptor.java +++ /dev/null @@ -1,90 +0,0 @@ -package cn.stylefeng.roses.kernel.security.database.interceptor; - -import cn.hutool.core.util.ObjectUtil; -import cn.stylefeng.roses.kernel.security.database.algorithm.EncryptAlgorithmApi; -import cn.stylefeng.roses.kernel.security.database.annotation.EncryptField; -import cn.stylefeng.roses.kernel.security.database.annotation.ProtectedData; -import cn.stylefeng.roses.kernel.security.database.annotation.ProtectedField; -import jakarta.annotation.Resource; -import lombok.extern.slf4j.Slf4j; -import org.apache.ibatis.executor.parameter.ParameterHandler; -import org.apache.ibatis.plugin.*; -import org.springframework.core.annotation.AnnotationUtils; -import org.springframework.stereotype.Component; - -import java.lang.reflect.Field; -import java.sql.PreparedStatement; -import java.util.Properties; - -/** - * Mybatis拦截器,拦截入库参数 - * - * @author majianguo - * @since 2021/7/3 11:58 - */ -@Slf4j -@Component -@Intercepts({@Signature(type = ParameterHandler.class, method = "setParameters", args = PreparedStatement.class),}) -public class ParameterInterceptor implements Interceptor { - - @Resource - private EncryptAlgorithmApi encryptAlgorithmApi; - - @Override - public Object intercept(Invocation invocation) throws Throwable { - - // 若指定ResultSetHandler ,这里则能强转为ResultSetHandler - ParameterHandler parameterHandler = (ParameterHandler) invocation.getTarget(); - - // 获取参数对像,即 mapper 中 paramsType 的实例 - Field parameterField = parameterHandler.getClass().getDeclaredField("parameterObject"); - parameterField.setAccessible(true); - - // 取出实例 - Object parameterObject = parameterField.get(parameterHandler); - if (parameterObject != null) { - Class parameterObjectClass = parameterObject.getClass(); - - // 校验该实例的类是否被@ProtectedData所注解 - ProtectedData protectedData = AnnotationUtils.findAnnotation(parameterObjectClass, ProtectedData.class); - if (ObjectUtil.isNotNull(protectedData)) { - - //取出当前当前类所有字段 - Field[] declaredFields = parameterObjectClass.getDeclaredFields(); - - // 处理需要加密的字段 - for (Field declaredField : declaredFields) { - - // 包含其中任意一个即可 - ProtectedField protectedField = declaredField.getAnnotation(ProtectedField.class); - EncryptField encryptField = declaredField.getAnnotation(EncryptField.class); - if (ObjectUtil.isNotNull(protectedField) || ObjectUtil.isNotNull(encryptField)) { - declaredField.setAccessible(true); - Object fieldData = declaredField.get(parameterObject); - // 如果是String就处理 - if (fieldData instanceof String) { - String value = (String) fieldData; - try { - String encrypt = encryptAlgorithmApi.encrypt(value); - declaredField.set(parameterObject, encrypt); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - } - } - } - return invocation.proceed(); - } - - @Override - public Object plugin(Object target) { - return Plugin.wrap(target, this); - } - - @Override - public void setProperties(Properties properties) { - - } -} diff --git a/kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/interceptor/ResultInterceptor.java b/kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/interceptor/ResultInterceptor.java deleted file mode 100644 index cdd876c6c..000000000 --- a/kernel-d-security/security-sdk-database-field/src/main/java/cn/stylefeng/roses/kernel/security/database/interceptor/ResultInterceptor.java +++ /dev/null @@ -1,140 +0,0 @@ -package cn.stylefeng.roses.kernel.security.database.interceptor; - -import cn.hutool.core.util.ObjectUtil; -import cn.stylefeng.roses.kernel.security.database.algorithm.EncryptAlgorithmApi; -import cn.stylefeng.roses.kernel.security.database.annotation.ProtectedData; -import cn.stylefeng.roses.kernel.security.database.annotation.ProtectedField; -import jakarta.annotation.Resource; -import lombok.extern.slf4j.Slf4j; -import org.apache.ibatis.executor.resultset.ResultSetHandler; -import org.apache.ibatis.plugin.*; -import org.springframework.core.annotation.AnnotationUtils; -import org.springframework.stereotype.Component; - -import java.lang.reflect.Field; -import java.sql.Statement; -import java.util.List; -import java.util.Objects; -import java.util.Properties; - -/** - * Mybatis拦截器,拦截返回参数 - * - * @author majianguo - * @since 2021/7/3 11:58 - */ -@Slf4j -@Component -@Intercepts({@Signature(type = ResultSetHandler.class, method = "handleResultSets", args = {Statement.class})}) -public class ResultInterceptor implements Interceptor { - - @Resource - private EncryptAlgorithmApi encryptAlgorithmApi; - - @Override - public Object intercept(Invocation invocation) throws Throwable { - - //取出查询的结果 - Object resultObject = invocation.proceed(); - if (Objects.isNull(resultObject)) { - return null; - } - - // 判断结果是List还是对象 - if (resultObject instanceof List) { - List resultList = (List) resultObject; - // 判断是否为空 - if (ObjectUtil.isNotNull(resultList)) { - // 处理数据 - for (Object result : resultList) { - // 对象处理 - this.objectProcessing(result); - } - } - } else { - // 处理单个对象 - this.objectProcessing(resultObject); - } - - return resultObject; - } - - /** - * 对象处理 - * - * @return - * @author majianguo - * @since 2021/7/5 9:52 - **/ - private void objectProcessing(Object result) throws IllegalAccessException { - - if (result == null) { - return; - } - - Class resultClass = result.getClass(); - // 是否加注解了 - ProtectedData annotation = AnnotationUtils.findAnnotation(resultClass, ProtectedData.class); - - // 加注解就去处理 - if (ObjectUtil.isNotNull(annotation)) { - Field[] declaredFields = resultClass.getDeclaredFields(); - for (Field field : declaredFields) { - // 处理字段 - this.fieldProcessing(result, field); - } - } - } - - /** - * @param result - * @param field - * @return - * @author majianguo - * @since 2021/7/5 9:52 - **/ - private void fieldProcessing(Object result, Field field) throws IllegalAccessException { - if (this.isTag(field)) { - field.setAccessible(true); - Object object = field.get(result); - //String的解密 - if (object instanceof String) { - String value = (String) object; - //对注解的字段进行逐一解密 - try { - String decrypt = encryptAlgorithmApi.decrypt(value); - field.set(result, decrypt); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - } - - /** - * 是否注解标记了 - * - * @param field 被判断字段 - * @return {@link boolean} - * @author majianguo - * @since 2021/7/5 9:35 - **/ - private boolean isTag(Field field) { - // 包含其中任意一个即可 - ProtectedField protectedField = field.getAnnotation(ProtectedField.class); - if (ObjectUtil.isNotNull(protectedField)) { - return true; - } - return false; - } - - @Override - public Object plugin(Object target) { - return Plugin.wrap(target, this); - } - - @Override - public void setProperties(Properties properties) { - - } -} diff --git a/kernel-d-security/security-spring-boot-starter/pom.xml b/kernel-d-security/security-spring-boot-starter/pom.xml index 0b85a5ed9..b4196b50d 100644 --- a/kernel-d-security/security-spring-boot-starter/pom.xml +++ b/kernel-d-security/security-spring-boot-starter/pom.xml @@ -45,13 +45,6 @@ ${roses.version} - - - com.javaguns.roses - security-sdk-database-field - ${roses.version} - - com.javaguns.roses diff --git a/kernel-d-security/security-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/security/starter/EncryptAlgorithmAutoConfiguration.java b/kernel-d-security/security-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/security/starter/EncryptAlgorithmAutoConfiguration.java deleted file mode 100644 index 5e0fb4520..000000000 --- a/kernel-d-security/security-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/security/starter/EncryptAlgorithmAutoConfiguration.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright [2020-2030] [https://www.stylefeng.cn] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: - * - * 1.请不要删除和修改根目录下的LICENSE文件。 - * 2.请不要删除和修改Guns源码头部的版权声明。 - * 3.请保留源码和相关描述文件的项目出处,作者声明等。 - * 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns - * 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns - * 6.若您的项目无法满足以上几点,可申请商业授权 - */ -package cn.stylefeng.roses.kernel.security.starter; - -import cn.stylefeng.roses.kernel.security.database.algorithm.EncryptAlgorithmApi; -import cn.stylefeng.roses.kernel.security.database.algorithm.impl.AesEncryptAlgorithmApiImpl; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -/** - * 加密算法自动配置 - * - * @author majianguo - * @since 2021/7/5 10:06 - */ -@Configuration -public class EncryptAlgorithmAutoConfiguration { - - /** - * 数据库加密算法 - * - * @return {@link cn.stylefeng.roses.kernel.security.database.algorithm.EncryptAlgorithmApi} - * @author majianguo - * @since 2021/7/5 10:16 - **/ - @Bean - @ConditionalOnMissingBean(EncryptAlgorithmApi.class) - public EncryptAlgorithmApi encryptAlgorithmApi() { - return new AesEncryptAlgorithmApiImpl(); - } - -} diff --git a/kernel-d-wrapper/wrapper-sdk/pom.xml b/kernel-d-wrapper/wrapper-sdk/pom.xml index 715795c86..e6d1e6616 100644 --- a/kernel-d-wrapper/wrapper-sdk/pom.xml +++ b/kernel-d-wrapper/wrapper-sdk/pom.xml @@ -43,7 +43,7 @@ com.baomidou - mybatis-plus-boot-starter + mybatis-plus-spring-boot3-starter diff --git a/pom.xml b/pom.xml index cfa0a2819..210b319a1 100644 --- a/pom.xml +++ b/pom.xml @@ -113,7 +113,7 @@ 5.8.29 2.0.52 1.18.34 - 3.5.3.1 + 3.5.7 8.0.33 1.2.22 0.9.1 @@ -171,7 +171,7 @@ com.baomidou - mybatis-plus-boot-starter + mybatis-plus-spring-boot3-starter ${mp.version}