Is there a way to do authorization decisions in repsecxt to the payload of a message? #7582
-
I wanted to write a plugin for RabbitMQ which can make authorizations decisions in with a label which is part of the payload of the message. I first though that by writing an AutZ-Plugin this should be simple, just unpack the payload in the check_*_access functions and get the label. But to my surprise the Payload/Msg is not part of the AuthzContext . Looking into the code of the MQTT-Plugin I don't see why it was not possible to include the Msg into the AuthZContext rabbitmq-server/deps/rabbitmq_mqtt/src/rabbit_mqtt_processor.erl Lines 1527 to 1534 in 9b33e01 Is there a reason for this decision? Other reason for doing checks on the payload
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
There is no. RabbitMQ treats message payload as an opaque sequence of bytes. With the exception of dead lettering, the message time stamp and node stamp plugins, RabbitMQ does not mess with messages. Even then it does not touch the payload. Authorization steps happen in the context of a protocol operation but message bodies are not present or involved at those moments. |
Beta Was this translation helpful? Give feedback.
There is no. RabbitMQ treats message payload as an opaque sequence of bytes. With the exception of dead lettering, the message time stamp and node stamp plugins, RabbitMQ does not mess with messages. Even then it does not touch the payload.
Authorization steps happen in the context of a protocol operation but message bodies are not present or involved at those moments.