Technoboy- commented on code in PR #20456:
URL: https://github.com/apache/pulsar/pull/20456#discussion_r1213287482
##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:
##########
@@ -249,6 +249,31 @@ public CompletableFuture<Void>
grantPermissionAsync(TopicName topicName, Set<Aut
});
}
+ @Override
+ public CompletableFuture<Void> revokePermissionAsync(TopicName topicName,
String role) {
+ return getPoliciesReadOnlyAsync().thenCompose(readonly -> {
+ if (readonly) {
+ if (log.isDebugEnabled()) {
+ log.debug("Policies are read-only. Broker cannot do
read-write operations");
+ }
+ throw new IllegalStateException("policies are in readonly
mode");
+ }
+ return pulsarResources.getNamespaceResources()
+ .setPoliciesAsync(topicName.getNamespaceObject(), policies
-> {
+ policies.auth_policies.getTopicAuthentication()
+ .computeIfAbsent(topicName.toString(), __ ->
new HashMap<>())
Review Comment:
Fixed
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]