Java Code Examples for org.springframework.security.web.util.matcher.RegexRequestMatcher

The following examples show how to use org.springframework.security.web.util.matcher.RegexRequestMatcher. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: youkefu   Source File: WebSecurityConfig.java    License: Apache License 2.0 6 votes vote down vote up
@Bean
public Filter tokenInfoTokenFilterSecurityInterceptor() throws Exception
{
    RequestMatcher autconfig = new RegexRequestMatcher("/autoconfig([\\S\\s]*?)",null);
    RequestMatcher configprops = new RegexRequestMatcher("/configprops([\\S\\s]*?)",null);
    RequestMatcher beans = new RegexRequestMatcher("/beans([\\S\\s]*?)",null);
    RequestMatcher dump = new RegexRequestMatcher("/dump([\\S\\s]*?)",null);
    RequestMatcher env = new RegexRequestMatcher("/env([\\S\\s]*?)",null);
    RequestMatcher health = new RegexRequestMatcher("/health([\\S\\s]*?)",null);
    RequestMatcher info = new RegexRequestMatcher("/info([\\S\\s]*?)",null);
    RequestMatcher mappings = new RegexRequestMatcher("/mappings([\\S\\s]*?)",null);
    RequestMatcher metrics = new RegexRequestMatcher("/metrics([\\S\\s]*?)",null);
    RequestMatcher trace = new RegexRequestMatcher("/trace([\\S\\s]*?)",null);
    RequestMatcher druid = new RegexRequestMatcher("/druid([\\S\\s]*?)",null);
    
    RequestMatcher admin = new RegexRequestMatcher("/admin([\\S\\s]*?)",null);
    
    return new DelegateRequestMatchingFilter(autconfig , configprops , beans , dump , env , health , info , mappings , metrics , trace, druid , admin);
}
 
Example 2
public CsrfSecurityRequestMatcher() {
    this.whiteListedMatchers = Arrays.asList(
        new RegexRequestMatcher("/rest/.*\\.view(\\?.*)?", "POST"),
        new RegexRequestMatcher("/search(?:\\.view)?", "POST"),
        // websockets are protected by stomp headers
        new AntPathRequestMatcher("/websocket/**")
    );
}
 
Example 3
public CsrfSecurityRequestMatcher() {
    this.whiteListedMatchers = Arrays.asList(
        new RegexRequestMatcher("/dwr/.*\\.dwr", "POST"),
        new RegexRequestMatcher("/rest/.*\\.view(\\?.*)?", "POST"),
        new RegexRequestMatcher("/search(?:\\.view)?", "POST")
    );
}
 
Example 4
Source Project: studio   Source File: OrRegexRequestMatcher.java    License: GNU General Public License v3.0 5 votes vote down vote up
public OrRegexRequestMatcher(String... patterns) {
    requestMatcher = new OrRequestMatcher(
            Stream.of(patterns)
                    .map(pattern -> new RegexRequestMatcher(pattern, null))
                    .collect(toList())
    );
}