Comments (7)
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.
@ashishislive : It is merged to main. Would be great if you could test again.
from vernemq.
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.
@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.
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.
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.
@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)
- Environment variables for erlang configuration HOT 3
- Multiple connections using same client_id and username HOT 9
- Changes in mysql.lua file to not match client_id from myql HOT 3
- Using username in a TLS context is inappropriate HOT 3
- Need help with ECONNRESET using mqtt.js and VerneMQ HOT 5
- Add api Key using environment variables HOT 10
- [Bug]: Caching for auth_on_xxx_m5 hooks is not working HOT 8
- max_request_line_length config has no effect for HTTP sessions
- [Question]: Does VerneMQ support RocksDB in 1.13.0? HOT 12
- [Bug]: Issues with the correct CPU quota detection on k8s v1.26 HOT 12
- [Bug]: Outgoing QoS upgrades not affecting storage of offline messages HOT 5
- Enhancement: MQTT TLS listeners with multiple TLS versions.
- [Bug]: Loss of retained QoS 1 messages across cluster nodes HOT 1
- [Bug]: <title>HIGH CPU for VerneMQ (beam.smp) HOT 3
- Support Alternative TCP listener with proxy protocol enabled by default HOT 6
- VerneMQ HTTPs support HOT 12
- [Bug]: Websockets upgrade request: HTTP 431: Request Header Fields Too Large with big cookies HOT 11
- [Bug]: CRASH REPORT Process with 0 neighbours crashed with reason: bad argument in vmq_cluster_com:process_bytes/3 line 171 HOT 1
- Seeing various messages in the logs when under load HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vernemq.