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

The following examples show how to use org.springframework.security.web.util.matcher.RegexRequestMatcher. 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 File: WebSecurityConfig.java    From youkefu with 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
Source File: CsrfSecurityRequestMatcher.java    From airsonic-advanced with GNU General Public License v3.0 5 votes vote down vote up
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
Source File: CsrfSecurityRequestMatcher.java    From airsonic with GNU General Public License v3.0 5 votes vote down vote up
public CsrfSecurityRequestMatcher() {
    this.whiteListedMatchers = Arrays.asList(
        new RegexRequestMatcher("/dwr/.*\\.dwr", "POST"),
        new RegexRequestMatcher("/rest/.*\\.view(\\?.*)?", "POST"),
        new RegexRequestMatcher("/search(?:\\.view)?", "POST")
    );
}
 
Example #4
Source File: OrRegexRequestMatcher.java    From studio with 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())
    );
}