[ 
https://issues.apache.org/activemq/browse/AMQ-775?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Strachan resolved AMQ-775.
--------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 5.2.0)
                   5.1.0

I've added the test case MessageAuthenticationTest to show things working 
correctly. I applied your patches - thanks! Things now seem to work fine.

> MessageAuthorizationPolicy doesn't work
> ---------------------------------------
>
>                 Key: AMQ-775
>                 URL: https://issues.apache.org/activemq/browse/AMQ-775
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 4.0
>         Environment: windows NT 2003 server
>            Reporter: Ning Li
>            Assignee: James Strachan
>             Fix For: 5.1.0
>
>
> Use default config, set a MessageAuthorizationPolicy to BrokerService and 
> start the broker.
> There are several issues:
> 1) In BrokerService::startTransportConnector() method, 
> connector.setMessageAuthorizationPolicy(policy); is in the wrong place, it 
> should be moved to almost the very end of the method, otherwise if you use 
> JMX, the ManageedTransportConnector won't have authorization policy info.
> 2) ManagedTransportConnector doesn't pass the auth policy to 
> ManagedTransport, I think the easiest way to fix it is in AbstractConnection 
> constructor,
> adding this line:
>     this.messageAuthorizationPolicy = 
> connector.getMessageAuthorizationPolicy();
> and remove this line:
>    answer.setMessageAuthorizationPolicy(messageAuthorizationPolicy); 
> from TransportConnector::createConnection(), then it will work for both 
> TransportConnection and ManagedTransportConnection
> 3) AbstrctConnection doesn't pass the auth policy to ConnectionContext, I 
> think this can be fixed by adding this line:
>   context.setMessageAuthorizationPolicy(this.getMessageAuthorizationPolicy());
> to AbstractConnection::processAddConnection() method.
> Now the auth policy can be reached by 
> MessageAuthorizationPolicy::isAllowedToConsume(ConnectionContext context, 
> Message message) method, but the real problem is message value is null, but 
> we need to use it to check right, some of the right information is a property 
> inside the message. 
> Please take a look at the problem, thanks

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to