fix: 修复动态鉴权管理器路径匹配优化问题 (Issue #884) #934
Open
+476
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
问题描述
修复 Issue #884: 动态鉴权管理器路径匹配优化
当应用配置了
server.servlet.context-path
时,动态权限管理器的路径匹配会失败,导致无法正确查询到所需的权限。修复内容
核心修复
编译问题修复
测试验证
测试结果
✅ 所有 5 个测试用例全部通过
修复效果
修复后的代码能够正确处理以下场景:
/admin/users
→ 正常匹配/admin/**
/mall/admin/users
→ 移除/mall
前缀后匹配/admin/**
向后兼容性
相关文件
mall-security/src/main/java/com/macro/mall/security/component/DynamicSecurityMetadataSource.java
mall-security/src/main/java/com/macro/mall/security/component/DynamicSecurityFilter.java
mall-security/src/test/java/com/macro/mall/security/component/PathMatchingTest.java
mall-common/src/main/java/com/macro/mall/common/domain/SwaggerProperties.java
mall-common/src/main/java/com/macro/mall/common/domain/WebLog.java
mall-security/src/main/java/com/macro/mall/security/config/IgnoreUrlsConfig.java
详细说明
请查看
SECURITY_FIX_SUMMARY.md
文件获取完整的修复说明和测试详情。Closes #884