feat(plugin): 新增 sa-token-spring-el 插件,用于支持 SpEL 表达式注解鉴权

This commit is contained in:
click33
2025-01-15 22:28:50 +08:00
parent 079376107a
commit b7b13fe4ed
16 changed files with 698 additions and 2 deletions

View File

@@ -0,0 +1,32 @@
/*
* Copyright 2020-2099 sa-token.cc
*
* 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.
*/
package cn.dev33.satoken.fun.strategy;
import java.util.Map;
import java.util.function.Consumer;
/**
* 函数式接口SaCheckELRootMap 扩展函数
*
* <p> 参数SaCheckELRootMap 对象 </p>
*
* @author click33
* @since 1.40.0
*/
@FunctionalInterface
public interface SaCheckELRootMapExtendFunction extends Consumer<Map<String, Object>> {
}

View File

@@ -17,6 +17,7 @@ package cn.dev33.satoken.strategy;
import cn.dev33.satoken.annotation.*;
import cn.dev33.satoken.annotation.handler.*;
import cn.dev33.satoken.fun.strategy.SaCheckELRootMapExtendFunction;
import cn.dev33.satoken.fun.strategy.SaCheckMethodAnnotationFunction;
import cn.dev33.satoken.fun.strategy.SaGetAnnotationFunction;
import cn.dev33.satoken.fun.strategy.SaIsAnnotationPresentFunction;
@@ -130,4 +131,13 @@ public final class SaAnnotationStrategy {
instance.getAnnotation.apply(method.getDeclaringClass(), annotationClass) != null;
};
/**
* SaCheckELRootMap 扩展函数
*/
public SaCheckELRootMapExtendFunction checkELRootMapExtendFunction = rootMap -> {
// 默认不做任何处理
};
}