-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doing topic checking also in publish requests #190
base: master
Are you sure you want to change the base?
Conversation
I find this update very useful! Thank you |
I was really surprised when I tried it a while ago and realized that it didn't check on publish. I would definitely use this feature! However I think the plugin needs to be able to differentiate between publish and subscribe, to allow more advanced rules, for example if someone should be able to read from a topic but not publish to it. |
I suggest you fork @jacoposartini repo, make the changes and start a new pull request |
I am working on a Django project which consists of a platform for remote control of IoT devices.
To integrate MQTT with the database I wrote a plugin in order to limit the access of users only to the topics to which they are authorized.
When doing some tests I realized that the topic checking is only performed in the sub requests, while in the pub requests anyone can publish in the topics reserved for other users.
Looking at the code in broker.py I found that the method topic_filtering() is called only in the sub requests.
To solve this problem I added a method that calls the topic filtering in the pub requests that come from the users.