Skip to content

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

Merged
codelipenghui merged 1 commit into
apache:masterfrom
dragonls:fix-update-partition-auth
May 6, 2021
Merged

[Issue 10300][broker] Fix authorization error if partition number of partitioned topic is updated.#10333
codelipenghui merged 1 commit into
apache:masterfrom
dragonls:fix-update-partition-auth

Conversation

@dragonls

@dragonls dragonls commented Apr 23, 2021

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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