Skip to content

Commit

Permalink
[improve][admin] Align the auth and check it at the first place for t…
Browse files Browse the repository at this point in the history
…opic related API (apache#22342)
  • Loading branch information
Technoboy- authored Apr 1, 2024
1 parent ce4ecd2 commit 50121e7
Show file tree
Hide file tree
Showing 4 changed files with 1,388 additions and 662 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,9 @@ protected CompletableFuture<PartitionedTopicMetadata> getPartitionedTopicMetadat
// validates global-namespace contains local/peer cluster: if peer/local cluster present then lookup can
// serve/redirect request else fail partitioned-metadata-request so, client fails while creating
// producer/consumer
return validateClusterOwnershipAsync(topicName.getCluster())
return validateTopicOperationAsync(topicName, TopicOperation.LOOKUP)
.thenCompose(__ -> validateClusterOwnershipAsync(topicName.getCluster()))
.thenCompose(__ -> validateGlobalNamespaceOwnershipAsync(topicName.getNamespaceObject()))
.thenCompose(__ -> validateTopicOperationAsync(topicName, TopicOperation.LOOKUP))
.thenCompose(__ -> {
if (checkAllowAutoCreation) {
return pulsar().getBrokerService()
Expand Down
Loading

0 comments on commit 50121e7

Please sign in to comment.