Package org.apache.qpid.server.security

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


        _id = UUIDGenerator.generateVhostUUID(_name);

        CurrentActor.get().message(VirtualHostMessages.CREATED(_name));

        _securityManager = new SecurityManager(_appRegistry.getSecurityManager(), _vhostConfig.getConfig());

        _connectionRegistry = new ConnectionRegistry();
        _connectionRegistry.addRegistryChangeListener(this);

        _houseKeepingTasks = new ScheduledThreadPoolExecutor(_vhostConfig.getHouseKeepingThreadCount());
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 = _appRegistry.getSecurityManager();
        }
        else
        {
            security = _appRegistry.getVirtualHostRegistry().getVirtualHost(vhost).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

            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 = _appRegistry.getSecurityManager();
            }
            else
            {
                security = _appRegistry.getVirtualHostRegistry().getVirtualHost(vhost).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

        _qmfId = _appRegistry.getConfigStore().createId();
        _id = UUIDGenerator.generateVhostUUID(_name);

        CurrentActor.get().message(VirtualHostMessages.CREATED(_name));

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

        _connectionRegistry = new ConnectionRegistry();
        _connectionRegistry.addRegistryChangeListener(this);
View Full Code Here

            _qmfService = new QMFService(getConfigStore(), this);

            logStartupMessages(CurrentActor.get());

            _securityManager = new SecurityManager(_configuration, _pluginManager);

            _authenticationManagerRegistry = createAuthenticationManagerRegistry(_configuration, _pluginManager);

            if(!_authManagerChangeListeners.isEmpty())
            {
View Full Code Here

    }

    private boolean isQueueUpdateMethodAuthorized(String methodName, String virtualHost)
    {
        SecurityManager securityManager = getSecurityManager(virtualHost);
        return securityManager.authoriseMethod(Operation.UPDATE, "VirtualHost.Queue", methodName);
    }
View Full Code Here

    }

    private SecurityManager getSecurityManager(String virtualHost)
    {
        IApplicationRegistry appRegistry = ApplicationRegistry.getInstance();
        SecurityManager security;
        if (virtualHost == null)
        {
            security = appRegistry.getSecurityManager();
        }
        else
View Full Code Here

    }

    public void setPublishFrame(MessagePublishInfo info, final Exchange e) throws AMQSecurityException
    {
        String routingKey = info.getRoutingKey() == null ? null : info.getRoutingKey().asString();
        SecurityManager securityManager = getVirtualHost().getSecurityManager();
        if (!securityManager.authorisePublish(info.isImmediate(), routingKey, e.getName()))
        {
            throw new AMQSecurityException("Permission denied: " + e.getName());
        }
        _currentMessage = new IncomingMessage(info, getProtocolSession().getReference());
        _currentMessage.setExchange(e);
View Full Code Here

        super.setUp();

        CurrentActor.setDefault(mock(LogActor.class));
        _exchange = new HeadersExchange();
        _virtualHost = mock(VirtualHost.class);
        SecurityManager securityManager = mock(SecurityManager.class);
        when(_virtualHost.getSecurityManager()).thenReturn(securityManager);
        when(securityManager.authoriseBind(any(Exchange.class), any(AMQQueue.class), anyString())).thenReturn(true);
        when(securityManager.authoriseUnbind(any(Exchange.class), anyString(), any(AMQQueue.class))).thenReturn(true);

        _exchange.initialise(UUID.randomUUID(), _virtualHost, "test", false, false);

    }
View Full Code Here

    {
        CurrentActor.setDefault(mock(LogActor.class));

        _exchange = new FanoutExchange();
        _virtualHost = mock(VirtualHost.class);
        SecurityManager securityManager = mock(SecurityManager.class);
        when(_virtualHost.getSecurityManager()).thenReturn(securityManager);
        when(securityManager.authoriseBind(any(Exchange.class), any(AMQQueue.class), anyString())).thenReturn(true);
        when(securityManager.authoriseUnbind(any(Exchange.class), anyString(), any(AMQQueue.class))).thenReturn(true);

        _exchange.initialise(UUID.randomUUID(), _virtualHost, "test", false, false);
    }
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.