当前位置: 首页>>代码示例>>Java>>正文


Java AnyRequestMatcher.INSTANCE属性代码示例

本文整理汇总了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);
    }
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:9,代码来源:CsrfCookieGeneratorFilter.java

示例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));
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:11,代码来源:ManagementWebSecurityAutoConfiguration.java

示例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);
}
 
开发者ID:motech,项目名称:motech,代码行数:25,代码来源:SecurityRuleBuilder.java


注:本文中的org.springframework.security.web.util.matcher.AnyRequestMatcher.INSTANCE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。