GithubHelp home page GithubHelp logo

Comments (7)

mths1 avatar mths1 commented on May 28, 2024

Thank you very much for reporting this. If the plugin is disabled (which it is by default) it is impossible to send data through the rest api. It it is enabled, I can confirm that vmq_http_pub is part of the default listerners, which is different than what is documented. I also consider to enforce API Keys as a best practice, so that there are secure defaults.

from vernemq.

mths1 avatar mths1 commented on May 28, 2024

@ashishislive : It is merged to main. Would be great if you could test again.

from vernemq.

ashishislive avatar ashishislive commented on May 28, 2024

Thank you for checking this. I've gone through testing on top of the incoming changes, now the endpoint http://127.0.01:8888/restmqtt/api/v1/publish start throwing 404 instead of success. Seems like it is no longer part of default listener. (I think it is expected behaviour as per your changes)

I also noticed when using separate listener.http.http_pub = 127.0.0.1:3001 it always through 401 even passing valid apikey. Please find sample request below:

curl --location 'http://127.0.0.1:3001/restmqtt/api/v1/publish' \ --header 'Content-Type: application/json' \ --header 'X-API-KEY: Bgy8eon7sxQsRMHO6Ll8BtlLYR5UIn2X' \ --data '{ "topic": "test", "user": "testuser", "password": "test123", "qos": 1, "retain": false, "payload": "this is a payload string", "user_properties": [{"a":"b"}] }'

from vernemq.

ioolkos avatar ioolkos commented on May 28, 2024

@ashishislive
Can you try adding an API key for your http_pub listener: vmq-admin api-key create scope=httppub and then use that in the request?
(docs: https://docs.vernemq.com/v/master/live-administration/http-administration)


👉 Thank you for supporting VerneMQ: https://github.com/sponsors/vernemq
👉 Using the binary VerneMQ packages commercially (.deb/.rpm/Docker) requires a paid subscription.

from vernemq.

ashishislive avatar ashishislive commented on May 28, 2024

The issue is resolved after using scope=httppub, apikey created without scope does not work (expected as it belong to different module). Although I did not find any document about httppub scope. I think there is room for improvement in documentation.

from vernemq.

ashishislive avatar ashishislive commented on May 28, 2024

Original issue is resolved hence closing the issue with following notes:

  • Default http listener no longer part of vmq_http_pub (expected)
  • Scope specific (httppub) Api key required for authentication (expected)

There is room for improvement in documentation for the same.

from vernemq.

ioolkos avatar ioolkos commented on May 28, 2024

@ashishislive Thanks for testing & apologies for the missing docs.


👉 Thank you for supporting VerneMQ: https://github.com/sponsors/vernemq
👉 Using the binary VerneMQ packages commercially (.deb/.rpm/Docker) requires a paid subscription.

from vernemq.

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.