eclipse-paho / eclipse-paho/paho.mqtt.python
ACL deny by server on Publish still produces Success in client (python)
- Dominant language
- Python
- Stars
- 2.4k
- Forks
- 742
- Avg merge
- 12d 48m
- Merged PRs (30d)
- 1
Description
# Bug Description
A python client publishing to a topic denied by ACL still gets a '0/success' reason_code
# Reproduction
- Clone https://gist.github.com/nipil/75e9d7cd4edbf1ae8024f0507cc7dc62
- Create `.devcontainer/` folder and move `devcontainer.json` (gists do not allow folders)
- Open folder as DevContainer in VS code (or similar)
- Open a terminal and run `python3 test.py`
# Environment
* Python version: 3.11
* Library version: paho-mqtt 2.1
* Operating system (including version): docker/linux
* MQTT server : mosquitto 2.0.21
* server authentication : user `foo` password `foo`
# Logs
Publishing to `foo` by authenticated `foo` user : _expected "Success", got "Success"_
```
CLIENT : Sending PUBLISH (d0, q0, r0, m1), 'b'foo'', ... (3 bytes)
SERVER: Received PUBLISH from auto-03B09290-F39A-6397-1F35-9F5F045BD652 (d0, q0, r0, m0, 'foo', ... (3 bytes))
CLIENT : on_publish mid=1 reason_code=0/Success
```
Publishing to `bar` by authenticated `foo` user : _expected **anything but** "Success", yet **still got** "Success"_
```
CLIENT: Sending PUBLISH (d0, q0, r0, m2), 'b'bar'', ... (3 bytes)
SERVER: Denied PUBLISH from auto-03B09290-F39A-6397-1F35-9F5F045BD652 (d0, q0, r0, m0, 'bar', ... (3 bytes))
CLIENT: on_publish mid=2 reason_code=0/Success
```
In case this is a normal/accepted/de-facto behaviour, please provide some insight as to :
- where this is communicated in the documentation or specification
- how it could be changed so that clients are actually notified of denyed publish
Thanks in advance
Contributor guide
Assessment
This issue has not been assessed yet.