Skip to content
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

[Issue 10300][broker] Fix authorization error if partition number of partitioned topic is updated. #10333

Merged
merged 1 commit into from
May 6, 2021

Conversation

dragonls
Copy link
Contributor

@dragonls dragonls commented Apr 23, 2021

Fixes #10300

Motivation

Fix the bug that after updating the partition number of a partitioned topic, which has topic level auth policy, new producer/consumer of this topic will get error.

Modifications

In org.apache.pulsar.broker.authorization.PulsarAuthorizationProvider#checkPermission, if current topicName is a sub partition topic, also check the permissions of its partitioned topic.

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • Added tests if the partition number of a partitioned topic is updated

@dragonls
Copy link
Contributor Author

@tuteng @codelipenghui PTAL. Thanks.

@codelipenghui codelipenghui merged commit c1d5162 into apache:master May 6, 2021
eolivelli pushed a commit to eolivelli/pulsar that referenced this pull request May 11, 2021
…pdated. (apache#10300) (apache#10333)

Fixes apache#10300 

### Motivation

Fix the bug that after updating the partition number of  a partitioned topic, which has topic level auth policy, new producer/consumer of this topic will get error.

### Modifications

In [`org.apache.pulsar.broker.authorization.PulsarAuthorizationProvider#checkPermission`](https://github.com/apache/pulsar/blob/889b9b8e5efc62d2d0cbc761205fba5759c97af0/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java#L394), if current `topicName` is a sub partition topic, also check the permissions of its partitioned topic.
codelipenghui pushed a commit that referenced this pull request Jun 26, 2021
…pdated. (#10300) (#10333)

Fixes #10300 

### Motivation

Fix the bug that after updating the partition number of  a partitioned topic, which has topic level auth policy, new producer/consumer of this topic will get error.

### Modifications

In [`org.apache.pulsar.broker.authorization.PulsarAuthorizationProvider#checkPermission`](https://github.com/apache/pulsar/blob/889b9b8e5efc62d2d0cbc761205fba5759c97af0/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java#L394), if current `topicName` is a sub partition topic, also check the permissions of its partitioned topic.

(cherry picked from commit c1d5162)
@codelipenghui codelipenghui added the cherry-picked/branch-2.7 Archived: 2.7 is end of life label Jun 26, 2021
@dragonls dragonls deleted the fix-update-partition-auth branch October 8, 2022 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-picked/branch-2.7 Archived: 2.7 is end of life release/2.7.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to produce/consumer partitioned topic if updated the topic partition number
7 participants