Class HerodotusPathPatternRequestMatcher
java.lang.Object
cn.herodotus.engine.oauth2.authorization.matcher.HerodotusPathPatternRequestMatcher
- All Implemented Interfaces:
HerodotusRequestMatcher,org.springframework.security.web.util.matcher.RequestMatcher
Description: 自定义请求路径匹配器
拷贝自 PathPatternRequestMatcher。进行一定的修改以支持在没有 HttpServletRequest 的环境下进行路径的比较和匹配
概扩展的目的,主要是为了实现 SecurityAttributeStorage 代码中,使用 PathPatternRequestMatcher 逻辑进行高效请求路径去重分析。
- Author:
- : gengwei.zheng
- Date:
- : 2025/8/23 23:58
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA builder for specifying various elements of a request for the purpose of creating aHerodotusPathPatternRequestMatcher.Nested classes/interfaces inherited from interface org.springframework.security.web.util.matcher.RequestMatcher
org.springframework.security.web.util.matcher.RequestMatcher.MatchResult -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()org.springframework.security.web.util.matcher.RequestMatcher.MatchResultmatcher(HerodotusRequest request) 判断策略所实施的规则是否与提供的请求相匹配org.springframework.security.web.util.matcher.RequestMatcher.MatchResultmatcher(jakarta.servlet.http.HttpServletRequest request) booleanmatches(HerodotusRequest request) 判断策略所实施的规则是否与提供的请求相匹配booleanmatches(jakarta.servlet.http.HttpServletRequest request) toString()UsePathPatternParser.defaultInstanceto parse path patterns.withPathPatternParser(org.springframework.web.util.pattern.PathPatternParser parser) Use thisPathPatternParserto parse path patterns.
-
Method Details
-
withDefaults
UsePathPatternParser.defaultInstanceto parse path patterns.- Returns:
- a
HerodotusPathPatternRequestMatcher.Builderthat treats URIs as relative to the context path, if any
-
withPathPatternParser
public static HerodotusPathPatternRequestMatcher.Builder withPathPatternParser(org.springframework.web.util.pattern.PathPatternParser parser) Use thisPathPatternParserto parse path patterns.- Parameters:
parser- thePathPatternParserto use- Returns:
- a
HerodotusPathPatternRequestMatcher.Builderthat treats URIs as relative to the givenservletPath
-
matches
public boolean matches(jakarta.servlet.http.HttpServletRequest request) - Specified by:
matchesin interfaceorg.springframework.security.web.util.matcher.RequestMatcher
-
matcher
public org.springframework.security.web.util.matcher.RequestMatcher.MatchResult matcher(jakarta.servlet.http.HttpServletRequest request) - Specified by:
matcherin interfaceorg.springframework.security.web.util.matcher.RequestMatcher
-
matches
Description copied from interface:HerodotusRequestMatcher判断策略所实施的规则是否与提供的请求相匹配- Specified by:
matchesin interfaceHerodotusRequestMatcher- Parameters:
request- 自定义请求对象HerodotusRequest- Returns:
- true 请求是否匹配,false 不匹配
-
matcher
public org.springframework.security.web.util.matcher.RequestMatcher.MatchResult matcher(HerodotusRequest request) 判断策略所实施的规则是否与提供的请求相匹配- Specified by:
matcherin interfaceHerodotusRequestMatcher- Parameters:
request- 自定义请求对象HerodotusRequest- Returns:
- 匹配结果
RequestMatcher.MatchResult
-
equals
-
hashCode
public int hashCode() -
toString
-