From 9702cc3d4a324d85b53e1b326e5afdc24896569f Mon Sep 17 00:00:00 2001 From: Denis Potapov Date: Thu, 14 Sep 2023 11:22:08 +0200 Subject: [PATCH] Stop advertising Aiven custom authenticator We decorate standard PasswordAuthenticator with a few platform specific features, that don't change the externally observable behavior - so it's absolutely compatible with PasswordAuthenticator. A few tools and client libraries do not support custom authenticators. For example: ZDM Proxy. They fail whenever they see anything but PasswordAuthenticator nevertheless they are in fact completely compatible. So we want to stop advertising our custom authenticator and pretend that it's a standard PasswordAuthenticator. --- .../cassandra/transport/messages/StartupMessage.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/java/org/apache/cassandra/transport/messages/StartupMessage.java b/src/java/org/apache/cassandra/transport/messages/StartupMessage.java index 172768c546..617168ee0c 100644 --- a/src/java/org/apache/cassandra/transport/messages/StartupMessage.java +++ b/src/java/org/apache/cassandra/transport/messages/StartupMessage.java @@ -117,8 +117,12 @@ else if (compression.equals("lz4")) clientState.setDriverVersion(options.get(DRIVER_VERSION)); } - if (DatabaseDescriptor.getAuthenticator().requireAuthentication()) - return new AuthenticateMessage(DatabaseDescriptor.getAuthenticator().getClass().getName()); + if (DatabaseDescriptor.getAuthenticator().requireAuthentication()) { + String authenticatorClassName = DatabaseDescriptor.getAuthenticator().getClass().getName(); + if (authenticatorClassName.equals("io.aiven.cassandra.auth.AivenAuthenticator")) + authenticatorClassName = "org.apache.cassandra.auth.PasswordAuthenticator"; + return new AuthenticateMessage(authenticatorClassName); + } else return new ReadyMessage(); }