本文整理汇总了Java中org.springframework.security.web.util.matcher.AnyRequestMatcher.INSTANCE属性的典型用法代码示例。如果您正苦于以下问题:Java AnyRequestMatcher.INSTANCE属性的具体用法?Java AnyRequestMatcher.INSTANCE怎么用?Java AnyRequestMatcher.INSTANCE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.springframework.security.web.util.matcher.AnyRequestMatcher
的用法示例。
在下文中一共展示了AnyRequestMatcher.INSTANCE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CsrfCookieGeneratorFilter
public CsrfCookieGeneratorFilter(final String... ignoredPatterns) {
if (ignoredPatterns.length > 0) {
this.ignoredMatcher = new OrRequestMatcher(Arrays.stream(ignoredPatterns)
.map(AntPathRequestMatcher::new)
.collect(toList()));
} else {
this.ignoredMatcher = new NegatedRequestMatcher(AnyRequestMatcher.INSTANCE);
}
}
示例2: createDelegate
private RequestMatcher createDelegate() {
ServerProperties server = ManagementWebSecurityConfigurerAdapter.this.server;
List<RequestMatcher> matchers = new ArrayList<RequestMatcher>();
EndpointHandlerMapping endpointHandlerMapping = ManagementWebSecurityConfigurerAdapter.this
.getRequiredEndpointHandlerMapping();
for (String path : this.endpointPaths.getPaths(endpointHandlerMapping)) {
matchers.add(new AntPathRequestMatcher(server.getPath(path)));
}
return (matchers.isEmpty() ? AnyRequestMatcher.INSTANCE
: new OrRequestMatcher(matchers));
}
示例3: addSecureChannel
private void addSecureChannel(List<Filter> filters, Protocol protocol) {
ChannelProcessingFilter channelProcessingFilter = new ChannelProcessingFilter();
channelProcessingFilter.setChannelDecisionManager(channelDecisionManager);
RequestMatcher anyRequest = AnyRequestMatcher.INSTANCE;
LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> requestMap = new LinkedHashMap<>();
Collection<ConfigAttribute> configAtts = new ArrayList<>();
switch (protocol) {
case HTTP:
configAtts.add(new SecurityConfig("ANY_CHANNEL"));
break;
case HTTPS:
configAtts.add(new SecurityConfig("REQUIRES_SECURE_CHANNEL"));
break;
default:
}
requestMap.put(anyRequest, configAtts);
FilterInvocationSecurityMetadataSource securityMetadataSource = new DefaultFilterInvocationSecurityMetadataSource(requestMap);
channelProcessingFilter.setSecurityMetadataSource(securityMetadataSource);
filters.add(channelProcessingFilter);
}