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


##########
pulsar-broker-auth-sasl/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationProviderSasl.java:
##########
@@ -72,6 +75,10 @@ public class AuthenticationProviderSasl implements 
AuthenticationProvider {
 
     private JAASCredentialsContainer jaasCredentialsContainer;
     private String loginContextName;
+    private Cache<Long, AuthenticationState> authStates;
+
+    private static final String AUTHENTICATION_SASL_PREFIX = 
"authentication_sasl_prefix";
+    private static final long AUTHENTICATION_SASL_DEFAULT_EXPIRE_MS = 60_000;

Review Comment:
   We have SASL configurations defined in 
[broker.conf](https://github.com/apache/pulsar/blob/master/conf/broker.conf#L885-L899),
 why not add a new one to the broker.conf?



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

Review Comment:
   Why the prefix name is used to get the SASL expiration value? Maybe we need 
another name like `saslStatesExpirationInMillis`?



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