-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Broker] Remove tenant permission verification when list partitioned-topic #13138
[Broker] Remove tenant permission verification when list partitioned-topic #13138
Conversation
@yuruguo:Thanks for your contribution. For this PR, do we need to update docs? |
@yuruguo:Thanks for providing doc info! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change LGTM, just left a comment about the test.
pulsar-broker/src/test/java/org/apache/pulsar/client/api/AuthorizationProducerConsumerTest.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After second thought, I think this one might need a little more attention. I think I agree that you shouldn't need tenant admin permissions here, but the annotation on the endpoints that call this method indicate that the role should be an admin. It'd be worth looking at the history for these methods to see why that level of permission is required. It might also be worth sending a note to the dev@ mailing list since this is a change the affects security and authorization.
@@ -172,7 +172,6 @@ | |||
} | |||
|
|||
protected List<String> internalGetPartitionedTopicList() { | |||
validateAdminAccessForTenant(namespaceName.getTenant()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are going to remove this line, we should update the annotations on the two methods that call internalGetPartitionedTopicList()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
In addition, we should also update the annotations on the method that call internalGetList()
.
pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Lines 149 to 150 in 01d73aa
protected List<String> internalGetList() { | |
validateNamespaceOperation(namespaceName, NamespaceOperation.GET_TOPICS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
this is very good.
Probably we should do this also for "produce" permissions
@michaeljmarshall Could you please help take a look at this PR? |
…pics (apache#13138) * [Broker] Remove tenant permission verification when list partitioned-topic * Improve test * Update annotation
Motivation
We should not verify tenant permission when get partitioned-topic list, in fact, role with consumption permissions of namespace can get it.
Modifications
validateAdminAccessForTenant(namespaceName.getTenant());
inPersistentTopicsBase#internalGetPartitionedTopicList
Documentation
no-need-doc