Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mosquitto-dev] User properties not available on MOSQ_EVT_ACL_CHECK events

Hi everyone,

I already posted my question as a Github issue:
https://github.com/eclipse-mosquitto/mosquitto/issues/3176.
But since I don't know if that is the correct location for my question I
thought I also post it here:

When listening for MOSQ_EVT_ACL_CHECK events in a plugin you get
event_data of type mosquitto_evt_acl_check which includes properties.
However, those properties are set explicitly to NULL inside
mosquitto_acl_check before the event listeners are called. So at the
time of the ACL check the plugins have no access to any (user) properties.

In case of a publish-packet the MOSQ_EVT_MESSAGE event is fired after
the ACL check. And the event_data there (type mosquitto_evt_message)
will contain (user) properties, because they are handled inside
handle_publish, stored in msg and passed over to the listeners.

But in case of a subscribe-packet there is no additional event that gets
fired, besides the ACL event. So inside your plugin you cannot access
user properties for subscriptions. But these are part of the MQTT 5 spec.

More interestingly, I found the following comment inside handle_subscribe:
/* Note - User Property not handled */

Is there a reason why user properties are not handled during subscribe
and are being explicitly set to NULL inside mosquitto_acl_check?

I already implemented user properties for subscribtions. So I could
create a pull request, but I am wondering about the comment in the code
(see above) and about the explicit NULL inside mosquitto_acl_check.

Best regards,
Manuel



Back to the top