Giter Club home page Giter Club logo

Comments (4)

SergeTupchiy avatar SergeTupchiy commented on June 23, 2024

Hi @TxMat ,

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.

from emqx.

TxMat avatar TxMat commented on June 23, 2024

Hi @SergeTupchiy

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

Is this expected behaviour?

from emqx.

SergeTupchiy avatar SergeTupchiy commented on June 23, 2024

@TxMat,
It's not expected. Can you check what happens on EMQX side when you publish a message?
Does it log a warning like:

2023-12-01T11:34:41.542812+02:00 [warning] msg: cannot_publish_to_topic, mfa: emqx_channel:process_publish/2(641), peername: 127.0.0.1:56052, clientid: mqttx-cli-pub, topic: t/test, reason: not_authorized

?

from emqx.

TxMat avatar TxMat commented on June 23, 2024

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.

from emqx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.