sijie commented on a change in pull request #3383:  refactor 
AuthorizationProvider interface to allow custom logic for determining super user
URL: https://github.com/apache/pulsar/pull/3383#discussion_r248884418
 
 

 ##########
 File path: 
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/AuthorizationProvider.java
 ##########
 @@ -35,6 +35,14 @@
  */
 public interface AuthorizationProvider extends Closeable {
 
+    /**
+     * Check if specified role is a super user
+     * @param role the role to check
+     * @return a CompletableFuture containing a boolean in which true means 
the role is a super user
+     * and false if it is not
+     */
+    CompletableFuture<Boolean> isSuperUser(String role);
 
 Review comment:
   this looks like breaking binary compatibility, if a user has a customized 
authorization provider.
   
   can we try to make it a default method?
   
   ```
   default CompletableFuture<Boolean> isSuperUser(String role) {
       return Futures.value(false);
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to