auth_on_publish_m5hooks which acts as an application level firewall granting or rejecting a publish message.
auth_on_publish_m5hooks allow your plugin to grant or reject publish requests sent by a client. It also enables to rewrite the publish topic, payload, qos, or retain flag and in the case of
auth_on_publishhook is specified in the Erlang behaviour auth_on_publish_hook and the
auth_on_publish_m5hook in the auth_on_publish_m5_hook behaviour available in the vernemq_dev repo.
auth_on_publish_m5hooks are part of a conditional plugin chain. For this reason we allow the hook to return different values. In case the plugin can't validate the publish message it is best to return
nextas this would allow subsequent plugins in the chain to validate the request. If no plugin is able to validate the request it gets automatically rejected.
on_deliver_m5hooks allow your plugin to get informed about outgoing publish messages, but also allows you to rewrite topic and payload of the outgoing message. The hook is specified in the Erlang behaviour on_deliver_hook and the
on_deliver_m5hook in the on_deliver_m5_hook behaviour available in the vernemq_dev repo.
on_deliver_m5hooks are part of a conditional plugin chain, although NO verdict is required in this case. The message gets delivered in any case. If your plugin uses this hook to rewrite the message the plugin system stops evaluating subsequent plugins in the chain.