Package org.apache.qpid.server.security

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


    }

    private void authorizeMethod(String methodName, VirtualHost host)
    {
        SecurityManager securityManager = host.getSecurityManager();
        securityManager.authoriseMethod(Operation.UPDATE, "VirtualHost.Queue", methodName);
    }
View Full Code Here


        _id = UUIDGenerator.generateVhostUUID(_name);

        _eventLogger.message(VirtualHostMessages.CREATED(_name));

        _securityManager = new SecurityManager(parentSecurityManager, _vhostConfig.getConfig().getString("security.acl"), _name);

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

        _houseKeepingTasks = new ScheduledThreadPoolExecutor(_vhostConfig.getHouseKeepingThreadCount());
View Full Code Here

        _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

        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);
        Operation operation = (isAccessMethod(methodName) || impact == MBeanOperationInfo.INFO) ? Operation.ACCESS : Operation.UPDATE;
        security.authoriseMethod(operation, type, methodName);

        if (_managementRightsInferAllAccess)
        {
            try
            {
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

            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 = ApplicationRegistry.getInstance().getSecurityManager();
            }
            else
            {
                security = ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost(vhost).getSecurityManager();
            }
           
      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 if (isUpdateMethod(methodName))
            {
              // Check for setting properties permission
                if (!security.authoriseMethod(Operation.UPDATE, type, methodName))
                {
                    throw new SecurityException("Permission denied: Update " + methodName);
                }
            }
      else
            {
              // Check for invoking/executing method action/operation permission
                if (!security.authoriseMethod(Operation.EXECUTE, type, methodName))
                {
                    throw new SecurityException("Permission denied: Execute " + methodName);
                }
            }
     
View Full Code Here

    }

    public void setPublishFrame(MessagePublishInfo info, final MessageDestination e)
    {
        String routingKey = info.getRoutingKey() == null ? null : info.getRoutingKey().asString();
        SecurityManager securityManager = getVirtualHost().getSecurityManager();

        securityManager.authorisePublish(info.isImmediate(), routingKey, e.getName());

        _currentMessage = new IncomingMessage(info);
        _currentMessage.setMessageDestination(e);
    }
View Full Code Here

        super(parentsMap(parent), attributes);

        _logRecorder = parent.getLogRecorder();
        _eventLogger = parent.getEventLogger();
        _brokerOptions = parent.getBrokerOptions();
        _securityManager = new SecurityManager(this, _brokerOptions.isManagementMode());
        if (_brokerOptions.isManagementMode())
        {
            Map<String,Object> authManagerAttrs = new HashMap<String, Object>();
            authManagerAttrs.put(NAME,"MANAGEMENT_MODE_AUTHENTICATION");
            authManagerAttrs.put(ID, UUID.randomUUID());
View Full Code Here

        Broker broker = mock(Broker.class);
        when(broker.getConnection_sessionCountLimit()).thenReturn(1);
        when(broker.getConnection_closeWhenNoRoute()).thenReturn(false);
        when(broker.getId()).thenReturn(UUID.randomUUID());
        when(broker.getSubjectCreator(any(SocketAddress.class), anyBoolean())).thenReturn(subjectCreator);
        when(broker.getSecurityManager()).thenReturn(new SecurityManager(broker, false));
        when(broker.getObjectFactory()).thenReturn(objectFactory);
        when(broker.getModel()).thenReturn(objectFactory.getModel());
        when(broker.getModelVersion()).thenReturn(BrokerModel.MODEL_VERSION);
        when(broker.getEventLogger()).thenReturn(eventLogger);
        when(broker.getCategoryClass()).thenReturn(Broker.class);
View Full Code Here

TOP

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

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.