moscajs / aedes-cli

Run Aedes MQTT Broker from the CLI
MIT License
53 stars 19 forks source link

fail for not authorized subscribe #159

Closed wardv closed 1 year ago

wardv commented 1 year ago

not authorized subscribe attempts must generate an error

Not sure this is the solution you had in mind. Even though it works it does generate a lot of noise in the logs when the subscribe is retried (eg mosquitto_sub will loop trough CONNECT, fail to subscribe and DISCONNECT till you interrupt the command)

robertsLando commented 1 year ago

By checking aedes docs:

To negate a subscription, set the subscription to null. Aedes ignores the negated subscription and the qos in SubAck is set to 128 based on MQTT 3.11 spec:

So the other approach was good, the problem is I'm not sure minimatch is doing the check correctly

wardv commented 1 year ago

Right, I was still working with an old version of Aedes. This issue was fixed there https://github.com/moscajs/aedes/pull/720