mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 22:11:36 -05:00
A session admitted on 8883 by its certificate, or by a custom authorizer (the default one for unsigned MQTT over WebSocket), is now authorized per packet: iot:Subscribe on topicfilter/<filter>, iot:Publish and iot:Receive on topic/<topic>, with the connect's condition keys and policy variables. A certificate's policies are re-read on every check, so an attach, a detach or a new default version reaches an open session. A denied SUBSCRIBE or PUBLISH closes an MQTT 3.1.1 connection with the lifecycle reason AUTH_ERROR and gets reason code 0x87 on MQTT 5 (SUBACK, QoS 1 PUBACK, or DISCONNECT for QoS 0). A denied publish is not recorded, run through topic rules or delivered, and iot:Receive is checked on every delivery, retained messages and those stored for a resumed persistent session included. Closes #8643