MessageAuthorizationPolicy doesn't work
---------------------------------------
Key: AMQ-775
URL: https://issues.apache.org/activemq/browse/AMQ-775
Project: ActiveMQ
Type: Bug
Components: Broker
Versions: 4.0
Environment: windows NT 2003 server
Reporter: Ning Li
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.
-
If you think it was sent incorrectly contact one of the administrators:
https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira