You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/08/23 16:14:00 UTC

[GitHub] [pulsar] sijie commented on a change in pull request #5008: [Pulsar IO]Support reload Source and Sink for Pulsar IO

sijie commented on a change in pull request #5008: [Pulsar IO]Support reload Source and Sink for Pulsar IO
URL: https://github.com/apache/pulsar/pull/5008#discussion_r317203732
 
 

 ##########
 File path: pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java
 ##########
 @@ -897,6 +897,23 @@ void updateRequest(final FunctionMetaData functionMetaData) {
         return this.worker().getConnectorsManager().getConnectors();
     }
 
+    public void reloadConnectors(String clientRole) {
+        if (!isWorkerServiceAvailable()) {
+            throwUnavailableException();
+        }
+        if (worker().getWorkerConfig().isAuthorizationEnabled()) {
+            // Only superuser has permission to do this operation.
+            if (!isSuperUser(clientRole)) {
+                throw new RestException(Status.FORBIDDEN, "Need to admin authenticate to perform the request");
 
 Review comment:
   ```suggestion
                  throw new RestException(Status.UNAUTHORIZED, "This operation requires super-user access");
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services