tiagomlalves commented on code in PR #3602:
URL: https://github.com/apache/cassandra/pull/3602#discussion_r1794245721


##########
src/java/org/apache/cassandra/auth/IAuthenticator.java:
##########
@@ -54,6 +57,17 @@ public interface IAuthenticator
      */
     void setup();
 
+    /**
+     * Allows custom authenticators to return a {@link AuthenticateMessage} 
with a known
+     * authenticator implementation (e.g. 
"com.datastax.bdp.cassandra.auth.DseAuthenticator"
+     * which enables SASL scheme negotiation) based on {@link Connection} and 
{@link ClientState}
+     * information.
+     */
+    default AuthenticateMessage getAuthenticateMessage(Connection connection, 
ClientState clientState)

Review Comment:
   @tolbertam I have wondered about the same. I don't know the code well enough 
to know if it's safe to pass `ServerConnection` here. 
   
   From code inspection is see that we can create a `ClientState` without an 
`InetSocketAddress`. In this scenario, I would assume that we can't cast 
`Connection` as `ServerConnection` and hence cannot fetch `ClientState` from 
it. It was because of this assumption I've proposed adding `Connection` in 
addition to `ClientState`. This assumption can be wrong and I'm not sure at 
this stage how to validate it.
   
   If we go with a single parameter, my proposal would be to use the object 
that causes less harm / contains just enough information. I believe that would 
be `ClientState` since we can already fetch information about driver and 
version and potentially add others there.
   
   wdyt?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to