Package org.apache.qpid.server.security

Examples of org.apache.qpid.server.security.SecurityManager$SecurityConfiguration


        _authenticationProviderFactory = authenticationProviderFactory;
        _groupProviderFactory = groupProviderFactory;
        _accessControlProviderFactory = accessControlProviderFactory;
        _portFactory = portFactory;
        _brokerOptions = brokerOptions;
        _securityManager = new SecurityManager(this, _brokerOptions.isManagementMode());
        _supportedVirtualHostStoreTypes = new MessageStoreCreator().getStoreTypes();
        _supportedBrokerStoreTypes = new BrokerConfigurationStoreCreator().getStoreTypes();
        _brokerStore = brokerStore;
        if (_brokerOptions.isManagementMode())
        {
View Full Code Here


public class VirtualHostRecovererTest extends TestCase
{
    public void testCreate()
    {
        StatisticsGatherer statisticsGatherer = mock(StatisticsGatherer.class);
        SecurityManager securityManager = mock(SecurityManager.class);
        ConfigurationEntry entry = mock(ConfigurationEntry.class);
        Broker parent = mock(Broker.class);
        when(parent.getAttribute(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD)).thenReturn(3000l);
        when(parent.getSecurityManager()).thenReturn(securityManager);
View Full Code Here

    }

    public void testCreateVirtualHostFromStoreConfigAtrributes()
    {
        StatisticsGatherer statisticsGatherer = mock(StatisticsGatherer.class);
        SecurityManager securityManager = mock(SecurityManager.class);
        ConfigurationEntry entry = mock(ConfigurationEntry.class);
        Broker parent = mock(Broker.class);
        when(parent.getAttribute(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD)).thenReturn(3000l);
        when(parent.getSecurityManager()).thenReturn(securityManager);
View Full Code Here

    }

    public void checkMandatoryAttributesAreValidated(String[] mandatoryAttributes, Map<String, Object> attributes)
    {
        StatisticsGatherer statisticsGatherer = mock(StatisticsGatherer.class);
        SecurityManager securityManager = mock(SecurityManager.class);
        ConfigurationEntry entry = mock(ConfigurationEntry.class);
        Broker parent = mock(Broker.class);
        when(parent.getSecurityManager()).thenReturn(securityManager);
        VirtualHostRecoverer recoverer = new VirtualHostRecoverer(statisticsGatherer);
View Full Code Here

    {
        Broker broker = BrokerTestHelper.createBrokerMock();
        _virtualHostRegistry = broker.getVirtualHostRegistry();

        VirtualHostConfiguration configuration = new  VirtualHostConfiguration(vhostName, config, broker);
        VirtualHost host = new VirtualHostImpl(_virtualHostRegistry, mock(StatisticsGatherer.class), new SecurityManager(mock(Broker.class), false), configuration);
        _virtualHostRegistry.registerVirtualHost(host);

        return host;
    }
View Full Code Here

        _virtualHostRegistry = broker.getVirtualHostRegistry();

        Configuration config = new PropertiesConfiguration();
        config.setProperty("store.type", MemoryMessageStore.TYPE);
        VirtualHostConfiguration configuration = new  VirtualHostConfiguration(virtualHostName, config, broker);
        VirtualHost host = new VirtualHostImpl(_virtualHostRegistry, mock(StatisticsGatherer.class), new SecurityManager(mock(Broker.class), false), configuration);
        _virtualHostRegistry.registerVirtualHost(host);
        return host;
    }
View Full Code Here

        String type = getType(method, args);
        String vhost = getVirtualHost(method, args);
        int impact = getImpact(method, args);

        // Get the security manager for the virtual host (if set)
        SecurityManager security;
        if (vhost == null)
        {
            security = _broker.getSecurityManager();
        }
        else
        {
            VirtualHost virtualHost = _broker.findVirtualHostByName(vhost);
            if (virtualHost == null)
            {
                throw new IllegalArgumentException("Virtual host with name '" + vhost + "' is not found.");
            }
            security = virtualHost.getSecurityManager();
        }

        methodName = getMethodName(method, args);
        if (isAccessMethod(methodName) || impact == MBeanOperationInfo.INFO)
        {
            // Check for read-only method invocation permission
            if (!security.authoriseMethod(Operation.ACCESS, type, methodName))
            {
                throw new SecurityException("Permission denied: Access " + methodName);
            }
        }
        else
        {
            // Check for setting properties permission
            if (!security.authoriseMethod(Operation.UPDATE, type, methodName))
            {
                throw new SecurityException("Permission denied: Update " + methodName);
            }
        }
View Full Code Here

        vhost.executeTransaction(new ClearQueueTransaction(queue));
    }

    private void authorizeMethod(String methodName, VirtualHost<?,?,?> vhost)
    {
        SecurityManager securityManager = getBroker().getSecurityManager();
        securityManager.authoriseMethod(Operation.UPDATE, "VirtualHost.Queue", methodName, vhost.getName());
    }
View Full Code Here

            initialiseManagedObjectRegistry();

            _virtualHostRegistry = new VirtualHostRegistry(this);

            _securityManager = new SecurityManager(_configuration, _pluginManager);

            createDatabaseManager(_configuration);

            _authenticationManager = new PrincipalDatabaseAuthenticationManager(null, null);
View Full Code Here

        if (_name == null || _name.length() == 0)
        {
        throw new IllegalArgumentException("Illegal name (" + _name + ") for virtualhost.");
        }

        _securityManager = new SecurityManager(_appRegistry.getSecurityManager());
        _securityManager.configureHostPlugins(_configuration);

        _virtualHostMBean = new VirtualHostMBean();

        _connectionRegistry = new ConnectionRegistry();
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.security.SecurityManager$SecurityConfiguration

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.