sijie commented on a change in pull request #7523:
URL: https://github.com/apache/pulsar/pull/7523#discussion_r595569400



##########
File path: 
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/AuthorizationProvider.java
##########
@@ -293,7 +294,8 @@ default Boolean allowTenantOperation(String tenantName, 
String role, TenantOpera
                                                                     
NamespaceOperation operation,
                                                                     
AuthenticationDataSource authData) {
         return FutureUtil.failedFuture(
-            new IllegalStateException("NamespaceOperation is not supported by 
the Authorization provider you are using."));
+            new IllegalStateException("NamespaceOperation [" + 
operation.name() + "] is not supported by "

Review comment:
       You include the `policy.name()` in the change of line 368. But why 
didn't you add the same change here?

##########
File path: 
pulsar-broker/src/test/java/org/apache/pulsar/client/api/AuthenticatedProducerConsumerTest.java
##########
@@ -245,15 +245,8 @@ public void testAnonymousSyncProducerAndConsumer(int 
batchMessageDelayMs) throws
         
replacePulsarClient(PulsarClient.builder().serviceUrl(pulsar.getBrokerServiceUrl())
                 .operationTimeout(1, TimeUnit.SECONDS));
 
-        // unauthorized topic test
-        Exception pulsarClientException = null;
-        try {
-            
pulsarClient.newConsumer().topic("persistent://my-property/my-ns/other-topic")
-                    .subscriptionName("my-subscriber-name").subscribe();
-        } catch (Exception e) {
-            pulsarClientException = e;
-        }
-        Assert.assertTrue(pulsarClientException instanceof 
PulsarClientException);
+        
pulsarClient.newConsumer().topic("persistent://my-property/my-ns/other-topic")
+                .subscriptionName("my-subscriber-name").subscribe();
 

Review comment:
       No. `anonymousUser` shouldn't have the rights to the topics. This looks 
like a break change.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to