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 2020/12/04 07:50:35 UTC

[GitHub] [pulsar] sijie commented on a change in pull request #8824: [Issue 8338][Function Worker] Splitting the authentication logic of function worker and client

sijie commented on a change in pull request #8824:
URL: https://github.com/apache/pulsar/pull/8824#discussion_r535900038



##########
File path: pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/worker/WorkerConfig.java
##########
@@ -273,6 +273,11 @@
         doc = "The frequency of instance liveness check, in milliseconds"
     )
     private long instanceLivenessCheckFreqMs;
+    @FieldContext(
+            category = CATEGORY_CLIENT_SECURITY,
+            doc = "Whether to enable the broker client authentication used by function workers to talk to brokers"
+    )
+    private boolean brokerClientAuthenticationEnabled = false;

Review comment:
       Don't use `boolean`. This would cause a compatibility issue. The worker service is not able to start with an old configuration.
   
   Use boxed `Boolean`.
   
   ```
   private Boolean brokerClientAuthenticationEnabled = null;
   ```
   
   Then add an implementation `isBrokerClientAuthenticationEnabled` to check if `brokerClientAuthenticationEnabled` is set or not. If `brokerClientAuthenticationEnabled` is not set, fall back to use `authenticationEnabled`.
   
   ```
   public boolean isBrokerClientAuthenticationEnabled() {
       if (brokerClientAuthenticationEnabled != null) {
           return brokerClientAuthenticationEnabled;
       } else {
           return authenticationEnabled;
       }
   }
   ```




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