Hi,

> if I understand correctly creator of temporary queue is the only one that
is able to receive from it

I don't think the temporary queues work like this - unless they are created
as exclusive, someone else than the creator of the queue can connect to the
queue and the messages will be distributed between the consumers. This of
course expects the knowledge of the UUID used for the queue name.

-----

I use following rules for sending and receiving messages using temporary
queues. Maybe it helps you a bit, but it probably works a bit differently
from yours - I use separate namespace for every user and I use dedicated
exchange and bindings to route the responses. Apart from the "create queue"
rule which has the autodelete=true option, there is no difference between
temporary and non-temporary queues in the ACL rules.

SENDER:
 acl allow <user>@QPID publish exchange name=<exchangeName>
 acl allow <user>@QPID access  exchange name=<exchangeName>
 acl allow <user>@QPID access  queue name=<exchangeName>
e.g.
 acl allow sender@QPID publish exchange name=response
 acl allow sender@QPID access  exchange name=response
 acl allow sender@QPID access  queue name=response

In theory, you can also limit the routing key used by the sender, for
example
 acl allow sender@QPID publish exchange name=response
routingkey=response.receiver.#

RECEIVER:
 acl allow <username>@QPID create  queue    name=<prefix>.<username>.*
queuemaxcountupperlimit=1000 queuemaxcountlowerlimit=100
queuemaxsizeupperlimit=1024000 queuemaxsizelowerlimit=100000 paging=false
policytype=ring durable=false autodelete=true
 acl allow <username>@QPID delete  queue    name=<prefix>.<username>.*
 acl allow <username>@QPID consume queue    name=<prefix>.<username>.*
 acl allow <username>@QPID access  queue    name=<prefix>.<username>.*
 acl allow <username>@QPID access  exchange name=<prefix>.<username>.*
 acl allow <username>@QPID purge   queue    name=<prefix>.<username>.*
 acl allow <username>@QPID access  exchange name=<exchangeName>
 acl allow <username>@QPID access  queue    name=<exchangeName>
 acl allow <username>@QPID bind    exchange name=<exchangeName>
queuename=<prefix>.<username>.* routingkey=<prefix>.<username>.#
 acl allow <username>@QPID unbind  exchange name=<exchangeName>
queuename=<prefix>.<username>.* routingkey=<prefix>.<username>.#

e.g.
 acl allow receiver@QPID create  queue    name=response.receiver.*
queuemaxcountupperlimit=1000 queuemaxcountlowerlimit=100
queuemaxsizeupperlimit=1024000 queuemaxsizelowerlimit=100000 paging=false
policytype=ring durable=false autodelete=true
 acl allow receiver@QPID delete  queue    name=response.receiver.*
 acl allow receiver@QPID consume queue    name=response.receiver.*
 acl allow receiver@QPID access  queue    name=response.receiver.*
 acl allow receiver@QPID access  exchange name=response.receiver.*
 acl allow receiver@QPID purge   queue    name=response.receiver.*
 acl allow receiver@QPID access  exchange name=response
 acl allow receiver@QPID access  queue    name=response
 acl allow receiver@QPID bind    exchange name=response
queuename=response.receiver.* routingkey=response.receiver.#
 acl allow receiver@QPID unbind  exchange name=response
queuename=response.receiver.* routingkey=response.receiver.#

This allows the receiver to create a temporary queue names
response.receiver.blablabla and bind it to the exchange named response with
routing key response.receiver.blablabla. The sender can send messages to
this queue through the response exchange by using the appropriate routing
key. The sender doesn't send messages directly into the queue, but always
through the response exchange.

Jakub

On Mon, Mar 14, 2016 at 1:46 PM, Domen Vrankar <[email protected]>
wrote:

> Hi,
>
> I'm using qpid C++ 0.34 with SSL authentication.
>
> I have a mixture of durable and temporary queues and am trying to
> limit the access with ACL.
>
> All users have access to a single exchange for sending message but
> only some users have permission to read from one or more queues
> connected to that exchange.
> Also each program creates its own temporary queue
> (session_.createReceiver("#");) that should be used only as a reply
> queue but since it is a randomly generated UUID and expected messages
> have a certain reference id it's probably secured enough even if send
> permissions are not limited (if I understand correctly creator of
> temporary queue is the only one that is able to receive from it).
>
> With ACL list I use:
>
> acl allow send@QPID access exchange
> acl allow send@QPID access queue
> ...
>
> and everything works fine but is not very restrictive but if I try to
> limit access based on name:
>
> acl allow send@QPID access exchange name="send"
> acl allow send@QPID access queue name="receive"
> ...
>
> replying to temporary queues no longer works due to access permissions
> not being satisfied.
>
> Prefixing queue with a constant string and generating uuid manually
> for the rest of the name works fine with:
>
> acl allow send@QPID access exchange name="send"
> acl allow send@QPID access queue name="tmp.*"
> ...
>
> but this requires manual generation of queue names even though I don't
> need to know them outside the application since they are intended as
> direct reply queues only - address is provided in the message that
> triggers a reply.
>
> How can I represent temporary queues in ACL?
> Is it OK to use temporary queues as reply queues that exist as long as
> the owning application is running?
> Can you somehow limit access permissions so that temporary queue can
> only be accessed by the application that is replying to a received
> message?
>
> Thanks,
> Domen
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to