Uploaded image for project: 'ActiveMQ Artemis'
  1. ActiveMQ Artemis
  2. ARTEMIS-1545

JMS MessageProducer fails to expose exception on send when message is sent non-persistent, but not authorised

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.6.3
    • 2.7.0
    • None
    • None

    Description

      When sending persistent, behaviour is blocking and a Security exception is thrown. The same behaviour that the client is exposed to the client when sending non-persistent, so that a client could log or take action asynchronously.

      This can be recreated easily by the following:

      Add the following security section , that means guest is not auth'd to send to "guest.cannot.send"
      activemq-artemis/tests/jms-tests/src/test/resources/broker.xml

      <security-setting match="guest.cannot.send">
      <permission type="createDurableQueue" roles="guest,def"/>
      <permission type="deleteDurableQueue" roles="guest,def"/>
      <permission type="createNonDurableQueue" roles="guest,def"/>
      <permission type="deleteNonDurableQueue" roles="guest,def"/>
      <permission type="consume" roles="guest,def"/>
      <permission type="browse" roles="guest,def"/>
      <permission type="send" roles="def"/>
      </security-setting>

      Then add the following tests to this test (first is proving exception correctly is thrown when persistent is sent using jms api, and second shows behaviour difference and no error):

      activemq-artemis/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SecurityTest.java

      /**

      • Login with valid user and password
      • But try send to address not authorised - Persistent
      • Should not allow and should throw exception
        */
        @Test
        public void testLoginValidUserAndPasswordButNotAuthorisedToSend() throws Exception
        Unknown macro: { ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp}

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              michael.andre.pearce Michael Andre Pearce
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: