michaeljmarshall commented on code in PR #20713:
URL: https://github.com/apache/pulsar/pull/20713#discussion_r1267481135


##########
pulsar-broker-auth-sasl/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationProviderSasl.java:
##########
@@ -110,6 +113,8 @@ public void initialize(ServiceConfiguration config) throws 
IOException {
             throw new IllegalArgumentException(msg);
         }
         this.signer = new SaslRoleTokenSigner(secret);
+        this.authStates = Caffeine.newBuilder()
+                .expireAfterWrite(config.getInflightSaslContextExpiryMs(), 
TimeUnit.MILLISECONDS).build();

Review Comment:
   This kind of caching would still be vulnerable to a high frequency of calls, 
similar to a TCP SYN flood. Should we also put an upper limit on the number of 
in flight contexts so that old contexts are dropped? 



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

Reply via email to