You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "michaeljmarshall (via GitHub)" <gi...@apache.org> on 2023/01/25 06:50:03 UTC

[GitHub] [pulsar] michaeljmarshall commented on issue #19183: Improve testing for authorization to prevent regressions in topic operations related to subscriptions

michaeljmarshall commented on issue #19183:
URL: https://github.com/apache/pulsar/issues/19183#issuecomment-1403169833

   One comment on a potential design is to add something like the following to the `TopicOperation` enum:
   
   ```java
       static public boolean subscriptionNameRequiredForAuthorization(TopicOperation op) {
           switch (op) {
               case CONSUME:
               case RESET_CURSOR:
               case SKIP:
               case SUBSCRIBE:
               case UNSUBSCRIBE:
                   return true;
               default:
                   return false;
           }
       }
   ```
   
   The downside is that it would need to get evaluated on every call to authenticate. This could help third party plugins. However, I think the ideal solution catches issues with tests and not with verification in production runtime.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org