Skip to content

MQTT: Keep connection open for authz failures (backport #15201)#15203

Merged
michaelklishin merged 5 commits intov4.2.xfrom
mergify/bp/v4.2.x/pr-15201
Jan 2, 2026
Merged

MQTT: Keep connection open for authz failures (backport #15201)#15203
michaelklishin merged 5 commits intov4.2.xfrom
mergify/bp/v4.2.x/pr-15201

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify bot commented Jan 2, 2026

This PR supersedes #15123.
The first commit contains the changes in #15123 contributed by @iamdrq .
The second commit contains some refactoring.


This is an automatic backport of pull request #15201 done by Mergify.

iamdrq and others added 2 commits January 2, 2026 19:14
Adjust mqtt disconnect comment

Add a config option to toggle mqtt disconnect on unauthorized topic

mqtt.disconnect_on_unauthorized=true(defualt)
disconnect the clinet when publish or subscribe unauthorized topic.

mqtt.disconnect_on_unauthorized=false
subscribe unauthorized topic,
reply SUBACK(non-authorized) and send retained messages for the successfully subscribed topics and keep connection.
publish unauthorized topic,
MQTT v5 and QoS1 reply with PUBACK including an error reason code and keep connection,
MQTT v3 and QoS1 reply with PUBACK no error reason code and keep connection,
QoS0 drop silently and keep connection.

Add a config option to toggle mqtt disconnect on unauthorized topic

mqtt.disconnect_on_unauthorized=true(defualt)
disconnect the clinet when publish or subscribe unauthorized topic.

mqtt.disconnect_on_unauthorized=false
subscribe unauthorized topic,
reply SUBACK(non-authorized) and send retained messages for the successfully subscribed topics and keep connection.
publish unauthorized topic,
QoS1 reply with PUBACK(non-authorized)  and keep connection,
QoS0 drop silently and keep connection.

(cherry picked from commit 9255b1d)
(cherry picked from commit 416bf86)
@mergify mergify bot assigned ansd Jan 2, 2026
@mergify mergify bot added the make label Jan 2, 2026
@michaelklishin michaelklishin added this to the 4.2.3 milestone Jan 2, 2026
@michaelklishin michaelklishin merged commit ffed301 into v4.2.x Jan 2, 2026
291 checks passed
@michaelklishin michaelklishin deleted the mergify/bp/v4.2.x/pr-15201 branch January 2, 2026 20:23
michaelklishin added a commit that referenced this pull request Jan 2, 2026
Keep the v4.1.x version of mergify.yml. Given that v4.1.x
is under community support for only one more month,
we don't need to bother with backports that cascade
further than v4.1.x.
michaelklishin added a commit that referenced this pull request Jan 2, 2026
michaelklishin added a commit that referenced this pull request Jan 3, 2026
MQTT: Keep connection open for authz failures (backport #15201) (backport #15203)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants