Package org.springframework.security.web.util

Examples of org.springframework.security.web.util.RequestMatcher.matches()


    @Override
    public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        Map<String, String> urlPatternDispatchMap = (Map<String, String>) getApplicationContext().getBean("blResourceUrlPatternRequestDispatchMap");
        for (Map.Entry<String, String> entry : urlPatternDispatchMap.entrySet()) {
            RequestMatcher matcher = new AntPathRequestMatcher(entry.getKey());
            if (matcher.matches(request)){
                request.getRequestDispatcher(entry.getValue()).forward(request, response);
                return;
            }
        }
        super.handleRequest(request, response);
View Full Code Here


        boolean excludedRequestFound = false;
        if (excludedRequestPatterns != null && excludedRequestPatterns.size() > 0) {
            for (String pattern : excludedRequestPatterns) {
                RequestMatcher matcher = new AntPathRequestMatcher(pattern);
                if (matcher.matches(request)){
                    excludedRequestFound = true;
                    break;
                }
            }
        }
View Full Code Here

        }
       
        if (excludedOrderLockRequestPatterns != null && excludedOrderLockRequestPatterns.size() > 0) {
            for (String pattern : excludedOrderLockRequestPatterns) {
                RequestMatcher matcher = new AntPathRequestMatcher(pattern);
                if (matcher.matches(request)){
                    return false;
                }
            }
        }
View Full Code Here

        GeoServerSecurityFilterChainProxy proxy = new GeoServerSecurityFilterChainProxy(getSecurityManager());
       
        // match all
        VariableFilterChain chain =  new ServiceLoginFilterChain("/**");        
        RequestMatcher matcher = proxy.matcherForChain(chain);       
        assertTrue(matcher.matches(createRequest(HTTPMethod.GET, "/wms")));
       
        // set methods, but match is inactvie
        chain =  new ServiceLoginFilterChain("/**");
        chain.getHttpMethods().add(HTTPMethod.GET);
        chain.getHttpMethods().add(HTTPMethod.POST);
View Full Code Here

        // set methods, but match is inactvie
        chain =  new ServiceLoginFilterChain("/**");
        chain.getHttpMethods().add(HTTPMethod.GET);
        chain.getHttpMethods().add(HTTPMethod.POST);
        matcher = proxy.matcherForChain(chain);       
        assertTrue(matcher.matches(createRequest(HTTPMethod.GET, "/wms")));
        assertTrue(matcher.matches(createRequest(HTTPMethod.POST, "/wms")));
        assertTrue(matcher.matches(createRequest(HTTPMethod.PUT, "/wms")));

        // active method matching
        chain.setMatchHTTPMethod(true);
View Full Code Here

        chain =  new ServiceLoginFilterChain("/**");
        chain.getHttpMethods().add(HTTPMethod.GET);
        chain.getHttpMethods().add(HTTPMethod.POST);
        matcher = proxy.matcherForChain(chain);       
        assertTrue(matcher.matches(createRequest(HTTPMethod.GET, "/wms")));
        assertTrue(matcher.matches(createRequest(HTTPMethod.POST, "/wms")));
        assertTrue(matcher.matches(createRequest(HTTPMethod.PUT, "/wms")));

        // active method matching
        chain.setMatchHTTPMethod(true);
        matcher = proxy.matcherForChain(chain);       
View Full Code Here

        chain.getHttpMethods().add(HTTPMethod.GET);
        chain.getHttpMethods().add(HTTPMethod.POST);
        matcher = proxy.matcherForChain(chain);       
        assertTrue(matcher.matches(createRequest(HTTPMethod.GET, "/wms")));
        assertTrue(matcher.matches(createRequest(HTTPMethod.POST, "/wms")));
        assertTrue(matcher.matches(createRequest(HTTPMethod.PUT, "/wms")));

        // active method matching
        chain.setMatchHTTPMethod(true);
        matcher = proxy.matcherForChain(chain);       
        assertTrue(matcher.matches(createRequest(HTTPMethod.GET, "/wms")));
View Full Code Here

        assertTrue(matcher.matches(createRequest(HTTPMethod.PUT, "/wms")));

        // active method matching
        chain.setMatchHTTPMethod(true);
        matcher = proxy.matcherForChain(chain);       
        assertTrue(matcher.matches(createRequest(HTTPMethod.GET, "/wms")));
        assertTrue(matcher.matches(createRequest(HTTPMethod.POST, "/wms")));
        assertFalse(matcher.matches(createRequest(HTTPMethod.PUT, "/wms")));
       
        chain =  new ServiceLoginFilterChain("/wfs/**,/web/**");        
        matcher = proxy.matcherForChain(chain);
View Full Code Here

        // active method matching
        chain.setMatchHTTPMethod(true);
        matcher = proxy.matcherForChain(chain);       
        assertTrue(matcher.matches(createRequest(HTTPMethod.GET, "/wms")));
        assertTrue(matcher.matches(createRequest(HTTPMethod.POST, "/wms")));
        assertFalse(matcher.matches(createRequest(HTTPMethod.PUT, "/wms")));
       
        chain =  new ServiceLoginFilterChain("/wfs/**,/web/**");        
        matcher = proxy.matcherForChain(chain);
       
View Full Code Here

        // active method matching
        chain.setMatchHTTPMethod(true);
        matcher = proxy.matcherForChain(chain);       
        assertTrue(matcher.matches(createRequest(HTTPMethod.GET, "/wms")));
        assertTrue(matcher.matches(createRequest(HTTPMethod.POST, "/wms")));
        assertFalse(matcher.matches(createRequest(HTTPMethod.PUT, "/wms")));
       
        chain =  new ServiceLoginFilterChain("/wfs/**,/web/**");        
        matcher = proxy.matcherForChain(chain);
       
        assertFalse(matcher.matches(createRequest(HTTPMethod.GET, "/wms/abc")));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.