From 07186d8f258439f2daa900c7567812f29f29531e Mon Sep 17 00:00:00 2001 From: Christos Malliaridis Date: Sat, 9 Nov 2024 14:51:33 +0100 Subject: [PATCH 1/3] Do not print password when basic auth is enabled --- solr/core/src/java/org/apache/solr/cli/AuthTool.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/cli/AuthTool.java b/solr/core/src/java/org/apache/solr/cli/AuthTool.java index 817b0093748..d69abba4af8 100644 --- a/solr/core/src/java/org/apache/solr/cli/AuthTool.java +++ b/solr/core/src/java/org/apache/solr/cli/AuthTool.java @@ -414,9 +414,8 @@ private void handleBasicAuth(CommandLine cli) throws Exception { final String successMessage = String.format( Locale.ROOT, - "Successfully enabled basic auth with username [%s] and password [%s].", - username, - password); + "Successfully enabled basic auth with username [%s].", + username); echo(successMessage); return; case "disable": From d6416059048e8d4ca7a14e4b8112e40d8168140e Mon Sep 17 00:00:00 2001 From: Christos Malliaridis Date: Sat, 9 Nov 2024 18:43:29 +0100 Subject: [PATCH 2/3] Run tidy --- solr/core/src/java/org/apache/solr/cli/AuthTool.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/cli/AuthTool.java b/solr/core/src/java/org/apache/solr/cli/AuthTool.java index d69abba4af8..d7e4ca715fc 100644 --- a/solr/core/src/java/org/apache/solr/cli/AuthTool.java +++ b/solr/core/src/java/org/apache/solr/cli/AuthTool.java @@ -413,9 +413,7 @@ private void handleBasicAuth(CommandLine cli) throws Exception { includeFile.toPath(), basicAuthConfFile.getAbsolutePath(), null); final String successMessage = String.format( - Locale.ROOT, - "Successfully enabled basic auth with username [%s].", - username); + Locale.ROOT, "Successfully enabled basic auth with username [%s].", username); echo(successMessage); return; case "disable": From 8aec04b9c7691f9204dff1d5cd7e7db6385f17cb Mon Sep 17 00:00:00 2001 From: Eric Pugh Date: Thu, 12 Dec 2024 09:24:59 -0500 Subject: [PATCH 3/3] Track change --- solr/CHANGES.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index f8a7ae0de27..e46e9d9d1ae 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -215,6 +215,8 @@ Improvements * SOLR-16470: Replication "fetch file" API now has a v2 equivalent, available at `GET /api/cores/coreName/replication/files/fileName` (Matthew Biscocho via Jason Gerlowski) +* SOLR-17554: Suppress printing out of password to console when using auth CLI command. (Christos Malliaridis via Eric Pugh) + Optimizations ---------------------