From 59987dc12fee6ba4a197ca38713808735ae0128b Mon Sep 17 00:00:00 2001 From: Denis Potapov Date: Thu, 12 Oct 2023 15:51:32 +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 f3948f4e05..108d34ffe1 100644 --- a/src/java/org/apache/cassandra/transport/messages/StartupMessage.java +++ b/src/java/org/apache/cassandra/transport/messages/StartupMessage.java @@ -118,8 +118,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(); }