Package org.apache.shiro.web.filter.mgt

Examples of org.apache.shiro.web.filter.mgt.NamedFilterList


    protected void initFilter(Filter filter) {
        //ignore
    }

    public FilterChain proxy(FilterChain original, List<String> chainNames) {
        NamedFilterList configured = new SimpleNamedFilterList(chainNames.toString());
        for(String chainName : chainNames) {
            configured.addAll(getChain(chainName));
        }
        return configured.proxy(original);
    }
View Full Code Here


    // now add a protected path
    ProtectedPathManager protectedPathManager = injector.getInstance(ProtectedPathManager.class);
    protectedPathManager.addProtectedResource("/service/**", "foobar,perms[sample:priv-name]");

    NamedFilterList filterList = filterChainResolver.getFilterChainManager().getChain("/service/**");
    assertThat(filterList.get(0), instanceOf(SimpleAccessControlFilter.class));
    assertThat(filterList.get(1), instanceOf(HttpMethodPermissionFilter.class));

    // test that injection of filters works
    assertThat(((SimpleAccessControlFilter) filterList.get(0)).getSecurityXMLFilePath(),
        equalTo("target/foo/security.xml"));
  }
View Full Code Here

        AbstractShiroFilter shiroFilter = (AbstractShiroFilter) context.getBean("shiroFilter");

        PathMatchingFilterChainResolver resolver = (PathMatchingFilterChainResolver) shiroFilter.getFilterChainResolver();
        DefaultFilterChainManager fcManager = (DefaultFilterChainManager) resolver.getFilterChainManager();
        NamedFilterList chain = fcManager.getChain("/test");
        assertNotNull(chain);
        assertEquals(chain.size(), 2);
        Filter[] filters = new Filter[chain.size()];
        filters = chain.toArray(filters);
        assertTrue(filters[0] instanceof DummyFilter);
        assertTrue(filters[1] instanceof FormAuthenticationFilter);
    }
View Full Code Here

TOP

Related Classes of org.apache.shiro.web.filter.mgt.NamedFilterList

Copyright © 2018 www.massapicom. 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.