merlimat commented on a change in pull request #2981: Allow subscribers to
access subscription admin-api
URL: https://github.com/apache/pulsar/pull/2981#discussion_r233597320
##########
File path:
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/AuthorizationProvider.java
##########
@@ -71,6 +71,18 @@
CompletableFuture<Boolean> canConsumeAsync(TopicName topicName, String
role,
AuthenticationDataSource authenticationData, String subscription);
+ /**
+ * Returns authorized roles that can access admin-api for given
subscription
+ *
+ * @param topicName
+ * the fully qualified topic name associated with the topic.
+ * @param subscription
+ * the subscription name defined by the client
+ * @return
+ */
+ CompletableFuture<Set<String>> getAuthorizedRolesOnSubscription(TopicName
topicName,
Review comment:
> If we enforce subscription-authorization in canConsume method then all
existing consumer will start failing because we don't set this permission
explicitly.
Wouldn't that be only addictive? We have multiple levels in the
authorization:
* Namespace-wide (`produce`/`consume`)
* Per-Topic (`produce`/`consume`)
* Per-Subscription (across topics) (`consume`)
As long as a "principal" is granted permission on any level, it should be
allowed to consume messages and perform "consumer-related" admin operations.
That shouldn't break any existing consumer, right?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services