Package org.apache.qpid.server.security.access.plugins

Examples of org.apache.qpid.server.security.access.plugins.Firewall.access()


   
    public void testDefaultAction() throws Exception
    {
        // Test simple deny
        Firewall plugin = initialisePlugin("deny");
        assertEquals(Result.DENIED, plugin.access(ObjectType.VIRTUALHOST, _address));

        // Test simple allow
        plugin = initialisePlugin("allow");
        assertEquals(Result.ALLOWED, plugin.access(ObjectType.VIRTUALHOST, _address));
    }
View Full Code Here


        Firewall plugin = initialisePlugin("deny");
        assertEquals(Result.DENIED, plugin.access(ObjectType.VIRTUALHOST, _address));

        // Test simple allow
        plugin = initialisePlugin("allow");
        assertEquals(Result.ALLOWED, plugin.access(ObjectType.VIRTUALHOST, _address));
    }
   

    public void testSingleIPRule() throws Exception
    {
View Full Code Here

        rule.setAccess("allow");
        rule.setNetwork("192.168.23.23");
       
        Firewall plugin = initialisePlugin("deny", new RuleInfo[]{rule});

        assertEquals(Result.DENIED, plugin.access(ObjectType.VIRTUALHOST, _address));
       
        // Set IP so that we're connected from the right address
        _address = new InetSocketAddress("192.168.23.23", 65535);
        assertEquals(Result.ALLOWED, plugin.access(ObjectType.VIRTUALHOST, _address));
    }
View Full Code Here

        assertEquals(Result.DENIED, plugin.access(ObjectType.VIRTUALHOST, _address));
       
        // Set IP so that we're connected from the right address
        _address = new InetSocketAddress("192.168.23.23", 65535);
        assertEquals(Result.ALLOWED, plugin.access(ObjectType.VIRTUALHOST, _address));
    }
   
    public void testSingleNetworkRule() throws Exception
    {
        RuleInfo rule = new RuleInfo();
View Full Code Here

        rule.setAccess("allow");
        rule.setNetwork("192.168.23.0/24");
       
        Firewall plugin = initialisePlugin("deny", new RuleInfo[]{rule});

        assertEquals(Result.DENIED, plugin.access(ObjectType.VIRTUALHOST, _address));
       
        // Set IP so that we're connected from the right address
        _address = new InetSocketAddress("192.168.23.23", 65535);
        assertEquals(Result.ALLOWED, plugin.access(ObjectType.VIRTUALHOST, _address));
    }
View Full Code Here

        assertEquals(Result.DENIED, plugin.access(ObjectType.VIRTUALHOST, _address));
       
        // Set IP so that we're connected from the right address
        _address = new InetSocketAddress("192.168.23.23", 65535);
        assertEquals(Result.ALLOWED, plugin.access(ObjectType.VIRTUALHOST, _address));
    }

    public void testSingleHostRule() throws Exception
    {
        RuleInfo rule = new RuleInfo();
View Full Code Here

       
        Firewall plugin = initialisePlugin("deny", new RuleInfo[]{rule});

        // Set IP so that we're connected from the right address
        _address = new InetSocketAddress("127.0.0.1", 65535);
        assertEquals(Result.ALLOWED, plugin.access(ObjectType.VIRTUALHOST, _address));
    }

    public void testSingleHostWilcardRule() throws Exception
    {
        RuleInfo rule = new RuleInfo();
View Full Code Here

        rule.setHostname(".*"+hostname.subSequence(hostname.length() - 1, hostname.length())+"*");
        Firewall plugin = initialisePlugin("deny", new RuleInfo[]{rule});

        // Set IP so that we're connected from the right address
        _address = new InetSocketAddress("127.0.0.1", 65535);
        assertEquals(Result.ALLOWED, plugin.access(ObjectType.VIRTUALHOST, _address));
    }
   
    public void testSeveralFirstAllowsAccess() throws Exception
    {
        RuleInfo firstRule = new RuleInfo();
View Full Code Here

        thirdRule.setAccess("deny");
        thirdRule.setHostname("localhost");
       
        Firewall plugin = initialisePlugin("deny", new RuleInfo[]{firstRule, secondRule, thirdRule});

        assertEquals(Result.DENIED, plugin.access(ObjectType.VIRTUALHOST, _address));
       
        // Set IP so that we're connected from the right address
        _address = new InetSocketAddress("192.168.23.23", 65535);
        assertEquals(Result.ALLOWED, plugin.access(ObjectType.VIRTUALHOST, _address));
    }
View Full Code Here

        assertEquals(Result.DENIED, plugin.access(ObjectType.VIRTUALHOST, _address));
       
        // Set IP so that we're connected from the right address
        _address = new InetSocketAddress("192.168.23.23", 65535);
        assertEquals(Result.ALLOWED, plugin.access(ObjectType.VIRTUALHOST, _address));
    }
   
    public void testSeveralLastAllowsAccess() throws Exception
    {
        RuleInfo firstRule = new RuleInfo();
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.