[Broker] Remove tenant permission verification when list partitioned-topic#13138
[Broker] Remove tenant permission verification when list partitioned-topic#13138michaeljmarshall merged 3 commits intoapache:masterfrom yuruguo:remove_tenant_permission_verification_when_list_partitioned-topic
Conversation
|
@yuruguo:Thanks for your contribution. For this PR, do we need to update docs? |
|
@yuruguo:Thanks for providing doc info! |
codelipenghui
left a comment
There was a problem hiding this comment.
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
michaeljmarshall
left a comment
There was a problem hiding this comment.
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.
| } | ||
|
|
||
| protected List<String> internalGetPartitionedTopicList() { | ||
| validateAdminAccessForTenant(namespaceName.getTenant()); |
There was a problem hiding this comment.
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.
Nice!
In addition, we should also update the annotations on the method that call internalGetList().
eolivelli
left a comment
There was a problem hiding this comment.
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#internalGetPartitionedTopicListDocumentation
no-need-doc