This repository has been archived by the owner on Feb 11, 2020. It is now read-only.
Allow published messages on an unauthorised publish topic to be pubacked #638
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A simple change to the client which if passed success === 'ignore' (as a string) from the user's authorizePublish function, will puback the message but not publish it.
This solves an issue for me where if a message is published to an unauthorized topic, the broker in node-red is disconnected (and does not reconnect). Since the broker module in NR could be serving multiple clients, one rouge flow can kill all access to the MQTT server.
Of course, you can have no way to know your message was not published apart from custom server code...
It goes some way towards:
'Client connection closed if publish is not authorized #596'
example authorize function: