本文整理汇总了Java中org.springframework.security.web.util.matcher.OrRequestMatcher类的典型用法代码示例。如果您正苦于以下问题:Java OrRequestMatcher类的具体用法?Java OrRequestMatcher怎么用?Java OrRequestMatcher使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OrRequestMatcher类属于org.springframework.security.web.util.matcher包,在下文中一共展示了OrRequestMatcher类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: OpenIdConnectFilter
import org.springframework.security.web.util.matcher.OrRequestMatcher; //导入依赖的package包/类
public OpenIdConnectFilter(
@Value("${openid.callback-uri}") String callbackUri,
@Value("${openid.api-base-uri}") String apiBaseUri) {
super(new OrRequestMatcher(
new AntPathRequestMatcher(callbackUri),
new AntPathRequestMatcher(apiBaseUri)));
this.localMatcher = new AntPathRequestMatcher(apiBaseUri);
setAuthenticationManager(new NoopAuthenticationManager());
}
示例2: FacebookLoginFilter
import org.springframework.security.web.util.matcher.OrRequestMatcher; //导入依赖的package包/类
public FacebookLoginFilter(
@Value("${facebook.filter.callback-uri}") String callbackUri,
@Value("${facebook.filter.api-base-uri}")String apiBaseUri) {
super(new OrRequestMatcher(
new AntPathRequestMatcher(callbackUri),
new AntPathRequestMatcher(apiBaseUri)
));
this.localMatcher = new AntPathRequestMatcher(apiBaseUri);
setAuthenticationManager(new NoopAuthenticationManager());
}
示例3: SkipPathRequestMatcher
import org.springframework.security.web.util.matcher.OrRequestMatcher; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public SkipPathRequestMatcher(List<String> pathsToSkip, String processingPath) {
Assert.notNull(pathsToSkip);
List<RequestMatcher> m = pathsToSkip.stream().map(path -> new AntPathRequestMatcher(path)).collect(Collectors.toList());
matchers = new OrRequestMatcher(m);
processingMatcher = new AntPathRequestMatcher(processingPath);
}
示例4: SkipPathRequestMatcher
import org.springframework.security.web.util.matcher.OrRequestMatcher; //导入依赖的package包/类
public SkipPathRequestMatcher(List<String> pathsToSkip, String processingPath) {
Assert.notNull(pathsToSkip);
List<RequestMatcher> m = pathsToSkip.stream().map(path -> new AntPathRequestMatcher(path))
.collect(Collectors.toList());
matchers = new OrRequestMatcher(m);
processingMatcher = new AntPathRequestMatcher(processingPath);
}
示例5: CsrfCookieGeneratorFilter
import org.springframework.security.web.util.matcher.OrRequestMatcher; //导入依赖的package包/类
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);
}
}
示例6: createDelegate
import org.springframework.security.web.util.matcher.OrRequestMatcher; //导入依赖的package包/类
private RequestMatcher createDelegate() {
ServerProperties server = this.contextResolver.getApplicationContext()
.getBean(ServerProperties.class);
List<RequestMatcher> matchers = new ArrayList<RequestMatcher>();
EndpointHandlerMapping endpointHandlerMapping = getRequiredEndpointHandlerMapping();
for (String path : this.endpointPaths.getPaths(endpointHandlerMapping)) {
matchers.add(new AntPathRequestMatcher(server.getPath(path)));
}
return (matchers.isEmpty() ? MATCH_NONE : new OrRequestMatcher(matchers));
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:11,代码来源:ManagementWebSecurityAutoConfiguration.java
示例7: createDelegate
import org.springframework.security.web.util.matcher.OrRequestMatcher; //导入依赖的package包/类
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));
}
示例8: configure
import org.springframework.security.web.util.matcher.OrRequestMatcher; //导入依赖的package包/类
@SuppressWarnings("ProhibitedExceptionDeclared")
@Override
protected void configure(final HttpSecurity http) throws Exception {
final AuthenticationSuccessHandler loginSuccessHandler = new LoginSuccessHandler(FindRole.CONFIG.toString(), FindController.CONFIG_PATH, "/p/");
final HttpSessionRequestCache requestCache = new HttpSessionRequestCache();
requestCache.setRequestMatcher(new OrRequestMatcher(
new AntPathRequestMatcher("/p/**"),
new AntPathRequestMatcher(FindController.CONFIG_PATH)
));
http.regexMatcher("/p/.*|/config/.*|/authenticate|/logout")
.authorizeRequests()
.antMatchers("/p/**").hasRole(FindRole.ADMIN.name())
.antMatchers(FindController.CONFIG_PATH).hasRole(FindRole.CONFIG.name())
.and()
.requestCache()
.requestCache(requestCache)
.and()
.formLogin()
.loginPage(FindController.DEFAULT_LOGIN_PAGE)
.loginProcessingUrl("/authenticate")
.successHandler(loginSuccessHandler)
.failureUrl(FindController.DEFAULT_LOGIN_PAGE + "?error=auth")
.and()
.logout()
.logoutSuccessHandler(new HodLogoutSuccessHandler(new HodTokenLogoutSuccessHandler(SsoController.SSO_LOGOUT_PAGE, tokenRepository), FindController.APP_PATH))
.and()
.csrf()
.disable();
}
示例9: IgnoredRequestMatcher
import org.springframework.security.web.util.matcher.OrRequestMatcher; //导入依赖的package包/类
private IgnoredRequestMatcher() {
ConfigList c = Config.getConfig().getList("security.ignored");
List<RequestMatcher> list = new ArrayList<>(c.size());
for (ConfigValue configValue : c) {
list.add(new AntPathRequestMatcher((String) configValue.unwrapped()));
}
orMatcher = new OrRequestMatcher(list);
}
示例10: skipPathRequest
import org.springframework.security.web.util.matcher.OrRequestMatcher; //导入依赖的package包/类
private boolean skipPathRequest(HttpServletRequest request, List<String> pathsToSkip ) {
Assert.notNull(pathsToSkip, "path cannot be null.");
List<RequestMatcher> m = pathsToSkip.stream().map(path -> new AntPathRequestMatcher(path)).collect(Collectors.toList());
OrRequestMatcher matchers = new OrRequestMatcher(m);
return matchers.matches(request);
}
示例11: skipPathRequest
import org.springframework.security.web.util.matcher.OrRequestMatcher; //导入依赖的package包/类
private boolean skipPathRequest(HttpServletRequest request, List<String> pathsToSkip ) {
Assert.notNull(pathsToSkip, "pathsToSkip is null!");
List<RequestMatcher> m = pathsToSkip.stream().map(path -> new AntPathRequestMatcher(path)).collect(Collectors.toList());
OrRequestMatcher matchers = new OrRequestMatcher(m);
return matchers.matches(request);
}
示例12: SkipPathRequestMatcher
import org.springframework.security.web.util.matcher.OrRequestMatcher; //导入依赖的package包/类
public SkipPathRequestMatcher(List<String> pathsToSkip, String processingPath) {
Assert.notNull(pathsToSkip);
List<RequestMatcher> m = pathsToSkip.stream().map(path -> new AntPathRequestMatcher(path)).collect(Collectors.toList());
matchers = new OrRequestMatcher(m);
processingMatcher = new AntPathRequestMatcher(processingPath);
}
示例13: getRequestMatcher
import org.springframework.security.web.util.matcher.OrRequestMatcher; //导入依赖的package包/类
/**
* Returns an {@link OrRequestMatcher} that contains all the different URLs configured throughout the Service
* Provider configuration.
*
* @return
*/
public RequestMatcher getRequestMatcher() {
return new OrRequestMatcher(requestMatchers(defaultFailureURL, ssoProcessingURL, ssoHoKProcessingURL, discoveryProcessingURL,
idpSelectionPageURL, ssoLoginURL, metadataURL, defaultTargetURL, logoutURL, singleLogoutURL));
}