You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I assume you have the default EMQX file authorization enabled, which ends with {allow, all}. rule.
As this is matched (before calling exhook), external on_client_authorize is not even called and message processing continues, triggering on_message_publish ex hook.
If my assumption is correct, please try disabling File authorization in EMQX dashboard and repeat the experiment.
Thanks for the quick response, unfortunately I do not have the emqx file authorization enabled as well as any other auth/authorization option enabled. Everything pass though exhooks, and my client authorize hook is called as it prints to stdout and does some work on my back end.
Also when returning false it successfully blocks any unauthorized subscribe request
Only the publish hook seem to be called even after a failure of the authorization
I unfortunately was unable to replicate the bug Friday and today at work so i'll close the issue. If it shows up again i'll reopen it and provide you the logs of the broker.
What happened?
When using ex hooks the publish handler is called event when the authorize hooks return false.
What did you expect to happen?
When the authorize hooks return false, drop the current message and continue the execution without trying to route the message to save resources
How can we reproduce it (as minimally and precisely as possible)?
using the following on_client_authorize handler
using the following on_message_publish handler
you can see the request being forwarded to the on_message_publish handler even if the authorize hook returned false
Anything else we need to know?
No response
EMQX version
OS version
Log files
The text was updated successfully, but these errors were encountered: