Example usage for org.apache.shiro.web.filter.mgt DefaultFilter anon

List of usage examples for org.apache.shiro.web.filter.mgt DefaultFilter anon

Introduction

In this page you can find the example usage for org.apache.shiro.web.filter.mgt DefaultFilter anon.

Prototype

DefaultFilter anon

To view the source code for org.apache.shiro.web.filter.mgt DefaultFilter anon.

Click Source Link

Usage

From source file:com.stormpath.shiro.spring.boot.autoconfigure.StormpathShiroWebAutoConfiguration.java

License:Apache License

@Bean
@ConditionalOnMissingBean/*w w  w.  j  a  v a  2  s .  c  o m*/
public ShiroFilterChainDefinition shiroFilterChainDefinition() {
    DefaultShiroFilterChainDefinition filterChainDefinition = new DefaultShiroFilterChainDefinition();
    filterChainDefinition.addPathDefinition("/assets/**", DefaultFilter.anon.name());
    filterChainDefinition.addPathDefinition("/**", DefaultFilter.authc.name());
    return filterChainDefinition;
}

From source file:com.stormpath.shiro.spring.boot.examples.WebApp.java

License:Apache License

@Bean
public ShiroFilterChainDefinition shiroFilterChainDefinition() {
    DefaultShiroFilterChainDefinition filterChainDefinition = new DefaultShiroFilterChainDefinition();
    filterChainDefinition.addPathDefinition("/assets/**", DefaultFilter.anon.name()); // static web resources
    filterChainDefinition.addPathDefinition("/", DefaultFilter.anon.name()); // the welcome page allows guest or logged in users
    filterChainDefinition.addPathDefinition("/account-info", DefaultFilter.authc.name()); // the account-info page requires a user
    return filterChainDefinition;
}

From source file:org.panifex.module.api.security.DefaultSecFilterMappingTest.java

License:Open Source License

@Test
public void testConstructMappingOfDefaultShiroFilter() {
    DefaultFilter defaultFilter = DefaultFilter.anon;

    replayAll();// w  w w  .j  av a 2  s  .c  o  m
    SecFilterMapping mapping = new DefaultSecFilterMapping(url, defaultFilter);
    verifyAll();

    assertEquals(url, mapping.getUrl());
    assertEquals(defaultFilter.toString(), mapping.getFilterName());
}