Package org.apache.shiro.config

Examples of org.apache.shiro.config.Ini


        }
        return ini;
    }

    protected Ini loadIniFromPath() {
        Ini ini = null;
        String path = getConfigPath();
        if (path != null) {
            ini = convertPathToIni(path);
        }
        return ini;
View Full Code Here


            setFilterChainResolver(resolver);
        }
    }

    protected Ini convertConfigToIni(String config) {
        Ini ini = new Ini();
        ini.load(config);
        return ini;
    }
View Full Code Here

        ini.load(config);
        return ini;
    }

    protected Ini convertPathToIni(String path) {
        Ini ini = new Ini();
        ini.loadFromPath(path);
        return ini;
    }
View Full Code Here

    @Before
    public void setup() {
        sm = new DefaultWebSecurityManager();
        sm.setSessionMode(DefaultWebSecurityManager.NATIVE_SESSION_MODE);
        Ini ini = new Ini();
        Ini.Section section = ini.addSection(IniRealm.USERS_SECTION_NAME);
        section.put("lonestarr", "vespa");
        sm.setRealm(new IniRealm(ini));
    }
View Full Code Here

        assertNotNull(resolver);
    }

    @Test
    public void testNewInstanceWithIni() {
        Ini ini = new Ini();
        String config =
                "[urls]\n" +
                        "/index.html = anon";
        ini.load(config);
        factory = new IniFilterChainResolverFactory(ini);
        FilterChainResolver resolver = factory.getInstance();
        assertNotNull(resolver);
    }
View Full Code Here

        factory.createChains(null, null);
    }

    @Test
    public void testNewInstanceWithNonFilter() {
        Ini ini = new Ini();
        String config =
                "[filters]\n" +
                        "test = org.apache.shiro.web.servlet.SimpleCookie\n" + //any non-Filter will do
                        "[urls]\n" +
                        "/index.html = anon";
        ini.load(config);
        factory = new IniFilterChainResolverFactory(ini);
        factory.getInstance();
    }
View Full Code Here

        factory.getInstance();
    }

    @Test
    public void testNewInstanceWithFilterConfig() {
        Ini ini = new Ini();
        String text =
                "[urls]\n" +
                        "/index.html = anon";
        ini.load(text);
        factory = new IniFilterChainResolverFactory(ini);
        FilterConfig config = createNiceMockFilterConfig();
        factory.setFilterConfig(config);
        replay(config);
        FilterChainResolver resolver = factory.getInstance();
View Full Code Here

        try {
            ini.addSection(IniFilterChainResolverFactory.URLS); // Create the empty section
            addURLsWithNamedPermission(ini);

            Ini iniWithURLS = readURLPatterns();

            addManuallyConfiguredUrls(ini.getSection(IniFilterChainResolverFactory.URLS), iniWithURLS
                    .getSection(APP_URL));

            ini.get(IniSecurityManagerFactory.MAIN_SECTION_NAME).put("user.loginUrl", config.getLoginPage());

            String hashAlgorithmName = config.getHashAlgorithmName();
View Full Code Here

        mainSection.put("credentialsMatcher", OracleCredentialsMatcher.class.getName());
        mainSection.put("appRealm.credentialsMatcher", "$credentialsMatcher");
    }

    private Ini readURLPatterns() {
        Ini iniWithURLS = getSpecifiedIni(new String[]{config.getLocationSecuredURLProperties()});

        iniWithURLS.setSectionProperty(APP_URL, "/**", "anon");
        return iniWithURLS;
    }
View Full Code Here

  @PostConstruct
  public void postConstruct() throws ConfigurationException, IOException {
    URL iniURL = getShiroIniURL();
    if (iniURL != null) {
      Ini ini = new Ini();
      ini.load(iniURL.openStream());
      IniSecurityManagerFactory factory = new IniSecurityManagerFactory(ini);
      manager = factory.getInstance();
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.shiro.config.Ini

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.