From 1f2b1f5cae39108c2e7ae5b304a94026fb83f0ba 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 37afb22868..e76ee8131e 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(); }