fix: 更新网关Filter白名单路径,适配/fund前缀
修改文件: - TenantGatewayFilter.java: 白名单路径添加/fund前缀 - TokenAuthFilter.java: 白名单路径添加/fund前缀 白名单路径变更: - 旧: /sys/api/v1/auth/login - 新: /fund/sys/auth/login 说明: - Filter在网关层执行,使用原始请求路径(含/fund前缀) - StripPrefix在Filter之后执行,转发时才剥离前缀
This commit is contained in:
parent
797feff8c2
commit
92d8234fcb
@ -38,18 +38,19 @@ public class TenantGatewayFilter implements GlobalFilter, Ordered {
|
|||||||
public static final String HEADER_USERNAME = "X-Username";
|
public static final String HEADER_USERNAME = "X-Username";
|
||||||
|
|
||||||
// 白名单路径(不需要X-Tenant-Id)
|
// 白名单路径(不需要X-Tenant-Id)
|
||||||
|
// 注意:路径是网关接收的原始请求路径(含/fund前缀)
|
||||||
private static final List<String> TENANT_ID_WHITE_LIST = Arrays.asList(
|
private static final List<String> TENANT_ID_WHITE_LIST = Arrays.asList(
|
||||||
"/sys/api/v1/auth/login", // 登录接口
|
"/fund/sys/auth/login", // 登录接口
|
||||||
"/sys/api/v1/auth/logout", // 登出接口
|
"/fund/sys/auth/logout", // 登出接口
|
||||||
"/actuator/health", // 健康检查
|
"/actuator/health", // 网关健康检查(无/fund前缀)
|
||||||
"/sys/api/v1/sys/health", // 系统服务健康检查
|
"/fund/sys/health", // 系统服务健康检查
|
||||||
"/cust/api/v1/cust/health", // 客户服务健康检查
|
"/fund/cust/health", // 客户服务健康检查
|
||||||
"/proj/api/v1/proj/health", // 项目服务健康检查
|
"/fund/proj/health", // 项目服务健康检查
|
||||||
"/exp/api/v1/exp/health", // 支出服务健康检查
|
"/fund/exp/health", // 支出服务健康检查
|
||||||
"/receipt/api/v1/receipt/health", // 收款服务健康检查
|
"/fund/receipt/health", // 收款服务健康检查
|
||||||
"/report/api/v1/report/health", // 报表服务健康检查
|
"/fund/report/health", // 报表服务健康检查
|
||||||
"/req/api/v1/req/health", // 请求服务健康检查
|
"/fund/req/health", // 请求服务健康检查
|
||||||
"/file/api/v1/file/health" // 文件服务健康检查
|
"/fund/file/health" // 文件服务健康检查
|
||||||
);
|
);
|
||||||
|
|
||||||
private final ObjectMapper objectMapper = new ObjectMapper();
|
private final ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
|||||||
@ -39,11 +39,17 @@ public class TokenAuthFilter implements GlobalFilter, Ordered {
|
|||||||
private static final String TENANT_ID_HEADER = "X-Tenant-Id";
|
private static final String TENANT_ID_HEADER = "X-Tenant-Id";
|
||||||
|
|
||||||
// 白名单路径(不需要token验证)
|
// 白名单路径(不需要token验证)
|
||||||
|
// 注意:路径是网关接收的原始请求路径(含/fund前缀)
|
||||||
private static final List<String> WHITE_LIST = Arrays.asList(
|
private static final List<String> WHITE_LIST = Arrays.asList(
|
||||||
"/sys/api/v1/auth/login",
|
"/fund/sys/auth/login",
|
||||||
"/sys/api/v1/sys/health",
|
"/fund/sys/health",
|
||||||
"/cust/api/v1/cust/health",
|
"/fund/cust/health",
|
||||||
"/proj/api/v1/proj/health"
|
"/fund/proj/health",
|
||||||
|
"/fund/exp/health",
|
||||||
|
"/fund/receipt/health",
|
||||||
|
"/fund/report/health",
|
||||||
|
"/fund/req/health",
|
||||||
|
"/fund/file/health"
|
||||||
);
|
);
|
||||||
|
|
||||||
private final ReactiveTokenService reactiveTokenService;
|
private final ReactiveTokenService reactiveTokenService;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user