Skip to content

Fix mqtt disconnect due to appId permission bug when namespace policies update#1813

Merged
Technoboy- merged 1 commit into
streamnative:masterfrom
oneby-wang:MQTTConsumer_appId_permisson_fix
Dec 22, 2025
Merged

Fix mqtt disconnect due to appId permission bug when namespace policies update#1813
Technoboy- merged 1 commit into
streamnative:masterfrom
oneby-wang:MQTTConsumer_appId_permisson_fix

Conversation

@oneby-wang
Copy link
Copy Markdown
Contributor

@oneby-wang oneby-wang commented Sep 8, 2025

Motivation

MQTTConsumer appId field is equivalent to the userRole in Authentication. The appId field will be used to do checkPermissionsAsync when namespace policies update.
https://github.com/apache/pulsar/blob/0a949de4bfa3734194be87a8655763a4411be1b6/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Consumer.java#L1042-L1044

Modifications

Before: appId is set to ""
After: appId is set to connection.getUserRole()

Verifying this change

  • Make sure that the change passes the CI checks.

Documentation

Check the box below.

Need to update docs?

  • doc-required

    (If you need help on updating docs, create a doc issue)

  • no-need-doc

    (Please explain why)

  • doc

    (If this PR contains doc changes)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Sep 8, 2025

@oneby-wang:Thanks for your contribution. For this PR, do we need to update docs?
(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

@oneby-wang oneby-wang changed the title Fix mqtt disconnect due to appId permission bug when namespace polici… Fix mqtt disconnect due to appId permission bug when namespace policies update Sep 25, 2025
@Technoboy- Technoboy- merged commit f2d4725 into streamnative:master Dec 22, 2025
6 of 7 checks passed
Technoboy- pushed a commit that referenced this pull request Dec 22, 2025
…es update (#1813)

Co-authored-by: oneby-wang <onebywang@qq.com>
Technoboy- pushed a commit that referenced this pull request Dec 22, 2025
…es update (#1813)

Co-authored-by: oneby-wang <onebywang@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants